summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-01-23 23:00:16 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-01-23 23:15:18 +0100
commit16e524d565490f740a4105d65f663dacc8aee23d (patch)
tree66c2456030d58bfe9d99f4998fe0d9082edf59e7
parent35f70c86f2d75cca18a34b2290a71753b3910879 (diff)
do not use manual iteration
Change-Id: Id2aaa4171680d8d002d4b2aebf6281ca817c74d9
-rw-r--r--sw/source/core/layout/newfrm.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 58dabc8823c9..d7ecf4fd61f4 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -415,7 +415,17 @@ void SwRootFrm::DeRegisterShell( SwViewShell *pSh )
{
// Activate some shell if possible
if ( pCurrShell == pSh )
- pCurrShell = pSh->GetNext() != pSh ? pSh->GetNext() : nullptr;
+ {
+ pCurrShell = nullptr;
+ for(SwViewShell& rShell : pSh->GetRingContainer())
+ {
+ if(&rShell != pSh)
+ {
+ pCurrShell = &rShell;
+ break;
+ }
+ }
+ }
// Doesn't matter anymore
if ( pWaitingCurrShell == pSh )