summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/UnoPanel.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/UnoPanel.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/UnoPanel.cxx')
-rw-r--r--sfx2/source/sidebar/UnoPanel.cxx37
1 files changed, 13 insertions, 24 deletions
diff --git a/sfx2/source/sidebar/UnoPanel.cxx b/sfx2/source/sidebar/UnoPanel.cxx
index a382fe133b4c..f4f022ca74c0 100644
--- a/sfx2/source/sidebar/UnoPanel.cxx
+++ b/sfx2/source/sidebar/UnoPanel.cxx
@@ -93,13 +93,10 @@ void SAL_CALL SfxUnoPanel::expand( const sal_Bool bCollapseOther )
if (bCollapseOther)
{
SharedPanelContainer aPanels = mpDeck->GetPanels();
- for ( SharedPanelContainer::iterator iPanel(aPanels.begin()), iEnd(aPanels.end());
- iPanel!=iEnd; ++iPanel)
+ for (auto const& panel : aPanels)
{
- VclPtr<Panel> const & aPanel = *iPanel;
-
- if (! aPanel->HasIdPredicate(mPanelId))
- aPanel->SetExpanded(false);
+ if (! panel->HasIdPredicate(mPanelId))
+ panel->SetExpanded(false);
}
}
@@ -206,10 +203,9 @@ void SAL_CALL SfxUnoPanel::moveUp()
sal_Int32 curOrderIndex = getOrderIndex();
sal_Int32 previousIndex = GetMinOrderIndex(aPanels);
- ResourceManager::PanelContextDescriptorContainer::const_iterator iPanel;
- for (iPanel = aPanels.begin(); iPanel != aPanels.end(); ++iPanel)
+ for (auto const& panel : aPanels)
{
- sal_Int32 index = pSidebarController->GetResourceManager()->GetPanelDescriptor(iPanel->msId)->mnOrderIndex;
+ sal_Int32 index = pSidebarController->GetResourceManager()->GetPanelDescriptor(panel.msId)->mnOrderIndex;
if( index < curOrderIndex && index > previousIndex)
previousIndex = index;
}
@@ -238,10 +234,9 @@ void SAL_CALL SfxUnoPanel::moveDown()
sal_Int32 curOrderIndex = getOrderIndex();
sal_Int32 nextIndex = GetMaxOrderIndex(aPanels);
- ResourceManager::PanelContextDescriptorContainer::const_iterator iPanel;
- for (iPanel = aPanels.begin(); iPanel != aPanels.end(); ++iPanel)
+ for (auto const& panel : aPanels)
{
- sal_Int32 index = pSidebarController->GetResourceManager()->GetPanelDescriptor(iPanel->msId)->mnOrderIndex;
+ sal_Int32 index = pSidebarController->GetResourceManager()->GetPanelDescriptor(panel.msId)->mnOrderIndex;
if( index > curOrderIndex && index < nextIndex)
nextIndex = index;
}
@@ -263,14 +258,11 @@ sal_Int32 SfxUnoPanel::GetMinOrderIndex(ResourceManager::PanelContextDescriptorC
{
SidebarController* pSidebarController = getSidebarController();
- ResourceManager::PanelContextDescriptorContainer::iterator iPanel;
-
- iPanel = aPanels.begin();
- sal_Int32 minIndex = pSidebarController->GetResourceManager()->GetPanelDescriptor(iPanel->msId)->mnOrderIndex;
+ sal_Int32 minIndex = pSidebarController->GetResourceManager()->GetPanelDescriptor(aPanels.begin()->msId)->mnOrderIndex;
- for (iPanel = aPanels.begin(); iPanel != aPanels.end(); ++iPanel)
+ for (auto const& panel : aPanels)
{
- sal_Int32 index = pSidebarController->GetResourceManager()->GetPanelDescriptor(iPanel->msId)->mnOrderIndex;
+ sal_Int32 index = pSidebarController->GetResourceManager()->GetPanelDescriptor(panel.msId)->mnOrderIndex;
if(minIndex > index)
minIndex = index;
}
@@ -281,14 +273,11 @@ sal_Int32 SfxUnoPanel::GetMaxOrderIndex(ResourceManager::PanelContextDescriptorC
{
SidebarController* pSidebarController = getSidebarController();
- ResourceManager::PanelContextDescriptorContainer::iterator iPanel;
-
- iPanel = aPanels.begin();
- sal_Int32 maxIndex = pSidebarController->GetResourceManager()->GetPanelDescriptor(iPanel->msId)->mnOrderIndex;
+ sal_Int32 maxIndex = pSidebarController->GetResourceManager()->GetPanelDescriptor(aPanels.begin()->msId)->mnOrderIndex;
- for (iPanel = aPanels.begin(); iPanel != aPanels.end(); ++iPanel)
+ for (auto const& panel : aPanels)
{
- sal_Int32 index = pSidebarController->GetResourceManager()->GetPanelDescriptor(iPanel->msId)->mnOrderIndex;
+ sal_Int32 index = pSidebarController->GetResourceManager()->GetPanelDescriptor(panel.msId)->mnOrderIndex;
if(maxIndex < index)
maxIndex = index;
}