diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-06-09 23:48:25 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-06-10 00:10:46 +0200 |
commit | 2d2af57bc0406cd3afd376dd3c92be112b8c9603 (patch) | |
tree | e8c800ebbb6bb78d291ec2399e22d6b5cd155c4e /sw | |
parent | d76fa3f5a5ae1d781ddd7457607a5773373d4f01 (diff) |
sw: DisableCallbackAction in a bunch more places
... to prevent recursive layout.
Change-Id: I4a7cdcebe77bd7d8d16c721765ad5eb171e84619
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/crsr/swcrsr.cxx | 1 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 1 | ||||
-rw-r--r-- | sw/source/core/fields/postithelper.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/frmedt/fews.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 1 |
6 files changed, 24 insertions, 10 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 400a751768cc..97a5cb3d453f 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1541,15 +1541,18 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd ) SwCursorMoveState aTmpState( MV_NONE ); aTmpState.m_bRealHeight = true; - if( !pTableFrame->GetCharRect( m_aCharRect, *m_pTableCursor->GetPoint(), &aTmpState ) ) { - Point aCentrPt( m_aCharRect.Center() ); - aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable(); - pTableFrame->GetCursorOfst( m_pTableCursor->GetPoint(), aCentrPt, &aTmpState ); - bool const bResult = - pTableFrame->GetCharRect( m_aCharRect, *m_pTableCursor->GetPoint() ); - OSL_ENSURE( bResult, "GetCharRect failed." ); - (void) bResult; // non-debug: unused + DisableCallbackAction a(*GetLayout()); + if (!pTableFrame->GetCharRect( m_aCharRect, *m_pTableCursor->GetPoint(), &aTmpState)) + { + Point aCentrPt( m_aCharRect.Center() ); + aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable(); + pTableFrame->GetCursorOfst(m_pTableCursor->GetPoint(), aCentrPt, &aTmpState); + bool const bResult = + pTableFrame->GetCharRect(m_aCharRect, *m_pTableCursor->GetPoint()); + OSL_ENSURE( bResult, "GetCharRect failed." ); + (void) bResult; // non-debug: unused + } } m_pVisibleCursor->Hide(); // always hide visible Cursor @@ -1804,6 +1807,7 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd ) if( !(eFlags & SwCursorShell::UPDOWN )) // delete old Pos. of Up/Down { + DisableCallbackAction a(*GetLayout()); pFrame->Calc(GetOut()); m_nUpDownX = pFrame->IsVertical() ? m_aCharRect.Top() - pFrame->Frame().Top() : diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index de3452b4f988..23e6a6b59f61 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -1843,6 +1843,7 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt, if( !pTableCursor ) { // try to position the cursor at half of the char-rect's height + DisableCallbackAction a(*GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout()); pFrame = GetContentNode()->getLayoutFrame( GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, GetPoint() ); SwCursorMoveState eTmpState( MV_UPDOWN ); eTmpState.m_bSetInReadOnly = bInReadOnly; diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 09bd92e16f6f..f9a992833f10 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -250,6 +250,7 @@ SwTextFrame* SwAutoFormat::GetFrame( const SwTextNode& rTextNd ) const OSL_ENSURE( pFrame, "For Autoformat a Layout is needed" ); if( m_aFlags.bAFormatByInput && !pFrame->IsValid() ) { + DisableCallbackAction a(const_cast<SwRootFrame&>(*pFrame->getRootFrame())); SwRect aTmpFrame( pFrame->Frame() ); SwRect aTmpPrt( pFrame->Prt() ); pFrame->Calc(pFrame->getRootFrame()->GetCurrShell()->GetOut()); diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx index cfe556c76e56..8da466867d28 100644 --- a/sw/source/core/fields/postithelper.cxx +++ b/sw/source/core/fields/postithelper.cxx @@ -60,7 +60,10 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( aRet = VISIBLE; o_rInfo.mpAnchorFrame = pTextFrame; - pTextFrame->GetCharRect(o_rInfo.mPosition, rAnchorPos, nullptr, false); + { + DisableCallbackAction a(*pTextFrame->getRootFrame()); + pTextFrame->GetCharRect(o_rInfo.mPosition, rAnchorPos, nullptr, false); + } if ( pAnnotationStartPos != nullptr ) { o_rInfo.mnStartNodeIdx = pAnnotationStartPos->nNode.GetIndex(); diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index d1b2a0906454..1208a71aa8cf 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -116,9 +116,13 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt, case CurRectType::Page : pFrame = pFrame->FindPageFrame(); break; - case CurRectType::PageCalc:pFrame->Calc(Imp()->GetShell()->GetOut()); + case CurRectType::PageCalc: + { + DisableCallbackAction a(const_cast<SwRootFrame&>(*pFrame->getRootFrame())); + pFrame->Calc(Imp()->GetShell()->GetOut()); pFrame = pFrame->FindPageFrame(); pFrame->Calc(Imp()->GetShell()->GetOut()); + } break; case CurRectType::FlyEmbeddedPrt: diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 1c00d99e4461..e35c6185c2db 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -616,6 +616,7 @@ static bool lcl_FormatTable(SwFrameFormat* pTableFormat) // mba: no TYPEINFO for SwTabFrame if(!pFrame->IsTabFrame()) continue; + DisableCallbackAction a(*pFrame->getRootFrame()); SwTabFrame* pTabFrame = static_cast<SwTabFrame*>(pFrame); if(pTabFrame->IsValid()) pTabFrame->InvalidatePos(); |