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/shapeexport.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/shapeexport.cxx')
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 22c421e19a70..b78d6c3b2f89 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -437,14 +437,8 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap } } - std::vector< XMLPropertyState >::iterator aIter = aPropStates.begin(); - std::vector< XMLPropertyState >::iterator aEnd = aPropStates.end(); - while( aIter != aEnd ) - { - if( aIter->mnIndex != -1 ) - nCount++; - ++aIter; - } + nCount = std::count_if(aPropStates.cbegin(), aPropStates.cend(), + [](const XMLPropertyState& rProp) { return rProp.mnIndex != -1; }); } if(nCount == 0) @@ -501,15 +495,8 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap } } - nCount = 0; - std::vector< XMLPropertyState >::iterator aIter = aPropStates.begin(); - std::vector< XMLPropertyState >::iterator aEnd = aPropStates.end(); - while( aIter != aEnd ) - { - if( aIter->mnIndex != -1 ) - nCount++; - ++aIter; - } + nCount = std::count_if(aPropStates.cbegin(), aPropStates.cend(), + [](const XMLPropertyState& rProp) { return rProp.mnIndex != -1; }); if( nCount ) { |