summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-07-23 16:19:59 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-07-26 15:16:46 +0200
commitb0e4775c8d629a343d30d2d1562e53717bd50c76 (patch)
tree8fd908b8f31bf81c0530a74c41ec2460f2d2fe92
parent5602803d07453bfd7c17ed5b6df7551d1041f97c (diff)
sw: layout: fix red triangle problem with text frame in sections
First, a document is loaded, then about 4 pages of content are pasted into it, in about 6 paste operations. In an idle layout action, a page's worth of content moves forward; the text frame at the bottom was split previously, and is joined. The follow has the same upper as the master text frame, so this causes the upper section frame to shrink: SwRect::operator=(const SwRect & rRect) Zeile 256 SwFrameAreaDefinition::FrameAreaWriteAccess::~FrameAreaWriteAccess() Zeile 112 SwSectionFrame::Shrink_(__int64 nDist, bool bTst) Zeile 2327 SwFrame::Shrink(__int64 nDist, bool bTst, bool bInfo) Zeile 1562 SwContentFrame::Cut() Zeile 1339 SwTextFrame::JoinFrame() Zeile 677 SwContentFrame::MakeAll(OutputDevice * __formal) Zeile 1310 The ToMaximize(false) check doesn't help because the section frame doesn't have a follow (or footnotes). Then the text frame is formatted, resulting in one line but no height for it, and a split after the one line. The split causes a follow section frame to be created, calling SwSectionFrame::SimpleFormat() on the master's upper: SwFrameAreaDefinition::FramePrintAreaWriteAccess::~FramePrintAreaWriteAccess() Zeile 120 SwFrame::SetTopBottomMargins(__int64 nTop, __int64 nBot) Zeile 175 SwRectFnSet::SetYMargins(SwFrame & rFrame, __int64 nTop, __int64 nBottom) Zeile 1405 SwSectionFrame::SimpleFormat() Zeile 1192 SwSectionFrame::SwSectionFrame(SwSectionFrame & rSect, bool bMaster) Zeile 110 SwFrame::GetNextSctLeaf(MakePageType eMakePage) Zeile 1781 SwFrame::GetLeaf(MakePageType eMakePage, bool bFwd) Zeile 879 SwFlowFrame::MoveFwd(bool bMakePage, bool bPageBreak, bool bMoveAlways) Zeile 1977 SwContentFrame::MakeAll(OutputDevice * __formal) Zeile 1349 SwFrame::PrepareMake(OutputDevice * pRenderContext) Zeile 286 SwFrame::Calc(OutputDevice * pRenderContext) Zeile 1794 SwTextFrame::CalcFollow(o3tl::strong_int<long,Tag_TextFrameIndex> nTextOfst) Zeile 281 SwTextFrame::AdjustFollow_(SwTextFormatter & rLine, o3tl::strong_int<long,Tag_TextFrameIndex> nOffset, o3tl::strong_int<long,Tag_TextFrameIndex> nEnd, const unsigned char nMode) Zeile 608 Now the upper has space but at this point the master text frame is valid and not invalidated, so it never grows into the available space. There is a check to format again in case additional space is available in SwTextFrame::CalcFollow() but peculiarly it's disabled if the upper is a section frame since initial CVS import. Removing this check appears to fix the problem. Change-Id: Ifad545f7e79675af6e33d68c7fcdbc82bd4f8f57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119419 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 44cc59db6f4f4f8b2ce5c993a31b5a019a8d7e97) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119434 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r--sw/source/core/text/frmform.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 82f2a8dcd893..f59665b2602b 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -323,7 +323,7 @@ bool SwTextFrame::CalcFollow(TextFrameIndex const nTextOfst)
const tools::Long nRemaining =
- aRectFnSet.BottomDist( GetUpper()->getFrameArea(), nOldBottom );
- if ( nRemaining > 0 && !GetUpper()->IsSctFrame() &&
+ if ( nRemaining > 0 &&
nRemaining != ( aRectFnSet.IsVert() ?
nMyPos - getFrameArea().Right() :
getFrameArea().Top() - nMyPos ) )