summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/UnoDeck.cxx
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-02-07 21:47:10 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-08 07:23:18 +0100
commitd761be572b6a49dff64db47bbdda309e7b984f95 (patch)
tree16e859e0492caa55c2d85e13b7c7e20e837746df /sfx2/source/sidebar/UnoDeck.cxx
parent7daa249981e0d0b69f4f7564bfb6bc643f375039 (diff)
Use for-range loops in sfx2 (part2)
Change-Id: Ie13b5836eff2e9b5dfec4bb95935de9560ab4be0 Reviewed-on: https://gerrit.libreoffice.org/49393 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/sidebar/UnoDeck.cxx')
-rw-r--r--sfx2/source/sidebar/UnoDeck.cxx24
1 files changed, 9 insertions, 15 deletions
diff --git a/sfx2/source/sidebar/UnoDeck.cxx b/sfx2/source/sidebar/UnoDeck.cxx
index a87dcb7194d8..1bcc0d8f7e86 100644
--- a/sfx2/source/sidebar/UnoDeck.cxx
+++ b/sfx2/source/sidebar/UnoDeck.cxx
@@ -192,10 +192,9 @@ void SAL_CALL SfxUnoDeck::moveUp()
sal_Int32 curOrderIndex = getOrderIndex();
sal_Int32 previousIndex = GetMinOrderIndex(aDecks);
- ResourceManager::DeckContextDescriptorContainer::const_iterator iDeck;
- for (iDeck = aDecks.begin(); iDeck != aDecks.end(); ++iDeck)
+ for (auto const& deck : aDecks)
{
- sal_Int32 index = pSidebarController->GetResourceManager()->GetDeckDescriptor(iDeck->msId)->mnOrderIndex;
+ sal_Int32 index = pSidebarController->GetResourceManager()->GetDeckDescriptor(deck.msId)->mnOrderIndex;
if( index < curOrderIndex && index > previousIndex)
previousIndex = index;
}
@@ -224,11 +223,9 @@ void SAL_CALL SfxUnoDeck::moveDown()
sal_Int32 curOrderIndex = getOrderIndex();
sal_Int32 nextIndex = GetMaxOrderIndex(aDecks);
-
- ResourceManager::DeckContextDescriptorContainer::const_iterator iDeck;
- for (iDeck = aDecks.begin(); iDeck != aDecks.end(); ++iDeck)
+ for (auto const& deck : aDecks)
{
- sal_Int32 index = pSidebarController->GetResourceManager()->GetDeckDescriptor(iDeck->msId)->mnOrderIndex;
+ sal_Int32 index = pSidebarController->GetResourceManager()->GetDeckDescriptor(deck.msId)->mnOrderIndex;
if( index > curOrderIndex && index < nextIndex)
nextIndex = index;
}
@@ -255,9 +252,9 @@ sal_Int32 SfxUnoDeck::GetMinOrderIndex(ResourceManager::DeckContextDescriptorCon
iDeck = aDecks.begin();
sal_Int32 minIndex = pSidebarController->GetResourceManager()->GetDeckDescriptor(iDeck->msId)->mnOrderIndex;
- for (iDeck = aDecks.begin(); iDeck != aDecks.end(); ++iDeck)
+ for (auto const& deck : aDecks)
{
- sal_Int32 index = pSidebarController->GetResourceManager()->GetDeckDescriptor(iDeck->msId)->mnOrderIndex;
+ sal_Int32 index = pSidebarController->GetResourceManager()->GetDeckDescriptor(deck.msId)->mnOrderIndex;
if(minIndex > index)
minIndex = index;
}
@@ -268,14 +265,11 @@ sal_Int32 SfxUnoDeck::GetMaxOrderIndex(ResourceManager::DeckContextDescriptorCon
{
SidebarController* pSidebarController = getSidebarController();
- ResourceManager::DeckContextDescriptorContainer::const_iterator iDeck;
-
- iDeck = aDecks.begin();
- sal_Int32 maxIndex = pSidebarController->GetResourceManager()->GetDeckDescriptor(iDeck->msId)->mnOrderIndex;
+ sal_Int32 maxIndex = pSidebarController->GetResourceManager()->GetDeckDescriptor(aDecks.begin()->msId)->mnOrderIndex;
- for (iDeck = aDecks.begin(); iDeck != aDecks.end(); ++iDeck)
+ for (auto const& deck : aDecks)
{
- sal_Int32 index = pSidebarController->GetResourceManager()->GetDeckDescriptor(iDeck->msId)->mnOrderIndex;
+ sal_Int32 index = pSidebarController->GetResourceManager()->GetDeckDescriptor(deck.msId)->mnOrderIndex;
if(maxIndex < index)
maxIndex = index;
}