summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-08-29 00:47:33 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-29 11:40:29 +0200
commit085269d25a705b656436feac47149296b4b4b35d (patch)
tree3195c0526652ebd9e125507aa17cd15b2acfb368 /cui
parentb0e74b65a86eb965c3e93da2fb77972cc5445f3c (diff)
Replace find_if with proper quantifier algorithms
Change-Id: Icc820a47ac891c358883f9c01224f676c58fdd11 Reviewed-on: https://gerrit.libreoffice.org/59744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/pastedlg.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx
index 27297eaf903e..d48235c5a3ac 100644
--- a/cui/source/dialogs/pastedlg.cxx
+++ b/cui/source/dialogs/pastedlg.cxx
@@ -143,14 +143,13 @@ SotClipboardFormatId SvPasteObjectDialog::GetFormat( const TransferableDataHelpe
aName = SvPasteObjectHelper::GetSotFormatUIName( nFormat );
// Show RICHTEXT only in case RTF is not present.
- if (nFormat == SotClipboardFormatId::RICHTEXT)
+ if (nFormat == SotClipboardFormatId::RICHTEXT &&
+ std::any_of(pFormats->begin(), pFormats->end(),
+ [](const DataFlavorEx& rFlavor) {
+ return rFlavor.mnSotId == SotClipboardFormatId::RTF;
+ }))
{
- auto it = std::find_if(pFormats->begin(), pFormats->end(),
- [](const DataFlavorEx& rFlavor) {
- return rFlavor.mnSotId == SotClipboardFormatId::RTF;
- });
- if (it != pFormats->end())
- continue;
+ continue;
}
if (ObjectLB().find_text(aName) == -1)