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