]> git.saurik.com Git - wxWidgets.git/commitdiff
fixes for file drops in unicode
authorStefan Csomor <csomor@advancedconcepts.ch>
Fri, 14 May 2004 13:13:36 +0000 (13:13 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Fri, 14 May 2004 13:13:36 +0000 (13:13 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27273 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/dataobj.cpp
src/mac/carbon/dnd.cpp

index 64dc8053d0a66b3b17c877793bd3a842dfac4f72..cc6f7df020f9b89abdf353a0828df12028d03ed4 100644 (file)
@@ -206,7 +206,10 @@ bool wxFileDataObject::SetData(
 {
     m_filenames.Empty();
 
-    AddFile(wxString::FromAscii((char*)pBuf));
+    // only add if this is not an empty string
+    // we can therefore clear the list by just setting an empty string
+    if ( (*(char*)pBuf) != 0 )
+        AddFile(wxString::FromAscii((char*)pBuf));
 
     return TRUE;
 }
index 5744c01f3dde21370c37ef40136328884cf5f5a9..37c444ed787cd901f169c7566d5a9cfe21aea87c 100644 (file)
@@ -213,13 +213,13 @@ bool wxDropTarget::GetData()
                         {
                             HFSFlavor* theFile = (HFSFlavor*) theData ;
                             wxString name = wxMacFSSpec2MacFilename( &theFile->fileSpec ) ;
-                            if (  firstFileAdded )
-                                ((wxFileDataObject*)m_dataObject)->AddFile( name ) ;
-                            else
+                            if ( !firstFileAdded )
                             {
-                                ((wxFileDataObject*)m_dataObject)->SetData( 0 , name.c_str() ) ;
+                                // reset file list
+                                ((wxFileDataObject*)m_dataObject)->SetData( 0 , "" ) ;
                                 firstFileAdded = true ;    
                             }
+                            ((wxFileDataObject*)m_dataObject)->AddFile( name ) ;
                         }
                         else
                         {