summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-06-02 13:58:01 +0200
committerCaolán McNamara <caolanm@redhat.com>2019-06-08 22:18:56 +0200
commitee46d8e8c7375044e792ce330c80bf313e59b5e7 (patch)
treeb97a9bc1d5ba289ff73f99b12b0926ea071d1a67
parentfd4324c64a6919ef46328608b447decc5c5f2d49 (diff)
tdf#119109 sw: tweak assertion in PrepareMake()
Empty section frames cause trouble for the assert added in e14056e6e88d9b8d988b7b88b2776a8fc952031b: * existing ones may be skipped by MoveBwd(), so a SwTextFrame moves to the previous page but the SwSectionFrame that was its mpPrev remains on this page; e.g. ooo110854-1.rtf * a SwSectionFrame moves backward, then some SwTextFrame in it splits and the follow tries to move forward, resulting in *new* SwSectionFrames on this page that are empty (because the follow is eventually joined again); e.g. abi3213-1.rtf So if there's a section frame, assume it's SNAFU and don't assert. Change-Id: Ibdca2aa39fae123583e5edf5173f80e8b70ef335 Reviewed-on: https://gerrit.libreoffice.org/73333 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit 1416c5426a757d32f223cab46bf9038bd7f21d48) Reviewed-on: https://gerrit.libreoffice.org/73616 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/layout/calcmove.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index b7b083ee88d4..871f77a2f96e 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -318,6 +318,8 @@ void SwFrame::PrepareMake(vcl::RenderContext* pRenderContext)
if (isLast && pFrame->GetUpper() != GetUpper())
{
assert(GetUpper()->Lower() == this
+ // empty section frames are created all the time...
+ || GetUpper()->Lower()->IsSctFrame()
// tab frame/section frame may split multiple times
|| ( SwFlowFrame::CastFlowFrame(pFrame)
&& SwFlowFrame::CastFlowFrame(GetUpper()->Lower())
@@ -440,6 +442,8 @@ void SwFrame::PrepareCursor()
if (isLast && pFrame->GetUpper() != GetUpper())
{
assert(GetUpper()->Lower() == this
+ // empty section frames are created all the time...
+ || GetUpper()->Lower()->IsSctFrame()
// tab frame/section frame may split multiple times
|| ( SwFlowFrame::CastFlowFrame(pFrame)
&& SwFlowFrame::CastFlowFrame(GetUpper()->Lower())