X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6270539bcf24f2ec32150a09f8aad383f5de0671..96c9640205933ad0673d5af2c96af0816c50160c:/src/msw/clipbrd.cpp diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index 044ef30db2..55c12d45af 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: clipbrd.cpp +// Name: src/msw/clipbrd.cpp // Purpose: Clipboard functionality // Author: Julian Smart // Modified by: @@ -26,6 +26,8 @@ #if wxUSE_CLIPBOARD +#include "wx/clipbrd.h" + #ifndef WX_PRECOMP #include "wx/object.h" #include "wx/event.h" @@ -34,14 +36,14 @@ #include "wx/bitmap.h" #include "wx/utils.h" #include "wx/intl.h" + #include "wx/log.h" + #include "wx/dataobj.h" #endif #if wxUSE_METAFILE #include "wx/metafile.h" #endif -#include "wx/log.h" -#include "wx/clipbrd.h" #include @@ -56,10 +58,6 @@ // the functions using wxDataObject in wxClipboard //#define wxUSE_DATAOBJ wxUSE_DRAG_AND_DROP -#if wxUSE_DATAOBJ - #include "wx/dataobj.h" -#endif - #if wxUSE_OLE && !defined(__WXWINCE__) // use OLE clipboard #define wxUSE_OLE_CLIPBOARD 1 @@ -92,13 +90,15 @@ bool wxOpenClipboard() gs_wxClipboardIsOpen = ::OpenClipboard((HWND)win->GetHWND()) != 0; if ( !gs_wxClipboardIsOpen ) + { wxLogSysError(_("Failed to open the clipboard.")); + } return gs_wxClipboardIsOpen; } else { - wxLogDebug(wxT("Can not open clipboard without a main window.")); + wxLogDebug(wxT("Cannot open clipboard without a main window.")); return false; } @@ -214,7 +214,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat, { wxBitmap *bitmap = (wxBitmap *)data; - if ( bitmap && bitmap->Ok() ) + if ( bitmap && bitmap->IsOk() ) { wxDIB dib(*bitmap); if ( dib.IsOk() ) @@ -332,19 +332,19 @@ bool wxSetClipboardData(wxDataFormat dataFormat, // string when you overwrite it so you follow up with code to replace // the 0 appended at the end with a '\r'... char *ptr = strstr(buf, "StartHTML"); - sprintf(ptr+10, "%08u", strstr(buf, "") - buf); + sprintf(ptr+10, "%08u", (unsigned)(strstr(buf, "") - buf)); *(ptr+10+8) = '\r'; ptr = strstr(buf, "EndHTML"); - sprintf(ptr+8, "%08u", strlen(buf)); + sprintf(ptr+8, "%08u", (unsigned)strlen(buf)); *(ptr+8+8) = '\r'; ptr = strstr(buf, "StartFragment"); - sprintf(ptr+14, "%08u", strstr(buf, "