X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a1b806b98241ab649c169aaa1f134df85e80fb8b..43c42c18d36c703a88b1b7b697bac27fe5608eca:/src/msw/clipbrd.cpp diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index da105ae254..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) ) { @@ -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, "