diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-12 10:06:27 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-13 08:09:28 +0000 |
commit | f12b17867ef8fa2cfc2ddb7ecda9d7acc57cfa59 (patch) | |
tree | 3b0a89e34cfca550b38b92423a1de4b805d2c91c /vcl/source/window/accmgr.cxx | |
parent | 96fab0513215cc416e96e1b2089466afd0d2791c (diff) |
clang-tidy modernize-loop-convert in vcl
Change-Id: I79e97a4826bfe3918de223cccf48646a1404f901
Reviewed-on: https://gerrit.libreoffice.org/24922
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source/window/accmgr.cxx')
-rw-r--r-- | vcl/source/window/accmgr.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx index 295a1681d40a..3b45dc742571 100644 --- a/vcl/source/window/accmgr.cxx +++ b/vcl/source/window/accmgr.cxx @@ -34,8 +34,8 @@ bool ImplAccelManager::InsertAccel( Accelerator* pAccel ) if ( !mpAccelList ) { mpAccelList = new ImplAccelList; } else { - for ( size_t i = 0, n = mpAccelList->size(); i < n; ++i ) { - if ( (*mpAccelList)[ i ] == pAccel ) { + for (Accelerator* i : *mpAccelList) { + if ( i == pAccel ) { return false; } } @@ -58,8 +58,8 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel ) if ( mpSequenceList ) { for (sal_uInt16 i = 0; i < pAccel->GetItemCount(); ++i) { Accelerator* pSubAccel = pAccel->GetAccel( pAccel->GetItemId(i) ); - for ( size_t j = 0, n = mpSequenceList->size(); j < n; ++j ) { - if ( (*mpSequenceList)[ j ] == pSubAccel ) { + for (Accelerator* j : *mpSequenceList) { + if ( j == pSubAccel ) { EndSequence(); i = pAccel->GetItemCount(); break; @@ -86,9 +86,8 @@ void ImplAccelManager::EndSequence() if ( !mpSequenceList ) return; - for ( size_t i = 0, n = mpSequenceList->size(); i < n; ++i ) + for (Accelerator* pTempAccel : *mpSequenceList) { - Accelerator* pTempAccel = (*mpSequenceList)[ i ]; pTempAccel->mbIsCancel = false; pTempAccel->mpDel = nullptr; } @@ -183,9 +182,9 @@ bool ImplAccelManager::IsAccelKey( const vcl::KeyCode& rKeyCode, sal_uInt16 nRep } // step through the list of accelerators - for ( size_t i = 0, n = mpAccelList->size(); i < n; ++i ) + for (Accelerator* i : *mpAccelList) { - pAccel = (*mpAccelList)[ i ]; + pAccel = i; // is the entry contained ? ImplAccelEntry* pEntry = pAccel->ImplGetAccelData( rKeyCode ); |