X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad05b1880e5b7047b1de265f48fb104f73564119..971562cb51391676afccb9822e491d677f052c0d:/src/mac/carbon/dnd.cpp diff --git a/src/mac/carbon/dnd.cpp b/src/mac/carbon/dnd.cpp index 37c444ed78..53b046c2fb 100644 --- a/src/mac/carbon/dnd.cpp +++ b/src/mac/carbon/dnd.cpp @@ -24,6 +24,10 @@ #include "wx/gdicmn.h" #include "wx/mac/private.h" +#ifndef __DARWIN__ + #include +#endif + // ---------------------------------------------------------------------------- // global // ---------------------------------------------------------------------------- @@ -195,20 +199,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 ; + m_dataObject->SetData( wxDataFormat(wxDF_TEXT), dataSize , theData ); + } + #if wxUSE_UNICODE + else if ( theType == kScrapFlavorTypeUnicode ) { theData[dataSize]=0 ; - wxString convert( theData , wxConvLocal ) ; - m_dataObject->SetData( format, convert.Length() * sizeof(wxChar), (const wxChar*) convert ); + theData[dataSize+1]=0 ; + m_dataObject->SetData( wxDataFormat(wxDF_UNICODETEXT), dataSize , theData ); } + #endif else if ( theType == kDragFlavorTypeHFS ) { HFSFlavor* theFile = (HFSFlavor*) theData ;