[Libreoffice-commits] core.git: Branch 'libreoffice-5-3-3' - sw/source
Michael Stahl
mstahl at redhat.com
Wed May 3 10:43:17 UTC 2017
sw/source/core/layout/calcmove.cxx | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit ecd21ca76a5f3d81e6f74b167f4a07bafa4f148f
Author: Michael Stahl <mstahl at 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 <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit 0ae68775afc6227afb881e28c1b2045b3030ad53)
Reviewed-on: https://gerrit.libreoffice.org/37056
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
Reviewed-by: Eike Rathke <erack at redhat.com>
Reviewed-by: David Tardon <dtardon at redhat.com>
Tested-by: David Tardon <dtardon at 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
{
More information about the Libreoffice-commits
mailing list