Bug 574005 - Make obtaining CF_HTML directly work on Windows and Linux (application/x-moz-nativehtml); r=ehsan

This commit is contained in:
Brian R. Bondy 2011-09-12 18:38:57 -04:00
parent 2c26a7a9aa
commit 61dead824b
2 changed files with 10 additions and 8 deletions

View File

@ -136,14 +136,7 @@ function runTest() {
}, SimpleTest.finish);
}
var isMac = ("nsILocalFileMac" in Components.interfaces);
if (isMac)
SimpleTest.waitForFocus(runTest);
else {
// This test is not yet supported on non-Mac platforms, see bug 574005.
todo(false, "Test not supported on this platform");
SimpleTest.finish();
}
SimpleTest.waitForFocus(runTest);
</script>
</pre>

View File

@ -143,6 +143,15 @@ nsPrimitiveHelpers :: CreateDataFromPrimitive ( const char* aFlavor, nsISupports
plainText->GetData ( data );
*aDataBuff = ToNewCString(data);
}
// CF_HTML only supports single byte.
// Reference: http://msdn.microsoft.com/en-us/library/aa767917(v=vs.85).aspx
} else if ( strcmp(aFlavor,kNativeHTMLMime) == 0 ) {
nsCOMPtr<nsISupportsCString> plainText ( do_QueryInterface(aPrimitive) );
if ( plainText ) {
nsCAutoString data;
plainText->GetData ( data );
*aDataBuff = ToNewUnicode(data);
}
}
else {
nsCOMPtr<nsISupportsString> doubleByteText ( do_QueryInterface(aPrimitive) );