diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-09-19 08:25:34 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-25 08:55:12 +0200 |
commit | daf44342ca82c5b0e79da88b7f9dbf28f6d43a8b (patch) | |
tree | 54517341b968d644de2e48028d1974f14c70e248 /xmloff/source/draw/ximpshap.cxx | |
parent | 49614a9ea971ff7f370f863ce8a2735aab973cee (diff) |
Simplify containers iterations in xmloff/source/[c-d]*
Use range-based loop or replace with STL functions.
Change-Id: I2af2d739d55a0bf480bb6e9d57b49dd16806af30
Reviewed-on: https://gerrit.libreoffice.org/60734
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/draw/ximpshap.cxx')
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 21339eb6bbcf..a286811d4e52 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3762,15 +3762,9 @@ void SdXMLCustomShapeContext::EndElement() //fdo#84043 overwrite the property if it already exists, otherwise append it beans::PropertyValue* pItem; - std::vector< beans::PropertyValue >::iterator aI(maCustomShapeGeometry.begin()); - std::vector< beans::PropertyValue >::iterator aE(maCustomShapeGeometry.end()); - while (aI != aE) - { - if (aI->Name == sName) - break; - ++aI; - } - if (aI != aE) + auto aI = std::find_if(maCustomShapeGeometry.begin(), maCustomShapeGeometry.end(), + [&sName](beans::PropertyValue& rValue) { return rValue.Name == sName; }); + if (aI != maCustomShapeGeometry.end()) { beans::PropertyValue& rItem = *aI; pItem = &rItem; |