X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/74d38ad8e2e1d2859cccaf0ac59c50c3bce555e5..59c962bf54667cab735353b2ec3b7a2438464f22:/src/gtk1/dataobj.cpp diff --git a/src/gtk1/dataobj.cpp b/src/gtk1/dataobj.cpp index 77b0e87066..d591070266 100644 --- a/src/gtk1/dataobj.cpp +++ b/src/gtk1/dataobj.cpp @@ -17,7 +17,7 @@ #include "wx/mstream.h" #include "wx/image.h" -#include "gdk/gdk.h" +#include //------------------------------------------------------------------------- // global data @@ -152,15 +152,18 @@ 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; } @@ -204,7 +207,7 @@ size_t wxFileDataObject::GetDataSize() const return res + 1; } -bool wxFileDataObject::SetData(size_t size, const void *buf) +bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *buf) { // VZ: old format #if 0 @@ -327,6 +330,7 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) { Clear(); +#if wxUSE_LIBPNG m_pngSize = size; m_pngData = malloc(m_pngSize); @@ -343,10 +347,14 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) m_bitmap = image.ConvertToBitmap(); return m_bitmap.Ok(); +#else + return FALSE; +#endif } void wxBitmapDataObject::DoConvertToPng() { +#if wxUSE_LIBPNG if (!m_bitmap.Ok()) return; @@ -361,6 +369,7 @@ void wxBitmapDataObject::DoConvertToPng() wxMemoryOutputStream mstream( (char*) m_pngData, m_pngSize ); handler.SaveFile( &image, mstream ); +#endif }