X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/174f2229cdb37772606a38a09523cdd7d091d988..848332140be2d53aea32d0702f4c0e06c149d24b:/src/gtk1/dataobj.cpp?ds=sidebyside diff --git a/src/gtk1/dataobj.cpp b/src/gtk1/dataobj.cpp index f52cdb4a3d..1e986e1ce0 100644 --- a/src/gtk1/dataobj.cpp +++ b/src/gtk1/dataobj.cpp @@ -7,14 +7,13 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "dataobj.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #include "wx/dataobj.h" + +#if wxUSE_DATAOBJ + #include "wx/app.h" #include "wx/debug.h" #include "wx/mstream.h" @@ -78,9 +77,9 @@ wxDataFormat::wxDataFormat( NativeFormat format ) void wxDataFormat::SetType( wxDataFormatId type ) { PrepareFormats(); - + m_type = type; - + #if wxUSE_UNICODE if (m_type == wxDF_UNICODETEXT) m_format = g_textAtom; @@ -142,7 +141,7 @@ void wxDataFormat::SetId( const wxChar *id ) PrepareFormats(); m_type = wxDF_PRIVATE; wxString tmp( id ); - m_format = gdk_atom_intern( (const char*) tmp.ToAscii(), FALSE ); + m_format = gdk_atom_intern( (const char*) tmp.ToAscii(), FALSE ); } void wxDataFormat::PrepareFormats() @@ -183,17 +182,17 @@ wxDataObject::~wxDataObject() bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction dir) const { size_t nFormatCount = GetFormatCount(dir); - if ( nFormatCount == 1 ) + if ( nFormatCount == 1 ) { return format == GetPreferredFormat(); } - else + else { wxDataFormat *formats = new wxDataFormat[nFormatCount]; GetAllFormats(formats,dir); size_t n; - for ( n = 0; n < nFormatCount; n++ ) + for ( n = 0; n < nFormatCount; n++ ) { if ( formats[n] == format ) break; @@ -206,18 +205,6 @@ bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction dir) } } -// ---------------------------------------------------------------------------- -// wxTextDataObject -// ---------------------------------------------------------------------------- - -#if defined(__WXGTK20__) && wxUSE_UNICODE -void wxTextDataObject::GetAllFormats(wxDataFormat *formats, wxDataObjectBase::Direction dir) const -{ - *formats++ = GetPreferredFormat(); - *formats = g_altTextAtom; -} -#endif - // ---------------------------------------------------------------------------- // wxFileDataObject // ---------------------------------------------------------------------------- @@ -396,4 +383,4 @@ void wxBitmapDataObject::DoConvertToPng() image.SaveFile(mstream, wxBITMAP_TYPE_PNG); } - +#endif // wxUSE_DATAOBJ