diff options
author | Daniel Robertson <danlrobertson89@gmail.com> | 2015-09-23 08:53:42 -0400 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-09-24 16:23:34 +0000 |
commit | 96fa0df15b2be95fc3c4dc3df8ad9b77a4baeebd (patch) | |
tree | 8b5a80990e6508b0996a6ec66c8ed6f0b70aa184 /comphelper/source/property/MasterPropertySet.cxx | |
parent | 74ce05b940be952be63687f31be45a58afa1d1ee (diff) |
comphelper: replace for_each with range-based for
Replace complex uses of ::std::for_each with a range-based for-loop.
Change-Id: I57d3d2e830e7700b793e1836777cbe72504c6825
Reviewed-on: https://gerrit.libreoffice.org/18817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'comphelper/source/property/MasterPropertySet.cxx')
-rw-r--r-- | comphelper/source/property/MasterPropertySet.cxx | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/comphelper/source/property/MasterPropertySet.cxx b/comphelper/source/property/MasterPropertySet.cxx index 358e6918fca6..e6c7ed2b9c90 100644 --- a/comphelper/source/property/MasterPropertySet.cxx +++ b/comphelper/source/property/MasterPropertySet.cxx @@ -78,12 +78,8 @@ MasterPropertySet::MasterPropertySet( comphelper::MasterPropertySetInfo* pInfo, MasterPropertySet::~MasterPropertySet() throw() { - SlaveMap::iterator aEnd = maSlaveMap.end(), aIter = maSlaveMap.begin(); - while (aIter != aEnd ) - { - delete (*aIter).second; - ++aIter; - } + for( auto& rSlave : maSlaveMap ) + delete rSlave.second; } // XPropertySet @@ -248,15 +244,13 @@ void SAL_CALL MasterPropertySet::setPropertyValues( const Sequence< OUString >& } _postSetValues(); - SlaveMap::const_iterator aSlaveIter = maSlaveMap.begin(), aSlaveEnd = maSlaveMap.end(); - while (aSlaveIter != aSlaveEnd) + for( const auto& rSlave : maSlaveMap ) { - if ( (*aSlaveIter).second->IsInit()) + if( rSlave.second->IsInit() ) { - (*aSlaveIter).second->mpSlave->_postSetValues(); - (*aSlaveIter).second->SetInit ( false ); + rSlave.second->mpSlave->_postSetValues(); + rSlave.second->SetInit( false ); } - ++aSlaveIter; } } } @@ -313,15 +307,13 @@ Sequence< Any > SAL_CALL MasterPropertySet::getPropertyValues( const Sequence< O } _postSetValues(); - SlaveMap::const_iterator aSlaveIter = maSlaveMap.begin(), aSlaveEnd = maSlaveMap.end(); - while (aSlaveIter != aSlaveEnd) + for( const auto& rSlave : maSlaveMap ) { - if ( (*aSlaveIter).second->IsInit()) + if( rSlave.second->IsInit() ) { - (*aSlaveIter).second->mpSlave->_postSetValues(); - (*aSlaveIter).second->SetInit ( false ); + rSlave.second->mpSlave->_postSetValues(); + rSlave.second->SetInit( false ); } - ++aSlaveIter; } } return aValues; @@ -415,15 +407,13 @@ Sequence< PropertyState > SAL_CALL MasterPropertySet::getPropertyStates( const S } } _postGetPropertyState(); - SlaveMap::const_iterator aSlaveIter = maSlaveMap.begin(), aSlaveEnd = maSlaveMap.end(); - while (aSlaveIter != aSlaveEnd) + for( const auto& rSlave : maSlaveMap ) { - if ( (*aSlaveIter).second->IsInit()) + if( rSlave.second->IsInit() ) { comphelper::ChainablePropertySet::_postGetPropertyState(); - (*aSlaveIter).second->SetInit ( false ); + rSlave.second->SetInit( false ); } - ++aSlaveIter; } } return aStates; |