X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/06ad863606966ceee6e7eea537f8d427f0d891a9..8df136714c942b0ec62d6db550d752ab5d731357:/src/gtk/dataobj.cpp diff --git a/src/gtk/dataobj.cpp b/src/gtk/dataobj.cpp index 331a728254..e495bfd98a 100644 --- a/src/gtk/dataobj.cpp +++ b/src/gtk/dataobj.cpp @@ -17,6 +17,13 @@ #include "gdk/gdk.h" + +//------------------------------------------------------------------------- +// global data +//------------------------------------------------------------------------- + +GdkAtom g_textAtom = 0; + //------------------------------------------------------------------------- // wxDataFormat //------------------------------------------------------------------------- @@ -25,6 +32,7 @@ IMPLEMENT_CLASS(wxDataFormat, wxObject) wxDataFormat::wxDataFormat() { + if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE ); m_type = wxDF_INVALID; m_hasAtom = FALSE; m_atom = (GdkAtom) 0; @@ -32,16 +40,19 @@ wxDataFormat::wxDataFormat() wxDataFormat::wxDataFormat( wxDataType type ) { + if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE ); SetType( type ); } wxDataFormat::wxDataFormat( const wxString &id ) { + if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE ); SetId( id ); } wxDataFormat::wxDataFormat( wxDataFormat &format ) { + if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE ); m_type = format.GetType(); m_id = format.GetId(); m_hasAtom = TRUE; @@ -50,11 +61,12 @@ wxDataFormat::wxDataFormat( wxDataFormat &format ) wxDataFormat::wxDataFormat( const GdkAtom atom ) { + if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE ); m_hasAtom = TRUE; m_atom = atom; - if (m_atom == GDK_TARGET_STRING) + if (m_atom == g_textAtom) { m_type = wxDF_TEXT; } else @@ -124,8 +136,8 @@ GdkAtom wxDataFormat::GetAtom() if (m_type == wxDF_TEXT) { - m_atom = GDK_TARGET_STRING; - } + m_atom = g_textAtom; + } else if (m_type == wxDF_BITMAP) {