From 9529ca94440bb6424764a5745e3d420cd1587142 Mon Sep 17 00:00:00 2001 From: Edgar Chen Date: Fri, 3 Nov 2023 16:50:11 +0000 Subject: [PATCH] Bug 1862956 - Use `FlavorsTransferableCanExport` to get the available flavor list from cached transferable; r=nika,spohl Differential Revision: https://phabricator.services.mozilla.com/D192678 --- widget/cocoa/nsClipboard.mm | 2 +- widget/nsBaseClipboard.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/widget/cocoa/nsClipboard.mm b/widget/cocoa/nsClipboard.mm index 148e775b4155..ba747e5b278e 100644 --- a/widget/cocoa/nsClipboard.mm +++ b/widget/cocoa/nsClipboard.mm @@ -416,7 +416,7 @@ nsClipboard::HasNativeClipboardDataMatchingFlavors( if (kSelectionCache == aWhichClipboard) { nsTArray transferableFlavors; if (sSelectionCache && - NS_SUCCEEDED(sSelectionCache->FlavorsTransferableCanImport( + NS_SUCCEEDED(sSelectionCache->FlavorsTransferableCanExport( transferableFlavors))) { if (MOZ_CLIPBOARD_LOG_ENABLED()) { MOZ_CLIPBOARD_LOG(" SelectionCache types (nums %zu)\n", diff --git a/widget/nsBaseClipboard.cpp b/widget/nsBaseClipboard.cpp index ea004032d33e..b6defdcc5edf 100644 --- a/widget/nsBaseClipboard.cpp +++ b/widget/nsBaseClipboard.cpp @@ -355,7 +355,7 @@ nsBaseClipboard::GetFlavorsFromClipboardCache(int32_t aClipboardType) { MOZ_ASSERT(cachedTransferable); nsTArray flavors; - nsresult rv = cachedTransferable->FlavorsTransferableCanImport(flavors); + nsresult rv = cachedTransferable->FlavorsTransferableCanExport(flavors); if (NS_FAILED(rv)) { return mozilla::Err(rv); }