From 3ed4078ad2e1bb35829b118a5067ad3a43365bbc Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 6 May 2014 22:15:58 +0200 Subject: SwLayAction: there can be only one, so assert that Requires tweaking the SwLayIdle code a bit, where an action is kept alive a bit after it's done, which would trigger the assertion. Change-Id: Ic5c8f90bc101b9d73cfde9691b2bbf405a001393 --- sw/source/core/layout/layact.cxx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index f32831d28caf..9f8de677efb3 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -300,6 +300,7 @@ SwLayAction::SwLayAction( SwRootFrm *pRt, SwViewImp *pI ) : // OD 14.04.2003 #106346# - init new flag . mbFormatCntntOnInterrupt = false; + assert(!pImp->pLayAct); // there can be only one SwLayAction pImp->pLayAct = this; // register there } @@ -2169,11 +2170,15 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) : pSh = (SwViewShell*)pSh->GetNext(); } while ( pSh != pImp->GetShell() ); - SwLayAction aAction( pRoot, pImp ); - aAction.SetInputType( VCL_INPUT_ANY ); - aAction.SetIdle( true ); - aAction.SetWaitAllowed( false ); - aAction.Action(); + bool bInterrupt(false); + { + SwLayAction aAction( pRoot, pImp ); + aAction.SetInputType( VCL_INPUT_ANY ); + aAction.SetIdle( true ); + aAction.SetWaitAllowed( false ); + aAction.Action(); + bInterrupt = aAction.IsInterrupt(); + } // Further start/end actions only happen if there were paints started // somewhere or if the visibility of the CharRects has changed. @@ -2263,7 +2268,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) : } while ( pSh != pImp->GetShell() ); } - if ( !aAction.IsInterrupt() ) + if (!bInterrupt) { if ( !DoIdleJob( WORD_COUNT, false ) ) if ( !DoIdleJob( SMART_TAGS, false ) ) -- cgit