diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-08-29 00:47:33 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-29 11:40:29 +0200 |
commit | 085269d25a705b656436feac47149296b4b4b35d (patch) | |
tree | 3195c0526652ebd9e125507aa17cd15b2acfb368 /sw | |
parent | b0e74b65a86eb965c3e93da2fb77972cc5445f3c (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 'sw')
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/undo/rolbck.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 5 |
3 files changed, 7 insertions, 9 deletions
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 364e78503b53..8d5a76201563 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -222,10 +222,9 @@ void SwLayoutWriter::testTdf118672() = linguistic2::LinguServiceManager::create(comphelper::getProcessComponentContext()); uno::Sequence<lang::Locale> aLocales = xLinguServiceManager->getAvailableLocales("com.sun.star.linguistic2.Hyphenator"); - auto it = std::find_if(aLocales.begin(), aLocales.end(), [](const lang::Locale& rLocale) { - return rLocale.Language == "en" && rLocale.Country == "US"; - }); - if (it == aLocales.end()) + if (std::none_of(aLocales.begin(), aLocales.end(), [](const lang::Locale& rLocale) { + return rLocale.Language == "en" && rLocale.Country == "US"; + })) return; OUString aLine1("He heard quiet steps behind him. That didn't bode well. Who could be fol*1 2 " diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index fcee6d3272b6..c7160cb463d4 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -1304,13 +1304,13 @@ bool SwRegHistory::InsertItems( const SfxItemSet& rSet, continue; // special case, may get set on text node itself // tdf#105077 even worse, node's set could cause // nothing at all to be inserted - assert(std::find_if( + assert(std::any_of( m_pHistory->m_SwpHstry.begin(), m_pHistory->m_SwpHstry.end(), [nExpected](std::unique_ptr<SwHistoryHint> const& pHint) -> bool { SwHistoryResetText const*const pReset( dynamic_cast<SwHistoryResetText const*>(pHint.get())); return pReset && (pReset->GetWhich() == nExpected); - }) != m_pHistory->m_SwpHstry.end()); + })); } } #endif diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index e85e44f0214e..a81f553cc00b 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -484,9 +484,8 @@ uno::Sequence< OUString > SwXStyleFamilies::getElementNames() sal_Bool SwXStyleFamilies::hasByName(const OUString& Name) { auto pEntries(lcl_GetStyleFamilyEntries()); - const auto pEntry = std::find_if(pEntries->begin(), pEntries->end(), + return std::any_of(pEntries->begin(), pEntries->end(), [&Name] (const StyleFamilyEntry& e) { return e.m_sName == Name; }); - return pEntry != pEntries->end(); } sal_Int32 SwXStyleFamilies::getCount() @@ -1113,7 +1112,7 @@ public: bool AllowsKey(const OUString& rName) { - return aPropertyEntries.end() != std::find_if(aPropertyEntries.begin(), aPropertyEntries.end(), + return std::any_of(aPropertyEntries.begin(), aPropertyEntries.end(), [rName] (const SfxItemPropertyNamedEntry& rEntry) {return rName == rEntry.sName;} ); } bool SetProperty(const OUString& rName, const uno::Any& rValue) |