X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..e83c4d401206ff9d5568f03ade6d9713c57bdd51:/src/motif/dataobj.cpp diff --git a/src/motif/dataobj.cpp b/src/motif/dataobj.cpp index 0647d3501b..0fd6bf384b 100644 --- a/src/motif/dataobj.cpp +++ b/src/motif/dataobj.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: dataobj.cpp +// Name: src/motif/dataobj.cpp // Purpose: wxDataObject class // Author: Julian Smart // Id: $Id$ @@ -10,13 +10,14 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_CLIPBOARD #include "wx/dataobj.h" -#include "wx/app.h" -#include "wx/utils.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/utils.h" +#endif #ifdef __VMS__ #pragma message disable nosimpint @@ -60,12 +61,6 @@ wxDataFormat::wxDataFormat( wxDataFormatId type ) SetType( type ); } -wxDataFormat::wxDataFormat( const wxChar *id ) -{ - PrepareFormats(); - SetId( id ); -} - wxDataFormat::wxDataFormat( const wxString &id ) { PrepareFormats(); @@ -106,7 +101,7 @@ wxString wxDataFormat::GetId() const { char *t = XGetAtomName ((Display*) wxGetDisplay(), m_format); wxString ret( t ); // this will convert from ascii to Unicode - if (t) + if (t) XFree( t ); return ret; } @@ -128,13 +123,12 @@ void wxDataFormat::SetId( NativeFormat format ) m_type = wxDF_PRIVATE; } -void wxDataFormat::SetId( const wxChar *id ) +void wxDataFormat::SetId( const wxString& id ) { PrepareFormats(); m_type = wxDF_PRIVATE; - wxString tmp( id ); m_format = XInternAtom( wxGlobalDisplay(), - tmp.mbc_str(), False ); + id.mbc_str(), False ); } void wxDataFormat::PrepareFormats() @@ -166,7 +160,7 @@ size_t wxBitmapDataObject::GetDataSize() const bool wxBitmapDataObject::GetDataHere(void* buf) const { - if( !GetBitmap().Ok() ) + if( !GetBitmap().IsOk() ) return false; (*(Pixmap*)buf) = (Pixmap)GetBitmap().GetDrawable();