X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/70b8ab778fc3f9f89874a242bfa014f2b313c59b..1978421a6d8b81c1f8a961da4b8ddf544fec7b1b:/src/x11/dataobj.cpp?ds=sidebyside diff --git a/src/x11/dataobj.cpp b/src/x11/dataobj.cpp index c373028089..c095c13aa2 100644 --- a/src/x11/dataobj.cpp +++ b/src/x11/dataobj.cpp @@ -7,7 +7,7 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "dataobj.h" #endif @@ -17,6 +17,7 @@ #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 +102,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 +132,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 +351,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 +365,7 @@ void wxBitmapDataObject::DoConvertToPng() if (!m_bitmap.Ok()) return; - wxImage image( m_bitmap ); + wxImage image = m_bitmap.ConvertToImage(); wxPNGHandler handler; wxCountingOutputStream count;