diff options
authorMichael Stahl <>2019-03-11 15:43:31 +0100
committerMichael Stahl <>2019-03-12 11:17:50 +0100
commit00a86e8be983f7a92723dfe6cf5986974d77644e (patch)
parent8aa579830b20072af8d6e149d6b279362fe98b91 (diff)
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: Tested-by: Jenkins Reviewed-by: Michael Stahl <>
1 files changed, 6 insertions, 2 deletions
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 )