sw/source/core/layout/tabfrm.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 00a86e8be983f7a92723dfe6cf5986974d77644e
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Mon Mar 11 15:43:31 2019 +0100
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Tue Mar 12 11:17:50 2019 +0100

    tdf#119253 sw: fix layout loop with row-span table
    
    This table has style:row-height="2.014cm" on its 2nd row (1142 twips).
    
    In the 1st call of FormatLayoutTab(), the 1st row of the table is split
    and the 2nd row moves to the next page.
    
    In the 2nd call of FormatLayoutTab(), the 1st row grows from 400 to 454
    twips, presumably due to the style:min-row-height="0.801cm" on it.
    
    In the 3rd call of FormatLayoutTab(), the GetFollow()->ShouldBwdMoved()
    returns true and the 2nd row moves back again, because
    SwTabFrame::CalcHeightOfFirstContentLine() determines the height of the
    2nd row as the maximum height of cells with rowspan=1 (400 twips), which
    fits on the 1st page, ignoring the style:row-height="2.014cm" on the row
    (1142 twips), which does not fit on the 1st page.
    
    This loops until "LoopControl_1 in SwLayAction::InternalAction" is
    triggered, and then eventually stops in 5.4 but loops even more since
    commit 18765b9fa739337d2d891513f6e2fb7c3ce23b50, for unknown reasons.
    
    Change-Id: I1a5c50d21c241e593419e63644ee758cdd9ed319
    Reviewed-on: https://gerrit.libreoffice.org/69061
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index c5f0d11d8024..e90020ce0a35 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -5592,11 +5592,15 @@ SwTwips SwTabFrame::CalcHeightOfFirstContentLine() const
             // just return the height of the first line. Basically we need to 
get the height of the
             // line as it would be on the last page. Since this is quite 
complicated to calculate,
             // we only calculate the height of the first line.
+            SwFormatFrameSize const& 
rFrameSize(pFirstRow->GetAttrSet()->GetFrameSize());
             if ( pFirstRow->GetPrev() &&
-                 static_cast<const 
SwRowFrame*>(pFirstRow->GetPrev())->IsRowSpanLine() )
+                 static_cast<const 
SwRowFrame*>(pFirstRow->GetPrev())->IsRowSpanLine()
+                && rFrameSize.GetHeightSizeType() != ATT_FIX_SIZE)
             {
                 // Calculate maximum height of all cells with rowspan = 1:
-                SwTwips nMaxHeight = 0;
+                SwTwips nMaxHeight = rFrameSize.GetHeightSizeType() == 
ATT_MIN_SIZE
+                    ? rFrameSize.GetHeight()
+                    : 0;
                 const SwCellFrame* pLower2 = static_cast<const 
SwCellFrame*>(pFirstRow->Lower());
                 while ( pLower2 )
                 {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to