]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dataobj.cpp
on demand creation of native CGContexts , so that pure text measuring contexts don...
[wxWidgets.git] / src / gtk / dataobj.cpp
index 8ed810899780af1660a6f7c78420cedaf4dfe5fc..ef24cfe8afc6dea778727548f8dcf1a211163f24 100644 (file)
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/image.h"
 #endif
 
 #include "wx/mstream.h"
-#include "wx/image.h"
 #include "wx/uri.h"
 
-#include <gdk/gdk.h>
+#include "wx/gtk/private.h"
 
 //-------------------------------------------------------------------------
 // global data
@@ -110,10 +110,8 @@ wxDataFormatId wxDataFormat::GetType() const
 
 wxString wxDataFormat::GetId() const
 {
-    gchar* atom_name = gdk_atom_name( m_format );
-    wxString ret = wxString::FromAscii( atom_name );
-    g_free(atom_name);
-    return ret;
+    wxGtkString atom_name(gdk_atom_name(m_format));
+    return wxString::FromAscii(atom_name);
 }
 
 void wxDataFormat::SetId( NativeFormat format )
@@ -236,7 +234,7 @@ bool wxFileDataObject::GetDataHere(void *buf) const
         filenames += wxT("\r\n");
     }
 
-    memcpy( buf, filenames.mbc_str(), filenames.Len() + 1 );
+    memcpy( buf, filenames.mbc_str(), filenames.length() + 1 );
 
     return true;
 }
@@ -248,7 +246,7 @@ size_t wxFileDataObject::GetDataSize() const
     for (size_t i = 0; i < m_filenames.GetCount(); i++)
     {
         // This is junk in UTF-8
-        res += m_filenames[i].Len();
+        res += m_filenames[i].length();
         res += 5 + 2; // "file:" (5) + "\r\n" (2)
     }