summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-01-23 22:59:38 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-01-23 23:15:17 +0100
commita5970372925cc4ff2c2a0fd6e615a7282b113505 (patch)
tree417eb790f3d16ff093b59048c23e5173ea9b3407 /sw
parent965d09ebb247cd39c145852b231fd0c51e1e50d7 (diff)
do not use manual iteration
Change-Id: Iafb10e4a3cf26138a4a5d2647d115bc435ef61ba
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/draw/dcontact.cxx28
1 files changed, 15 insertions, 13 deletions
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index f5d66b4b4b0a..e3e9a6e2f5b8 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1058,28 +1058,30 @@ void SwDrawContact::Changed( const SdrObject& rObj,
}
//Put on Action, but not if presently anywhere an action runs.
- SwViewShell *pSh = nullptr, *pOrg;
+ bool bHasActions(true);
SwRootFrm *pTmpRoot = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
if ( pTmpRoot && pTmpRoot->IsCallbackActionEnabled() )
{
- pOrg = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
- pSh = pOrg;
- if ( pSh )
- do
- { if ( pSh->Imp()->IsAction() || pSh->Imp()->IsIdleAction() )
- pSh = nullptr;
- else
- pSh = pSh->GetNext();
-
- } while ( pSh && pSh != pOrg );
-
+ SwViewShell* const pSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
if ( pSh )
+ {
+ for(SwViewShell& rShell : pSh->GetRingContainer() )
+ {
+ if ( rShell.Imp()->IsAction() || rShell.Imp()->IsIdleAction() )
+ {
+ bHasActions = true;
+ break;
+ }
+ bHasActions = false;
+ }
+ }
+ if(!bHasActions)
pTmpRoot->StartAllAction();
}
SdrObjUserCall::Changed( rObj, eType, rOldBoundRect );
_Changed( rObj, eType, &rOldBoundRect ); //Attention, possibly suicidal!
- if ( pSh )
+ if(!bHasActions)
pTmpRoot->EndAllAction();
}