sw/source/core/layout/calcmove.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit 0ae68775afc6227afb881e28c1b2045b3030ad53 Author: Michael Stahl <mst...@redhat.com> Date: Fri Apr 21 22:44:14 2017 +0200 tdf#107126 sw: fix layout crash with section in footnote SwContentFrame::WouldFit_() contains a hack to temporarily reparent a SwTextFrame. In the bugdoc, there is a SwTextFrame below a SwSectionFrame below a SwFootnoteFrame. The reparenting ignores the SwSectionFrame so the result is a SwTextFrame below SwFootnoteFrame, but it still has its mbInfSct set, hence crashes with a null pointer. If the SwTextFrame is permanently moved later on, in SwFlowFrame::MoveBwd() line 2450 a new SwSectionFrame is created. Change-Id: I45a7ab793b4459e551bd11b7fb83dedc58a6c8da (cherry picked from commit 4d43f9e9dda5edeeb6e4b99487b5b6a1fae4bd56) Reviewed-on: https://gerrit.libreoffice.org/37004 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index c7ebf84ae900..baa4e0577190 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -1868,6 +1868,11 @@ bool SwContentFrame::WouldFit_( SwTwips nSpace, SwFrame *pOldNext = pTmpFrame->GetNext(); pTmpFrame->RemoveFromLayout(); pTmpFrame->InsertBefore( pNewUpper, nullptr ); + // tdf#107126 for a section in a footnote, we have only inserted + // the SwTextFrame but no SwSectionFrame - reset mbInfSct flag + // to avoid crashing (but perhaps we should create a temp + // SwSectionFrame here because WidowsAndOrphans checks for that?) + pTmpFrame->InvalidateInfFlags(); if ( pFrame->IsTextFrame() && ( bTstMove || static_cast<SwTextFrame*>(pFrame)->HasFollow() || @@ -1885,6 +1890,7 @@ bool SwContentFrame::WouldFit_( SwTwips nSpace, pTmpFrame->RemoveFromLayout(); pTmpFrame->InsertBefore( pUp, pOldNext ); + pTmpFrame->InvalidateInfFlags(); // restore flags } else {
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits