X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0ace90958bccf60ac530ab127573599c78b7c522..dc497201eb08e3de1402480e2ab97a6405335ecb:/src/x11/dataobj.cpp?ds=sidebyside diff --git a/src/x11/dataobj.cpp b/src/x11/dataobj.cpp index 21e8776a29..fadc4afd80 100644 --- a/src/x11/dataobj.cpp +++ b/src/x11/dataobj.cpp @@ -7,12 +7,10 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ - #pragma implementation "dataobj.h" -#endif - #include "wx/defs.h" +#if wxUSE_DATAOBJ + #include "wx/dataobj.h" #include "wx/mstream.h" #include "wx/app.h" @@ -102,7 +100,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; @@ -132,7 +130,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 } @@ -351,7 +349,7 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) return FALSE; } - m_bitmap = image.ConvertToBitmap(); + m_bitmap = image; return m_bitmap.Ok(); #else @@ -365,7 +363,7 @@ void wxBitmapDataObject::DoConvertToPng() if (!m_bitmap.Ok()) return; - wxImage image( m_bitmap ); + wxImage image = m_bitmap.ConvertToImage(); wxPNGHandler handler; wxCountingOutputStream count; @@ -379,3 +377,5 @@ void wxBitmapDataObject::DoConvertToPng() #endif } +#endif // wxUSE_DATAOBJ +