]> git.saurik.com Git - wxWidgets.git/commitdiff
correcting Drag Data handling for 'TEXT' and 'utxt'
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 22 Aug 2005 08:49:38 +0000 (08:49 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 22 Aug 2005 08:49:38 +0000 (08:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/dnd.cpp

index d2b1702e91999bb409b4222e8dca7170e19d23a2..52b0cbbf9043e0df8d651a045a48260e08f66c83 100644 (file)
@@ -315,13 +315,18 @@ wxDragResult wxDropSource::DoDragDrop(int WXUNUSED(flags))
         Ptr dataPtr = new char[dataSize] ;
         m_data->GetDataHere( formats[i] , dataPtr ) ;
         OSType type = formats[i].GetFormatId() ;
-        if ( type == 'TEXT' )
+        if ( type == 'TEXT' || type == 'utxt' )
         {
-            dataSize-- ;
+            if ( dataSize > 0 )
+                dataSize-- ;
             dataPtr[ dataSize ] = 0 ;
-            wxString st( (wxChar*) dataPtr ) ;
-            wxCharBuffer buf = st.mb_str( wxConvLocal) ;
-            AddDragItemFlavor(theDrag, theItem, type , buf.data(), strlen(buf), 0);
+            if ( type == 'utxt' )
+            {
+                if ( dataSize > 0 )
+                    dataSize-- ;
+                dataPtr[ dataSize ] = 0 ;
+            }
+            AddDragItemFlavor(theDrag, theItem, type , dataPtr, dataSize, 0);      
         }
         else if (type == kDragFlavorTypeHFS )
         {