Backed out changeset d5a514b9a0db (bug 586587) for mochitest failures.

This commit is contained in:
Ryan VanderMeulen 2014-04-24 14:48:14 -04:00
parent 174fd5a49c
commit 0227012397
4 changed files with 7 additions and 26 deletions

View File

@ -1277,14 +1277,7 @@ DataTransfer::FillInExternalData(TransferItem& aItem, uint32_t aIndex)
variant->SetAsAString(str); variant->SetAsAString(str);
} }
else { else {
nsCOMPtr<nsISupportsCString> supportscstr = do_QueryInterface(data); variant->SetAsISupports(data);
if (supportscstr) {
nsAutoCString str;
supportscstr->GetData(str);
variant->SetAsACString(str);
} else {
variant->SetAsISupports(data);
}
} }
aItem.mData = variant; aItem.mData = variant;

View File

@ -103,8 +103,7 @@ UINT nsClipboard::GetFormat(const char* aMimeStr)
else if (strcmp(aMimeStr, kFileMime) == 0 || else if (strcmp(aMimeStr, kFileMime) == 0 ||
strcmp(aMimeStr, kFilePromiseMime) == 0) strcmp(aMimeStr, kFilePromiseMime) == 0)
format = CF_HDROP; format = CF_HDROP;
else if (strcmp(aMimeStr, kNativeHTMLMime) == 0 || else if (strcmp(aMimeStr, kNativeHTMLMime) == 0)
strcmp(aMimeStr, kHTMLMime) == 0)
format = CF_HTML; format = CF_HTML;
else else
format = ::RegisterClipboardFormatW(NS_ConvertASCIItoUTF16(aMimeStr).get()); format = ::RegisterClipboardFormatW(NS_ConvertASCIItoUTF16(aMimeStr).get());
@ -642,8 +641,7 @@ nsresult nsClipboard::GetDataFromDataObject(IDataObject * aDataObject,
genericDataWrapper = do_QueryInterface(file); genericDataWrapper = do_QueryInterface(file);
nsMemory::Free(data); nsMemory::Free(data);
} }
else if ( strcmp(flavorStr, kNativeHTMLMime) == 0 || else if ( strcmp(flavorStr, kNativeHTMLMime) == 0) {
strcmp(flavorStr, kHTMLMime) == 0) {
// the editor folks want CF_HTML exactly as it's on the clipboard, no conversions, // the editor folks want CF_HTML exactly as it's on the clipboard, no conversions,
// no fancy stuff. Pull it off the clipboard, stuff it into a wrapper and hand // no fancy stuff. Pull it off the clipboard, stuff it into a wrapper and hand
// it back to them. // it back to them.

View File

@ -517,7 +517,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval)
format = nsClipboard::GetFormat(aDataFlavor); format = nsClipboard::GetFormat(aDataFlavor);
SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1, SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1,
TYMED_HGLOBAL | TYMED_FILE | TYMED_GDI); TYMED_HGLOBAL | TYMED_FILE | TYMED_GDI);
if (SUCCEEDED(mDataObject->QueryGetData(&fe))) if (mDataObject->QueryGetData(&fe) == S_OK)
*_retval = true; // found it! *_retval = true; // found it!
else { else {
// We haven't found the exact flavor the client asked for, but // We haven't found the exact flavor the client asked for, but
@ -530,7 +530,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval)
format = nsClipboard::GetFormat(kTextMime); format = nsClipboard::GetFormat(kTextMime);
SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1, SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1,
TYMED_HGLOBAL | TYMED_FILE | TYMED_GDI); TYMED_HGLOBAL | TYMED_FILE | TYMED_GDI);
if (SUCCEEDED(mDataObject->QueryGetData(&fe))) if (mDataObject->QueryGetData(&fe) == S_OK)
*_retval = true; // found it! *_retval = true; // found it!
} }
else if (strcmp(aDataFlavor, kURLMime) == 0) { else if (strcmp(aDataFlavor, kURLMime) == 0) {
@ -540,15 +540,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval)
format = nsClipboard::GetFormat(kFileMime); format = nsClipboard::GetFormat(kFileMime);
SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1, SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1,
TYMED_HGLOBAL | TYMED_FILE | TYMED_GDI); TYMED_HGLOBAL | TYMED_FILE | TYMED_GDI);
if (SUCCEEDED(mDataObject->QueryGetData(&fe))) if (mDataObject->QueryGetData(&fe) == S_OK)
*_retval = true; // found it!
}
else if (!strcmp(aDataFlavor, kHTMLMime)) {
// if the client wants html, maybe it's in "HTML Format"
format = nsClipboard::GetFormat(kHTMLMime);
SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1,
TYMED_HGLOBAL);
if (SUCCEEDED(mDataObject->QueryGetData(&fe)))
*_retval = true; // found it! *_retval = true; // found it!
} }
} // else try again } // else try again

View File

@ -53,9 +53,7 @@ nsPrimitiveHelpers :: CreatePrimitiveForData ( const char* aFlavor, const void*
if ( !aPrimitive ) if ( !aPrimitive )
return; return;
if ( strcmp(aFlavor,kTextMime) == 0 || if ( strcmp(aFlavor,kTextMime) == 0 || strcmp(aFlavor,kNativeHTMLMime) == 0 ) {
strcmp(aFlavor,kNativeHTMLMime) == 0 ||
strcmp(aFlavor,kHTMLMime) == 0) {
nsCOMPtr<nsISupportsCString> primitive = nsCOMPtr<nsISupportsCString> primitive =
do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID); do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID);
if ( primitive ) { if ( primitive ) {