[Libreoffice-commits] core.git: sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 23 15:36:45 UTC 2021


 sw/source/core/text/frmform.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 44cc59db6f4f4f8b2ce5c993a31b5a019a8d7e97
Author:     Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Fri Jul 23 16:19:59 2021 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri Jul 23 17:36:10 2021 +0200

    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 at allotropia.de>

diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 111afe6a0f89..d0d9cc68fb54 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 ) )


More information about the Libreoffice-commits mailing list