From: Stefan Csomor Date: Fri, 14 May 2004 13:13:36 +0000 (+0000) Subject: fixes for file drops in unicode X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ad05b1880e5b7047b1de265f48fb104f73564119 fixes for file drops in unicode git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27273 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/dataobj.cpp b/src/mac/carbon/dataobj.cpp index 64dc8053d0..cc6f7df020 100644 --- a/src/mac/carbon/dataobj.cpp +++ b/src/mac/carbon/dataobj.cpp @@ -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; } diff --git a/src/mac/carbon/dnd.cpp b/src/mac/carbon/dnd.cpp index 5744c01f3d..37c444ed78 100644 --- a/src/mac/carbon/dnd.cpp +++ b/src/mac/carbon/dnd.cpp @@ -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 {