diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-10-20 22:15:25 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-22 09:47:59 +0200 |
commit | e06afb0c9546ddcde1cedd75f59001396ac6fdf2 (patch) | |
tree | c5e60976b74bd102bff3e58381e53bb949c6ea22 /ucb/source/ucp/package | |
parent | 8959bb300b05be9fafbf30e553b35fb517bdf786 (diff) |
Simplify containers iterations in ucb, ucbhelper
Use range-based loop or replace with STL functions.
Change-Id: I3cdb0f89523008199af1550de164a52b75c52ba5
Reviewed-on: https://gerrit.libreoffice.org/62088
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb/source/ucp/package')
-rw-r--r-- | ucb/source/ucp/package/pkgcontent.cxx | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 8158c13783ff..e428044625e8 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -1677,13 +1677,9 @@ void Content::destroy( ContentRefList aChildren; queryChildren( aChildren ); - ContentRefList::const_iterator it = aChildren.begin(); - ContentRefList::const_iterator end = aChildren.end(); - - while ( it != end ) + for ( auto& rChild : aChildren ) { - (*it)->destroy( bDeletePhysical, xEnv ); - ++it; + rChild->destroy( bDeletePhysical, xEnv ); } } } @@ -2003,12 +1999,9 @@ bool Content::exchangeIdentity( ContentRefList aChildren; queryChildren( aChildren ); - ContentRefList::const_iterator it = aChildren.begin(); - ContentRefList::const_iterator end = aChildren.end(); - - while ( it != end ) + for ( const auto& rChild : aChildren ) { - ContentRef xChild = (*it); + ContentRef xChild = rChild; // Create new content identifier for the child... uno::Reference< ucb::XContentIdentifier > xOldChildId @@ -2025,8 +2018,6 @@ bool Content::exchangeIdentity( if ( !xChild->exchangeIdentity( xNewChildId ) ) return false; - - ++it; } } return true; @@ -2056,12 +2047,9 @@ void Content::queryChildren( ContentRefList& rChildren ) sal_Int32 nLen = aURL.getLength(); - ::ucbhelper::ContentRefList::const_iterator it = aAllContents.begin(); - ::ucbhelper::ContentRefList::const_iterator end = aAllContents.end(); - - while ( it != end ) + for ( const auto& rContent : aAllContents ) { - ::ucbhelper::ContentImplHelperRef xChild = (*it); + ::ucbhelper::ContentImplHelperRef xChild = rContent; OUString aChildURL = xChild->getIdentifier()->getContentIdentifier(); @@ -2076,7 +2064,6 @@ void Content::queryChildren( ContentRefList& rChildren ) static_cast< Content * >( xChild.get() ) ); } } - ++it; } } |