]> git.saurik.com Git - wxWidgets.git/commitdiff
unicode conversion support for text dnd
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 15 May 2004 14:58:49 +0000 (14:58 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 15 May 2004 14:58:49 +0000 (14:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27291 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/dnd.cpp

index 37c444ed787cd901f169c7566d5a9cfe21aea87c..14da3edf45433e1fb6ece8010a6d0ac64408c0ef 100644 (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 ; 
+                            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 ;