]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/dataobj.cpp
guaranteeing autorelease pools for overridden OnRun on OSX
[wxWidgets.git] / src / osx / carbon / dataobj.cpp
index cdec68b05d7028d784a85c4fa2fe733d446ead98..e58a05f0b5a0f7f3d76f9b294a153c03ce8ce5b4 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        src/mac/carbon/dataobj.cpp
+// Name:        src/osx/carbon/dataobj.cpp
 // Purpose:     implementation of wxDataObject class
 // Author:      Stefan Csomor
 // Modified by:
@@ -27,7 +27,7 @@
 #include "wx/metafile.h"
 #include "wx/tokenzr.h"
 
-#include "wx/mac/uma.h"
+#include "wx/osx/private.h"
 
 #ifdef __DARWIN__
     #include <QuickTime/QuickTime.h>
@@ -403,6 +403,11 @@ bool wxDataObject::GetFromPasteboard( void * pb )
                     flavorType = (CFStringRef)CFArrayGetValueAtIndex( flavorTypeArray,
                                                                          flavorIndex );
 
+                    // avoid utf8 being treated closer to plain-text than unicode by forcing a conversion
+                    if ( UTTypeConformsTo(flavorType, CFSTR("public.utf8-plain-text") ) )
+                    {
+                        flavorType = CFSTR("public.utf16-plain-text");
+                    }
                     wxDataFormat flavorFormat( (wxDataFormat::NativeFormat) flavorType );
  
                     if ( dataFormat == flavorFormat )