sw/qa/core/text/frmform.cxx | 9 +++++++++ sw/source/core/layout/tabfrm.cxx | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-)
New commits: commit 711979dff99fb1557bd1e8201135dc587eadd665 Author: Mike Kaganski <[email protected]> AuthorDate: Wed Jan 14 08:49:32 2026 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Thu Jan 15 08:59:07 2026 +0100 tdf#170337: find the correct master containing the anchored objects Was this way since commit f66ac0bacb9a57228dfd3b24b347b985376b63df (INTEGRATION: CWS swqbugfixes09 (1.67.38); FILE MERGED, 2004-11-16). Change-Id: I7feeeb2d77849ef626b6ed7ce6385c10cae02c6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197240 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197251 diff --git a/sw/qa/core/text/frmform.cxx b/sw/qa/core/text/frmform.cxx index b73497f42b33..3ad8ab305ad1 100644 --- a/sw/qa/core/text/frmform.cxx +++ b/sw/qa/core/text/frmform.cxx @@ -148,6 +148,15 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableBadFlyPos) CPPUNIT_ASSERT(pPage4); CPPUNIT_ASSERT(pPage4->GetSortedObjs()); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pPage4->GetSortedObjs()->size()); + + // tdf#170337: Make sure that page 4's toplevel table has the correct height (it was 517, not + // taking inner floating table height into account): + auto pBody = pPage4->FindBodyCont(); + CPPUNIT_ASSERT(pBody); + auto pTable = pBody->GetLower(); + CPPUNIT_ASSERT(pTable); + CPPUNIT_ASSERT(pTable->IsTabFrame()); + CPPUNIT_ASSERT_EQUAL(tools::Long(3658), pTable->getFrameArea().Height()); } CPPUNIT_TEST_FIXTURE(Test, testFullPageShapeWrap) diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 68a6f688b8c5..eb7d49360c8f 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -4800,7 +4800,7 @@ static tools::Long CalcHeightWithFlys_Impl(const SwFrame* pTmp, const SwFrame* p bool bIsFollow( false ); if ( pTmp->IsTextFrame() && static_cast<const SwTextFrame*>(pTmp)->IsFollow() ) { - const SwFrame* pMaster; + const SwTextFrame* pMaster; // #i46450# Master does not necessarily have // to exist if this function is called from JoinFrame() -> // Cut() -> Shrink() @@ -4814,6 +4814,11 @@ static tools::Long CalcHeightWithFlys_Impl(const SwFrame* pTmp, const SwFrame* p if ( pMaster ) { + while (pMaster->IsFollow()) + { + pMaster = pMaster->FindMaster(); + assert(pMaster); + } pObjs = pMaster->GetDrawObjs(); bIsFollow = true; } commit 383583559868660e83cd651c2977186f69bae0c3 Author: Mike Kaganski <[email protected]> AuthorDate: Wed Jan 14 07:09:06 2026 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Thu Jan 15 08:58:59 2026 +0100 pMaster is already the object we need - avoid finding it again Change-Id: I1d719631053a8335c49cc55e4c98e602732e1117 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197231 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197250 diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index bf525e7c313c..68a6f688b8c5 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -4814,7 +4814,7 @@ static tools::Long CalcHeightWithFlys_Impl(const SwFrame* pTmp, const SwFrame* p if ( pMaster ) { - pObjs = static_cast<const SwTextFrame*>(pTmp)->FindMaster()->GetDrawObjs(); + pObjs = pMaster->GetDrawObjs(); bIsFollow = true; } }
