summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-02-10 19:43:08 +0100
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2022-02-21 11:39:15 +0100
commit21cbd2cb9c1bf86728edf351f5e350d923eb15b2 (patch)
tree6f2afc35334c572020b065c911ab8be191b8042f
parentd2f374ea109f818c45c4e8f73df4c33710455431 (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> (cherry picked from commit b4271e028686d729189afc5e42a9c310f81144f3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129828 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 60811f97c753360393f52aa747837db15a722162)
-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 c00a7294e8c3..4f2c504cc8e5 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -5581,9 +5581,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()))
{