diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-01-03 13:34:46 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-01-03 17:44:22 +0100 |
commit | dba3cd508116780cf5d115f964b7311dd61e180d (patch) | |
tree | 09717141298d21e0a7f90c80ce571d00c9062058 /cui/source | |
parent | de84816c1acefe0607827418f73477ff7163728d (diff) |
tdf#113357 cui: fix duplicate 'Formatted text [Richtext]' paste option
Prefer RTF when we have both RICHTEXT and RTF.
Change-Id: Ib4133ae4fdecc32429d89b56b0c9466dd3451522
Reviewed-on: https://gerrit.libreoffice.org/47316
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/dialogs/pastedlg.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx index 721cf06e1821..33fafa758654 100644 --- a/cui/source/dialogs/pastedlg.cxx +++ b/cui/source/dialogs/pastedlg.cxx @@ -161,6 +161,17 @@ SotClipboardFormatId SvPasteObjectDialog::GetFormat( const TransferableDataHelpe else if( aName.isEmpty() ) aName = SvPasteObjectHelper::GetSotFormatUIName( nFormat ); + // Show RICHTEXT only in case RTF is not present. + if (nFormat == SotClipboardFormatId::RICHTEXT) + { + auto it = std::find_if(pFormats->begin(), pFormats->end(), + [](const DataFlavorEx& rFlavor) { + return rFlavor.mnSotId == SotClipboardFormatId::RTF; + }); + if (it != pFormats->end()) + continue; + } + if( LISTBOX_ENTRY_NOTFOUND == ObjectLB().GetEntryPos( aName ) ) ObjectLB().SetEntryData( ObjectLB().InsertEntry( aName ), reinterpret_cast<void*>(nFormat) ); |