+wxDataFormat HtmlFormatFixup(wxDataFormat format)
+{
+ // Since the HTML format is dynamically registered, the wxDF_HTML
+ // format does not match the native constant in the way other formats do,
+ // so for the format checks below to work, we must change the native
+ // id to the wxDF_HTML constant.
+ wxChar s_szBuf[256];
+ if (::GetClipboardFormatName(format, s_szBuf, WXSIZEOF(s_szBuf)))
+ {
+ if (s_szBuf == wxString("HTML Format"))
+ format = wxDF_HTML;
+ }
+ return format;
+}
+