X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/70b8ab778fc3f9f89874a242bfa014f2b313c59b..750d64e653a18b75f1a2798133a377143a2ac59e:/src/x11/dataobj.cpp?ds=sidebyside diff --git a/src/x11/dataobj.cpp b/src/x11/dataobj.cpp index c373028089..aa7c8f300b 100644 --- a/src/x11/dataobj.cpp +++ b/src/x11/dataobj.cpp @@ -7,16 +7,19 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "dataobj.h" #endif #include "wx/defs.h" +#if wxUSE_DATAOBJ + #include "wx/dataobj.h" #include "wx/mstream.h" #include "wx/app.h" #include "wx/image.h" +#include "wx/log.h" #include "wx/utils.h" #include "wx/x11/private.h" @@ -101,7 +104,7 @@ wxString wxDataFormat::GetId() const return wxEmptyString; #else char *t = XGetAtomName ((Display*) wxGetDisplay(), m_format); - wxString ret( t ); // this will convert from ascii to Unicode + wxString ret = wxString::FromAscii( t ); if (t) XFree( t ); return ret; @@ -131,7 +134,7 @@ void wxDataFormat::SetId( const wxChar *id ) PrepareFormats(); m_type = wxDF_PRIVATE; wxString tmp( id ); - m_format = XInternAtom( (Display*) wxGetDisplay(), wxMBSTRINGCAST tmp.mbc_str(), FALSE ); // what is the string cast for? + m_format = XInternAtom( (Display*) wxGetDisplay(), tmp.ToAscii(), FALSE ); #endif } @@ -350,7 +353,7 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) return FALSE; } - m_bitmap = image.ConvertToBitmap(); + m_bitmap = image; return m_bitmap.Ok(); #else @@ -364,7 +367,7 @@ void wxBitmapDataObject::DoConvertToPng() if (!m_bitmap.Ok()) return; - wxImage image( m_bitmap ); + wxImage image = m_bitmap.ConvertToImage(); wxPNGHandler handler; wxCountingOutputStream count; @@ -378,3 +381,5 @@ void wxBitmapDataObject::DoConvertToPng() #endif } +#endif // wxUSE_DATAOBJ +