diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-06-19 15:03:27 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-06-20 11:19:16 +0200 |
commit | dd489bc01adc22fc5015ea56b61d66104af184a8 (patch) | |
tree | 86357e3df2e7e38c6221c4fdacdfd9b51de7a0f6 /sw/source/core/layout/wsfrm.cxx | |
parent | cf13e1ddef974fb929916a9a4a54f37188b10389 (diff) |
tdf#125754 sw_redlinehide: avoid recursive layout in SetHideRedlines()
During SwLayHelper::CheckInsertPage(), SwRootFrame::CheckViewLayout() is
called, which may change the size of the view, which causes a
StartAction()/EndAction(), therefore layouting the frames existing at
that point, which moves some content onto the newly created frame, but
CheckInsertPage() expects to find only SwLayoutFrames on it and crashes.
40 SwLayAction::InternalAction(OutputDevice*) (this=0x7fffd2333f00) at sw/source/core/layout/layact.cxx:551
41 SwLayAction::Action(OutputDevice*) (this=0x7fffd2333f00) at sw/source/core/layout/layact.cxx:348
42 SwViewShell::ImplEndAction(bool) (this=0x56eaff0, bIdleEnd=false) at sw/source/core/view/viewsh.cxx:295
43 SwViewShell::EndAction(bool) (this=0x56eaff0, bIdleEnd=false) at sw/inc/viewsh.hxx:600
44 SwCursorShell::EndAction(bool, bool) (this=0x56eaff0, bIdleEnd=false, DoSetPosX=false) at sw/source/core/crsr/crsrsh.cxx:254
45 SwView::OuterResizePixel(Point const&, Size const&) (this=0x5589850, rOfst=Point = {...}, rSize=Size = {...}) at sw/source/uibase/uiview/viewport.cxx:1125
46 SwView::DocSzChgd(Size const&) (this=0x5589850, rSz=Size = {...}) at sw/source/uibase/uiview/viewport.cxx:203
47 SizeNotify(SwViewShell const*, Size const&) (pVwSh=0x56eaff0, rSize=Size = {...}) at sw/source/uibase/docvw/edtwin3.cxx:67
48 SwViewShell::SizeChgNotify() (this=0x56eaff0) at sw/source/core/view/viewsh.cxx:1077
49 AdjustSizeChgNotify(SwRootFrame*) (pRoot=0x56ea6c0) at sw/source/core/layout/pagechg.cxx:824
50 SwRootFrame::CheckViewLayout(SwViewOption const*, SwRect const*) (this=0x56ea6c0, pViewOpt=0x0, pVisArea=0x0) at sw/source/core/layout/pagechg.cxx:2377
51 SwPageFrame::Paste(SwFrame*, SwFrame*) (this=0x66aa500, pParent=0x56ea6c0, pSibling=0x0) at sw/source/core/layout/pagechg.cxx:941
52 InsertNewPage(SwPageDesc&, SwFrame*, bool, bool, bool, bool, SwFrame*) (rDesc=..., pUpper=0x56ea6c0, bOdd=true, bFirst=false, bInsertEmpty=false, bFootnote=false, pSibling=0x0) at sw/source/core/layout/frmtool.cxx:2853
53 SwLayHelper::CheckInsertPage() (this=0x60a9170) at sw/source/core/layout/laycache.cxx:680
54 SwLayHelper::CheckInsert(unsigned long) (this=0x60a9170, nNodeIndex=1699) at sw/source/core/layout/laycache.cxx:890
55 InsertCnt_(SwLayoutFrame*, SwDoc*, unsigned long, bool, unsigned long, SwFrame*) (pLay=0x6f20f60, pDoc=0x54c86a0, nIndex=1698, bPages=true, nEndIndex=2627, pPrv=0x6ef2d20) at sw/source/core/layout/frmtool.cxx:1503
56 MakeFrames(SwDoc*, SwNodeIndex const&, SwNodeIndex const&) (pDoc=0x54c86a0, rSttIdx=SwNodeIndex (node 1588), rEndIdx=SwNodeIndex (node 2627)) at sw/source/core/layout/frmtool.cxx:1910
57 UnHideRedlines(SwRootFrame&, SwNodes&, SwNode const&, std::__debug::set<unsigned long, std::less<unsigned long>, std::allocator<unsigned long> >*) (rLayout=..., rNodes=..., rEndOfSectionNode=..., pSkipped=0x0) at sw/source/core/layout/wsfrm.cxx:4445
58 SwRootFrame::SetHideRedlines(bool) (this=0x56ea6c0, bHideRedlines=false) at sw/source/core/layout/wsfrm.cxx:4539
59 SwView::Execute(SfxRequest&) (this=0x5589850, rReq=...) at sw/source/uibase/uiview/view2.cxx:658
To avoid that, do StartAction()/EndAction() in the UI caller of
SwRootFrame::SetHideRedlines() already; the other callers in
Undo/DocumentRedlineManager should already be covered by Actions.
Change-Id: I366140415d5714d386af3cf9db30e39b12ade2ce
Reviewed-on: https://gerrit.libreoffice.org/74369
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sw/source/core/layout/wsfrm.cxx')
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index c5854a9d2bde..cfd0e4ff5024 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -4499,6 +4499,7 @@ void SwRootFrame::SetHideRedlines(bool const bHideRedlines) return; } mbHideRedlines = bHideRedlines; + assert(GetCurrShell()->ActionPend()); // tdf#125754 avoid recursive layout SwDoc & rDoc(*GetFormat()->GetDoc()); // don't do early return if there are no redlines: // Show->Hide must init hidden number trees |