summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-11-30 21:36:34 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-12-01 07:10:45 +0100
commit689d98f2bb51f16e1dfa8e35c0b1c0354a5a739a (patch)
treec14777156a3456d8916b1304a4de51239088f07f /sd
parentc1fbc21a45859d3e8a082cf410898ccfcc124425 (diff)
Use for-range loops in ViewShellManager (sd)
Change-Id: I753e3536b18bae5a162f78a8e30dc3bd89fa80a3 Reviewed-on: https://gerrit.libreoffice.org/45620 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/ViewShellManager.cxx37
1 files changed, 14 insertions, 23 deletions
diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx
index 6938dce54226..463487eee215 100644
--- a/sd/source/ui/view/ViewShellManager.cxx
+++ b/sd/source/ui/view/ViewShellManager.cxx
@@ -644,10 +644,9 @@ SfxShell* ViewShellManager::Implementation::GetShell (ShellId nId) const
else
{
// Now search the active sub shells of every active view shell.
- SubShellList::const_iterator iList;
- for (iList=maActiveSubShells.begin(); iList!=maActiveSubShells.end(); ++iList)
+ for (auto const& activeSubShell : maActiveSubShells)
{
- const SubShellSubList& rList (iList->second);
+ const SubShellSubList& rList (activeSubShell.second);
SubShellSubList::const_iterator iSubShell(
::std::find_if(rList.begin(),rList.end(), IsId(nId)));
if (iSubShell != rList.end())
@@ -880,12 +879,11 @@ void ViewShellManager::Implementation::CreateShells()
SubShellSubList& rList (iList->second);
// Iterate over all sub shells of the current view shell.
- SubShellSubList::iterator iSubShell;
- for (iSubShell=rList.begin(); iSubShell!=rList.end(); ++iSubShell)
+ for (auto & subShell : rList)
{
- if (iSubShell->mpShell == nullptr)
+ if (subShell.mpShell == nullptr)
{
- *iSubShell = CreateSubShell(iShell->mpShell,iSubShell->mnId);
+ subShell = CreateSubShell(iShell->mpShell,subShell.mnId);
}
}
}
@@ -941,13 +939,11 @@ IMPL_LINK(ViewShellManager::Implementation, WindowEventHandler, VclWindowEvent&,
{
case VclEventId::WindowGetFocus:
{
- for (ActiveShellList::iterator aI(maActiveViewShells.begin());
- aI!=maActiveViewShells.end();
- ++aI)
+ for (auto const& activeShell : maActiveViewShells)
{
- if (pEventWindow == aI->GetWindow())
+ if (pEventWindow == activeShell.GetWindow())
{
- MoveToTop(*aI->mpShell);
+ MoveToTop(*activeShell.mpShell);
break;
}
}
@@ -960,15 +956,11 @@ IMPL_LINK(ViewShellManager::Implementation, WindowEventHandler, VclWindowEvent&,
case VclEventId::ObjectDying:
// Remember that we do not have to remove the window
// listener for this window.
- for (ActiveShellList::iterator
- iShell(maActiveViewShells.begin()),
- iEnd(maActiveViewShells.end());
- iShell!=iEnd;
- ++iShell)
+ for (auto & activeViewShell : maActiveViewShells)
{
- if (iShell->GetWindow() == pEventWindow)
+ if (activeViewShell.GetWindow() == pEventWindow)
{
- iShell->mbIsListenerAddedToWindow = false;
+ activeViewShell.mbIsListenerAddedToWindow = false;
break;
}
}
@@ -1050,10 +1042,9 @@ void ViewShellManager::Implementation::InvalidateAllSubShells (const SfxShell* p
if (iList != maActiveSubShells.end())
{
SubShellSubList& rList (iList->second);
- SubShellSubList::iterator iShell;
- for (iShell=rList.begin(); iShell!=rList.end(); ++iShell)
- if (iShell->mpShell != nullptr)
- iShell->mpShell->Invalidate();
+ for (auto const& shell : rList)
+ if (shell.mpShell != nullptr)
+ shell.mpShell->Invalidate();
}
}