diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-11-14 00:57:07 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-14 09:58:55 +0100 |
commit | 25622f29b4003307d2ba780ff1232d8b7cdafa35 (patch) | |
tree | ad15c747685e803deeb5fffd209ae0b5992ac87a /sw/source/core/docnode/node.cxx | |
parent | 638d619866784510dcbf0cadb6eb251208489a73 (diff) |
Simplify containers iterations in sw/source/core/[d-l]*
Use range-based loop or replace with STL functions
Change-Id: I143e9a769e1c1bb0228933a0a92150f00e3e1f20
Reviewed-on: https://gerrit.libreoffice.org/63347
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/docnode/node.cxx')
-rw-r--r-- | sw/source/core/docnode/node.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 9c36a1fadff7..27fa3622e931 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1636,9 +1636,8 @@ bool SwContentNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr ) SwAttrSet aOld( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ), aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ); - std::vector<sal_uInt16>::const_iterator it; - for ( it = rWhichArr.begin(); it != rWhichArr.end(); ++it ) - if( AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, *it, &aOld, &aNew )) + for ( const auto& rWhich : rWhichArr ) + if( AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, rWhich, &aOld, &aNew )) ++nDel; if( nDel ) @@ -1708,11 +1707,9 @@ sal_uInt16 SwContentNode::ClearItemsFromAttrSet( const std::vector<sal_uInt16>& OSL_ENSURE( GetpSwAttrSet(), "no item set" ); SwAttrSet aNewAttrSet( *GetpSwAttrSet() ); - for ( std::vector<sal_uInt16>::const_iterator aIter = rWhichIds.begin(); - aIter != rWhichIds.end(); - ++aIter ) + for ( const auto& rWhichId : rWhichIds ) { - nRet = nRet + aNewAttrSet.ClearItem( *aIter ); + nRet = nRet + aNewAttrSet.ClearItem( rWhichId ); } if ( nRet ) AttrSetHandleHelper::GetNewAutoStyle( mpAttrSet, *this, aNewAttrSet ); |