X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3a5bcc4db0851bf8cd3063917511b0b17c7f9679..feb8276801ff0a375d5a9221b40d6b45d4552656:/src/msw/clipbrd.cpp?ds=inline diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index 842a9c94aa..9d35124765 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -221,10 +221,13 @@ bool wxSetClipboardData(wxDataFormat dataFormat, { wxBitmap *bitmap = (wxBitmap *)data; - HGLOBAL hDIB = wxDIB::ConvertFromBitmap(GetHbitmapOf(*bitmap)); - if ( hDIB ) + if ( bitmap && bitmap->Ok() ) { - handle = ::SetClipboardData(CF_DIB, hDIB); + wxDIB dib(*bitmap); + if ( dib.IsOk() ) + { + handle = ::SetClipboardData(CF_DIB, dib.Detach()); + } } break; } @@ -662,7 +665,7 @@ bool wxClipboard::AddData( wxDataObject *data ) { #if 1 // TODO - wxLogError("Not implemented because wxMetafileDataObject does not contain width and height values."); + wxLogError(wxT("Not implemented because wxMetafileDataObject does not contain width and height values.")); return FALSE; #else wxMetafileDataObject* metaFileDataObject = @@ -698,7 +701,7 @@ void wxClipboard::Close() #endif } -bool wxClipboard::IsSupported( wxDataFormat format ) +bool wxClipboard::IsSupported( const wxDataFormat& format ) { return wxIsClipboardFormatAvailable(format); }