Bug 1755481: rename nsIClipboard::getData to nsIClipboard::getSomeData and document it. r=mccr8

Before, it was confusing. One could have assumed that the method gets
the data for all flavors.

Differential Revision: https://phabricator.services.mozilla.com/D138776
This commit is contained in:
Mirko Brodesser
2022-02-16 09:03:00 +00:00
parent dd7b04aa59
commit af3e92b960
12 changed files with 33 additions and 28 deletions

View File

@@ -2093,9 +2093,9 @@ nsresult HTMLEditor::PasteInternal(int32_t aClipboardType) {
return NS_ERROR_FAILURE;
}
// Get the Data from the clipboard
rv = clipboard->GetData(transferable, aClipboardType);
rv = clipboard->GetSomeData(transferable, aClipboardType);
if (NS_FAILED(rv)) {
NS_WARNING("nsIClipboard::GetData() failed");
NS_WARNING("nsIClipboard::GetSomeData() failed");
return rv;
}
@@ -2126,9 +2126,9 @@ nsresult HTMLEditor::PasteInternal(int32_t aClipboardType) {
NS_WARNING_ASSERTION(
NS_SUCCEEDED(rvIgnored),
"nsITransferable::AddDataFlavor(kHTMLContext) failed, but ignored");
rvIgnored = clipboard->GetData(contextTransferable, aClipboardType);
rvIgnored = clipboard->GetSomeData(contextTransferable, aClipboardType);
NS_WARNING_ASSERTION(NS_SUCCEEDED(rvIgnored),
"nsIClipboard::GetData() failed, but ignored");
"nsIClipboard::GetSomeData() failed, but ignored");
nsCOMPtr<nsISupports> contextDataObj;
rv = contextTransferable->GetTransferData(kHTMLContext,
getter_AddRefs(contextDataObj));
@@ -2156,9 +2156,9 @@ nsresult HTMLEditor::PasteInternal(int32_t aClipboardType) {
NS_WARNING_ASSERTION(
NS_SUCCEEDED(rvIgnored),
"nsITransferable::AddDataFlavor(kHTMLInfo) failed, but ignored");
clipboard->GetData(infoTransferable, aClipboardType);
clipboard->GetSomeData(infoTransferable, aClipboardType);
NS_WARNING_ASSERTION(NS_SUCCEEDED(rvIgnored),
"nsIClipboard::GetData() failed, but ignored");
"nsIClipboard::GetSomeData() failed, but ignored");
nsCOMPtr<nsISupports> infoDataObj;
rv = infoTransferable->GetTransferData(kHTMLInfo,
getter_AddRefs(infoDataObj));
@@ -2288,9 +2288,9 @@ nsresult HTMLEditor::PasteNoFormattingAsAction(int32_t aSelectionType,
}
// Get the Data from the clipboard
rv = clipboard->GetData(transferable, aSelectionType);
rv = clipboard->GetSomeData(transferable, aSelectionType);
if (NS_FAILED(rv)) {
NS_WARNING("nsIClipboard::GetData() failed");
NS_WARNING("nsIClipboard::GetSomeData() failed");
return rv;
}
@@ -2543,9 +2543,9 @@ nsresult HTMLEditor::PasteAsPlaintextQuotation(int32_t aSelectionType) {
"nsITransferable::AddDataFlavor(kUnicodeMime) failed, but ignored");
// Get the Data from the clipboard
rvIgnored = clipboard->GetData(transferable, aSelectionType);
rvIgnored = clipboard->GetSomeData(transferable, aSelectionType);
NS_WARNING_ASSERTION(NS_SUCCEEDED(rvIgnored),
"nsIClipboard::GetData() failed, but ignored");
"nsIClipboard::GetSomeData() failed, but ignored");
// Now we ask the transferable for the data
// it still owns the data, we just have a pointer to it.