fixes for file drops in unicode

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27273 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2004-05-14 13:13:36 +00:00
parent 0c3d85e6ef
commit ad05b1880e
2 changed files with 8 additions and 5 deletions

View 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;
}

View 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
{