diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-06-15 15:31:14 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-06-15 19:33:16 +0200 |
commit | e542b622aeb70230365971cab4838dbe0b6e0a93 (patch) | |
tree | 9e1387a8fbc49c9ccc232dbb306642d896c71670 /writerfilter | |
parent | 1067bf8a78a03b67f769761753b5a7226f611f9f (diff) |
writerfilter: use std::any_of()
Change-Id: I21d5059beee737c286d85f559c767f43962a63ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96355
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/SdtHelper.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 9 |
2 files changed, 6 insertions, 11 deletions
diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index d31bfe4db00c..2e36709db3d9 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -200,11 +200,9 @@ sal_Int32 SdtHelper::getInteropGrabBagSize() const { return m_aGrabBag.size(); } bool SdtHelper::containedInInteropGrabBag(const OUString& rValueName) { - for (const beans::PropertyValue& i : m_aGrabBag) - if (i.Name == rValueName) - return true; - - return false; + return std::any_of( + m_aGrabBag.begin(), m_aGrabBag.end(), + [&rValueName](const beans::PropertyValue& i) { return i.Name == rValueName; }); } } // namespace writerfilter::dmapper diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 3c7de5226a1d..6ad3ddaf5a29 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1709,12 +1709,9 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer, RTFSprms* const pSprms, bool findPropertyName(const std::vector<beans::PropertyValue>& rProperties, const OUString& rName) { - for (auto& rProperty : rProperties) - { - if (rProperty.Name == rName) - return true; - } - return false; + return std::any_of( + rProperties.begin(), rProperties.end(), + [&rName](const beans::PropertyValue& rProperty) { return rProperty.Name == rName; }); } void RTFDocumentImpl::backupTableRowProperties() |