summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-02-10 19:43:08 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-02-11 11:36:30 +0100
commitb4271e028686d729189afc5e42a9c310f81144f3 (patch)
tree55ca5af1b17d40bf4137e6369cf7498a55868d94
parent5505b0d7c3e5924c2614b03789307e4c26cb6f24 (diff)
sw: fix layout loop on soffice --convert-to pdf ooo95698-1.odt
For unknown reasons, this loops since commit 32902f66e7749b2d06d13f50416be5323a0c0ea9a "sw_redlinehide: make layout based Show/Hide mode the default" The problem is that when page 1 is layouted for the first time, it splits into 6 pages, and then the SwTabFrame 47 decides that it wants to move its follow flow line because it fits onto page 1. Then splitting the SwTabFrame again fails, but for this RemoveFollowFlowLine() was called a 2nd time and removed the one on page 3. The result is a layout with content on page 1, nothing on page 2, 3 and again content on page 4. This seems to reoccur every time page 1 is formatted. But the first RemoveFollowFlowLine() was wrong because CalcHeightOfFirstContentLine() returns 0 because lcl_CalcHeightOfFirstContentLine() didn't handle the case of SwSectionFrame containing SwTabFrame. This is similar to commit e024cad7c1365da6a198656c3ca0c32b28938e87 doing the same thing for text frames in section. Change-Id: I23fb4d1d56622039f461bb2d357a9c88db140605 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129800 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--sw/source/core/layout/tabfrm.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 47a71e8bf42c..c9972348dbb5 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -5848,9 +5848,12 @@ static SwTwips lcl_CalcHeightOfFirstContentLine( const SwRowFrame& rSourceLine )
const SwRowFrame* pTmpSourceRow = static_cast<const SwRowFrame*>(pCurrSourceCell->Lower());
nTmpHeight = lcl_CalcHeightOfFirstContentLine( *pTmpSourceRow );
}
- else if ( pTmp->IsTabFrame() )
+ else if (pTmp->IsTabFrame() || (pTmp->IsSctFrame() && pTmp->GetLower() && pTmp->GetLower()->IsTabFrame()))
{
- nTmpHeight = static_cast<const SwTabFrame*>(pTmp)->CalcHeightOfFirstContentLine();
+ SwTabFrame const*const pTabFrame(pTmp->IsTabFrame()
+ ? static_cast<SwTabFrame const*>(pTmp)
+ : static_cast<SwTabFrame const*>(pTmp->GetLower()));
+ nTmpHeight = pTabFrame->CalcHeightOfFirstContentLine();
}
else if (pTmp->IsTextFrame() || (pTmp->IsSctFrame() && pTmp->GetLower() && pTmp->GetLower()->IsTextFrame()))
{