summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-01-23 23:07:01 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-01-23 23:15:18 +0100
commitf5c6391b2e3ef703bc4d4efd691f79f1605d5283 (patch)
treed13228240b3251f3e41a2d293a1c1ceae4599a5b /sw
parent512f85f07dc1483ea3ab328597092ec3170fbeaa (diff)
do not use manual iteration
Change-Id: I1911b1dec2acd89c104c2b226fb212b7deb40c3b
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/view/vnew.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 31d0de4028dc..6a951a10c068 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -360,9 +360,19 @@ SwViewShell::~SwViewShell()
if ( mpDoc )
{
GetLayout()->DeRegisterShell( this );
- if(mpDoc->getIDocumentLayoutAccess().GetCurrentViewShell()==this)
- mpDoc->getIDocumentLayoutAccess().SetCurrentViewShell( this->GetNext()!=this ?
- this->GetNext() : nullptr );
+ auto& rLayoutAccess(mpDoc->getIDocumentLayoutAccess());
+ if(rLayoutAccess.GetCurrentViewShell()==this)
+ {
+ rLayoutAccess.SetCurrentViewShell(nullptr);
+ for(SwViewShell& rShell : GetRingContainer())
+ {
+ if(&rShell != this)
+ {
+ rLayoutAccess.SetCurrentViewShell(&rShell);
+ break;
+ }
+ }
+ }
}
delete mpTmpRef;