Kaydet (Commit) d14ab013 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

use C++11 iteration

Change-Id: I20a3aeef306ca83daa2d78647814ff6bb32ef082
üst 63ef826b
...@@ -1678,38 +1678,35 @@ void SwRootFrm::EndAllAction( bool bVirDev ) ...@@ -1678,38 +1678,35 @@ void SwRootFrm::EndAllAction( bool bVirDev )
void SwRootFrm::UnoRemoveAllActions() void SwRootFrm::UnoRemoveAllActions()
{ {
SwViewShell *pSh = GetCurrShell(); if ( GetCurrShell() )
if ( pSh ) for(SwViewShell& rSh : GetCurrShell()->GetRingContainer())
do
{ {
// #i84729# // #i84729#
// No end action, if <SwViewShell> instance is currently in its end action. // No end action, if <SwViewShell> instance is currently in its end action.
// Recursives calls to <::EndAction()> are not allowed. // Recursives calls to <::EndAction()> are not allowed.
if ( !pSh->IsInEndAction() ) if ( !rSh.IsInEndAction() )
{ {
OSL_ENSURE(!pSh->GetRestoreActions(), "Restore action count is already set!"); OSL_ENSURE(!rSh.GetRestoreActions(), "Restore action count is already set!");
bool bCrsr = pSh->ISA( SwCrsrShell ); bool bCrsr = rSh.ISA( SwCrsrShell );
bool bFE = pSh->ISA( SwFEShell ); bool bFE = rSh.ISA( SwFEShell );
sal_uInt16 nRestore = 0; sal_uInt16 nRestore = 0;
while( pSh->ActionCount() ) while( rSh.ActionCount() )
{ {
if( bCrsr ) if( bCrsr )
{ {
static_cast<SwCrsrShell*>(pSh)->EndAction(); static_cast<SwCrsrShell*>(&rSh)->EndAction();
static_cast<SwCrsrShell*>(pSh)->CallChgLnk(); static_cast<SwCrsrShell*>(&rSh)->CallChgLnk();
if ( bFE ) if ( bFE )
static_cast<SwFEShell*>(pSh)->SetChainMarker(); static_cast<SwFEShell*>(&rSh)->SetChainMarker();
} }
else else
pSh->EndAction(); rSh.EndAction();
nRestore++; nRestore++;
} }
pSh->SetRestoreActions(nRestore); rSh.SetRestoreActions(nRestore);
} }
pSh->LockView(true); rSh.LockView(true);
pSh = static_cast<SwViewShell*>(pSh->GetNext()); }
} while ( pSh != GetCurrShell() );
} }
void SwRootFrm::UnoRestoreAllActions() void SwRootFrm::UnoRestoreAllActions()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment