writerfilter/source/rtftok/rtfsprm.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit 4ad77ab737a00fd1325753592acca9ae00a838af Author: Adrien Ollier <adr.oll...@hotmail.fr> AuthorDate: Mon Jul 22 18:48:00 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Jul 23 06:47:18 2019 +0200 using an algorithm of the STL makes code clearer Change-Id: I0bf26b6a75354ccbb79d431c947277d621985385 Signed-off-by: Adrien Ollier <adr.oll...@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/76127 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx index 15026cb93ea4..b50d9b166344 100644 --- a/writerfilter/source/rtftok/rtfsprm.cxx +++ b/writerfilter/source/rtftok/rtfsprm.cxx @@ -12,6 +12,7 @@ #include <ooxml/QNameToString.hxx> #include <rtl/strbuf.hxx> #include "rtfdocumentimpl.hxx" +#include <algorithm> namespace writerfilter { @@ -367,10 +368,10 @@ RTFSprms RTFSprms::cloneAndDeduplicate(RTFSprms& rReference, Id const nStyleType bool RTFSprms::equals(RTFValue& rOther) { - for (auto& rSprm : *m_pSprms) - if (!rSprm.second->equals(rOther)) - return false; - return true; + return std::all_of(m_pSprms->begin(), m_pSprms->end(), + [&](const std::pair<Id, RTFValue::Pointer_t>& raPair) -> bool { + return raPair.second->equals(rOther); + }); } void RTFSprms::ensureCopyBeforeWrite() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits