unicode conversion support for text dnd

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27291 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2004-05-15 14:58:49 +00:00
parent 2575829710
commit 2b2832ef0c

View File

@@ -195,20 +195,34 @@ bool wxDropTarget::GetData()
Size dataSize ;
Ptr theData ;
GetFlavorDataSize((DragReference)m_currentDrag, theItem, theType, &dataSize);
if ( theType == 'TEXT' )
if ( theType == kScrapFlavorTypeText )
{
// this increment is only valid for allocating, on the next GetFlavorData
// call it is reset again to the original value
dataSize++ ;
}
else if ( theType == kScrapFlavorTypeUnicode )
{
// this increment is only valid for allocating, on the next GetFlavorData
// call it is reset again to the original value
dataSize++ ;
dataSize++ ;
}
theData = new char[dataSize];
GetFlavorData((DragReference)m_currentDrag, theItem, theType, (void*) theData, &dataSize, 0L);
if( theType == 'TEXT' )
if( theType == kScrapFlavorTypeText )
{
theData[dataSize]=0 ;
wxString convert( theData , wxConvLocal ) ;
m_dataObject->SetData( format, convert.Length() * sizeof(wxChar), (const wxChar*) convert );
m_dataObject->SetData( wxDataFormat(wxDF_TEXT), dataSize , theData );
}
#if wxUSE_UNICODE
else if ( theType == kScrapFlavorTypeUnicode )
{
theData[dataSize]=0 ;
theData[dataSize+1]=0 ;
m_dataObject->SetData( wxDataFormat(wxDF_UNICODETEXT), dataSize , theData );
}
#endif
else if ( theType == kDragFlavorTypeHFS )
{
HFSFlavor* theFile = (HFSFlavor*) theData ;