Set HTML data even in Unicode mode

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36090 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2005-11-05 10:25:59 +00:00
parent 3ca57155b4
commit 6270539bcf

View File

@@ -294,8 +294,8 @@ bool wxSetClipboardData(wxDataFormat dataFormat,
handle = SetClipboardData(dataFormat, hGlobalMemory); handle = SetClipboardData(dataFormat, hGlobalMemory);
break; break;
} }
// Only tested with non-Unicode, Visual C++ 6.0 so far // Only tested with Visual C++ 6.0 so far
#if defined(__VISUALC__) && !defined(UNICODE) #if defined(__VISUALC__)
case wxDF_HTML: case wxDF_HTML:
{ {
char* html = (char *)data; char* html = (char *)data;
@@ -332,19 +332,19 @@ bool wxSetClipboardData(wxDataFormat dataFormat,
// string when you overwrite it so you follow up with code to replace // string when you overwrite it so you follow up with code to replace
// the 0 appended at the end with a '\r'... // the 0 appended at the end with a '\r'...
char *ptr = strstr(buf, "StartHTML"); char *ptr = strstr(buf, "StartHTML");
wsprintf(ptr+10, "%08u", strstr(buf, "<html>") - buf); sprintf(ptr+10, "%08u", strstr(buf, "<html>") - buf);
*(ptr+10+8) = '\r'; *(ptr+10+8) = '\r';
ptr = strstr(buf, "EndHTML"); ptr = strstr(buf, "EndHTML");
wsprintf(ptr+8, "%08u", strlen(buf)); sprintf(ptr+8, "%08u", strlen(buf));
*(ptr+8+8) = '\r'; *(ptr+8+8) = '\r';
ptr = strstr(buf, "StartFragment"); ptr = strstr(buf, "StartFragment");
wsprintf(ptr+14, "%08u", strstr(buf, "<!--StartFrag") - buf); sprintf(ptr+14, "%08u", strstr(buf, "<!--StartFrag") - buf);
*(ptr+14+8) = '\r'; *(ptr+14+8) = '\r';
ptr = strstr(buf, "EndFragment"); ptr = strstr(buf, "EndFragment");
wsprintf(ptr+12, "%08u", strstr(buf, "<!--EndFrag") - buf); sprintf(ptr+12, "%08u", strstr(buf, "<!--EndFrag") - buf);
*(ptr+12+8) = '\r'; *(ptr+12+8) = '\r';
// Now you have everything in place ready to put on the // Now you have everything in place ready to put on the