diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-09 13:23:20 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-10 06:30:37 +0000 |
commit | 990ab0342a7b0c66a4bf9bac75d5c881f0f7266b (patch) | |
tree | c1099d7b9ea1a45e6a5b42eae369b0c1551bd491 /sfx2/source/view/viewsh.cxx | |
parent | f469309e265b8cf692b2048eb29ce972f939c3f2 (diff) |
clang-tidy modernize-loop-convert sfx2
Change-Id: Ief72064e2869945734215a7c67440adc6c1550c3
Reviewed-on: https://gerrit.libreoffice.org/24799
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sfx2/source/view/viewsh.cxx')
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index c785f8e3639c..0852c1d255e6 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -814,9 +814,8 @@ SfxInPlaceClient* SfxViewShell::FindIPClient if( !pObjParentWin ) pObjParentWin = GetWindow(); - for ( size_t n = 0; n < pClients->size(); n++) + for (SfxInPlaceClient* pIPClient : *pClients) { - SfxInPlaceClient *pIPClient = pClients->at( n ); if ( pIPClient->GetObject() == xObj && pIPClient->GetEditWin() == pObjParentWin ) return pIPClient; } @@ -838,9 +837,8 @@ SfxInPlaceClient* SfxViewShell::GetUIActiveIPClient_Impl() const if ( !pClients ) return nullptr; - for ( size_t n = 0; n < pClients->size(); n++) + for (SfxInPlaceClient* pIPClient : *pClients) { - SfxInPlaceClient* pIPClient = pClients->at( n ); if ( pIPClient->IsUIActive() ) return pIPClient; } @@ -854,9 +852,8 @@ SfxInPlaceClient* SfxViewShell::GetUIActiveClient() const if ( !pClients ) return nullptr; - for ( size_t n = 0; n < pClients->size(); n++) + for (SfxInPlaceClient* pIPClient : *pClients) { - SfxInPlaceClient* pIPClient = pClients->at( n ); if ( pIPClient->IsObjectUIActive() ) return pIPClient; } @@ -1341,17 +1338,15 @@ SfxViewShell* SfxViewShell::GetFirst // search for a SfxViewShell of the specified type SfxViewShellArr_Impl &rShells = SfxGetpApp()->GetViewShells_Impl(); SfxViewFrameArr_Impl &rFrames = SfxGetpApp()->GetViewFrames_Impl(); - for ( size_t nPos = 0; nPos < rShells.size(); ++nPos ) + for (SfxViewShell* pShell : rShells) { - SfxViewShell *pShell = rShells[nPos]; if ( pShell ) { // sometimes dangling SfxViewShells exist that point to a dead SfxViewFrame // these ViewShells shouldn't be accessible anymore // a destroyed ViewFrame is not in the ViewFrame array anymore, so checking this array helps - for ( size_t n=0; n<rFrames.size(); ++n ) + for (SfxViewFrame* pFrame : rFrames) { - SfxViewFrame *pFrame = rFrames[n]; if ( pFrame == pShell->GetViewFrame() ) { // only ViewShells with a valid ViewFrame will be returned @@ -1391,9 +1386,8 @@ SfxViewShell* SfxViewShell::GetNext // sometimes dangling SfxViewShells exist that point to a dead SfxViewFrame // these ViewShells shouldn't be accessible anymore // a destroyed ViewFrame is not in the ViewFrame array anymore, so checking this array helps - for ( size_t n=0; n<rFrames.size(); ++n ) + for (SfxViewFrame* pFrame : rFrames) { - SfxViewFrame *pFrame = rFrames[n]; if ( pFrame == pShell->GetViewFrame() ) { // only ViewShells with a valid ViewFrame will be returned @@ -1423,9 +1417,8 @@ void SfxViewShell::Notify( SfxBroadcaster& rBC, { // avoid access to dangling ViewShells SfxViewFrameArr_Impl &rFrames = SfxGetpApp()->GetViewFrames_Impl(); - for ( size_t n=0; n<rFrames.size(); ++n ) + for (SfxViewFrame* frame : rFrames) { - SfxViewFrame *frame = rFrames[n]; if ( frame == GetViewFrame() && &rBC == GetObjectShell() ) { SfxItemSet* pSet = GetObjectShell()->GetMedium()->GetItemSet(); @@ -1522,9 +1515,8 @@ void SfxViewShell::ResetAllClients_Impl( SfxInPlaceClient *pIP ) if ( !pClients ) return; - for ( size_t n = 0; n < pClients->size(); n++ ) + for (SfxInPlaceClient* pIPClient : *pClients) { - SfxInPlaceClient* pIPClient = pClients->at( n ); if( pIPClient != pIP ) pIPClient->ResetObject(); } @@ -1554,9 +1546,8 @@ void SfxViewShell::VisAreaChanged(const Rectangle& /*rVisArea*/) if ( !pClients ) return; - for ( size_t n = 0; n < pClients->size(); n++) + for (SfxInPlaceClient* pIPClient : *pClients) { - SfxInPlaceClient* pIPClient = pClients->at( n ); if ( pIPClient->IsObjectInPlaceActive() ) // client is active, notify client that the VisArea might have changed pIPClient->VisAreaChanged(); |