X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4c51a665c649f7579fb39e62070cef4f66b3210d..12bb29f5432174ecbd65549bda832d70d34a98ae:/src/msw/clipbrd.cpp diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index 594610275d..bd929dcac3 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -79,6 +79,7 @@ // --------------------------------------------------------------------------- static bool gs_wxClipboardIsOpen = false; +static int gs_htmlcfid = 0; bool wxOpenClipboard() { @@ -139,7 +140,9 @@ bool wxIsClipboardOpened() bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat) { - wxDataFormat::NativeFormat cf = dataFormat.GetFormatId(); + wxDataFormat::NativeFormat cf = dataFormat.GetFormatId(); + if (cf == wxDF_HTML) + cf = gs_htmlcfid; if ( ::IsClipboardFormatAvailable(cf) ) { @@ -214,7 +217,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat, { wxBitmap *bitmap = (wxBitmap *)data; - if ( bitmap && bitmap->Ok() ) + if ( bitmap && bitmap->IsOk() ) { wxDIB dib(*bitmap); if ( dib.IsOk() ) @@ -304,10 +307,6 @@ bool wxSetClipboardData(wxDataFormat dataFormat, char *buf = new char [400 + strlen(html)]; if(!buf) return false; - // Get clipboard id for HTML format... - static int cfid = 0; - if(!cfid) cfid = RegisterClipboardFormat(wxT("HTML Format")); - // Create a template string for the HTML header... strcpy(buf, "Version:0.9\r\n" @@ -332,19 +331,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, "