]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/dataobj.cpp
wxTextDataObject should convert to and
[wxWidgets.git] / src / gtk1 / dataobj.cpp
index cfbf0deb8ac26dcbb17e949c212d5472c7657588..712616a074e6bd90e1798b28aeafa777d310af62 100644 (file)
@@ -95,7 +95,7 @@ wxDataFormatId wxDataFormat::GetType() const
 
 wxString wxDataFormat::GetId() const
 {
 
 wxString wxDataFormat::GetId() const
 {
-    wxString ret( gdk_atom_name( m_format ) );  // this will convert from ascii to Unicode
+    wxString ret = wxString::FromAscii( gdk_atom_name( m_format ) );
     return ret;
 }
 
     return ret;
 }
 
@@ -121,7 +121,7 @@ void wxDataFormat::SetId( const wxChar *id )
     PrepareFormats();
     m_type = wxDF_PRIVATE;
     wxString tmp( id );
     PrepareFormats();
     m_type = wxDF_PRIVATE;
     wxString tmp( id );
-    m_format = gdk_atom_intern( wxMBSTRINGCAST tmp.mbc_str(), FALSE );  // what is the string cast for?
+    m_format = gdk_atom_intern( (const char*) tmp.ToAscii(), FALSE ); 
 }
 
 void wxDataFormat::PrepareFormats()
 }
 
 void wxDataFormat::PrepareFormats()
@@ -134,7 +134,11 @@ void wxDataFormat::PrepareFormats()
     //     text/uri-list for file dnd because compatibility is not important
     //     here (with whom?)
     if (!g_textAtom)
     //     text/uri-list for file dnd because compatibility is not important
     //     here (with whom?)
     if (!g_textAtom)
+#if wxUSE_UNICODE
+        g_textAtom = gdk_atom_intern( "text/utf8", FALSE );
+#else
         g_textAtom = gdk_atom_intern( "STRING" /* "text/plain" */, FALSE );
         g_textAtom = gdk_atom_intern( "STRING" /* "text/plain" */, FALSE );
+#endif
     if (!g_pngAtom)
         g_pngAtom = gdk_atom_intern( "image/png", FALSE );
     if (!g_fileAtom)
     if (!g_pngAtom)
         g_pngAtom = gdk_atom_intern( "image/png", FALSE );
     if (!g_fileAtom)