X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7941ba111cac53f21eafdeeeed6b543c3a2ba610..135ce19c6765c1163b63071ed84443da989cac7a:/src/gtk/dataobj.cpp diff --git a/src/gtk/dataobj.cpp b/src/gtk/dataobj.cpp index bde950fbb6..d591070266 100644 --- a/src/gtk/dataobj.cpp +++ b/src/gtk/dataobj.cpp @@ -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; } @@ -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 }