Kaydet (Commit) 00a86e8b authored tarafından Michael Stahl's avatar Michael Stahl

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 18765b9f, for unknown reasons.

Change-Id: I1a5c50d21c241e593419e63644ee758cdd9ed319
Reviewed-on: https://gerrit.libreoffice.org/69061
Tested-by: Jenkins
Reviewed-by: 's avatarMichael Stahl <Michael.Stahl@cib.de>
üst 8aa57983
......@@ -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 )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment