diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:29:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:29:03 +0000 |
commit | 5a7157d319477830426797532e02ac39d3b859f4 (patch) | |
tree | 3773f5ce209bee14a5643e98672e0f3828c71434 /sw/qa/core/layout | |
parent | Releasing progress-linux version 4:24.2.0-3~progress7.99u1. (diff) | |
download | libreoffice-5a7157d319477830426797532e02ac39d3b859f4.tar.xz libreoffice-5a7157d319477830426797532e02ac39d3b859f4.zip |
Merging upstream version 4:24.2.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sw/qa/core/layout')
-rw-r--r-- | sw/qa/core/layout/data/floattable-not-wrapped-by-table.docx | bin | 0 -> 12994 bytes | |||
-rw-r--r-- | sw/qa/core/layout/tabfrm.cxx | 22 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/core/layout/data/floattable-not-wrapped-by-table.docx b/sw/qa/core/layout/data/floattable-not-wrapped-by-table.docx Binary files differnew file mode 100644 index 0000000000..2c255148d3 --- /dev/null +++ b/sw/qa/core/layout/data/floattable-not-wrapped-by-table.docx diff --git a/sw/qa/core/layout/tabfrm.cxx b/sw/qa/core/layout/tabfrm.cxx index 9357fc2df1..61b1a25109 100644 --- a/sw/qa/core/layout/tabfrm.cxx +++ b/sw/qa/core/layout/tabfrm.cxx @@ -199,6 +199,28 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyWrappedByTable) // i.e. the inline table was under the floating one, not on the right of it. CPPUNIT_ASSERT_LESS(nFloatingBottom, nInlineTop); } + +CPPUNIT_TEST_FIXTURE(Test, testInlineTableThenSplitFly) +{ + // Given a document with a floating table ("right") and an inline table ("left"): + // When laying out the document: + createSwDoc("floattable-not-wrapped-by-table.docx"); + + // Then make sure the inline table is on the left (small negative offset): + SwDoc* pDoc = getSwDoc(); + SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); + auto pPage = pLayout->Lower()->DynCastPageFrame(); + CPPUNIT_ASSERT(pPage); + SwFrame* pBody = pPage->FindBodyCont(); + auto pTab = pBody->GetLower()->GetNext()->DynCastTabFrame(); + SwTwips nInlineLeft = pTab->getFramePrintArea().Left(); + // Without the accompanying fix in place, this test would have failed with: + // - Expected less than: 0 + // - Actual : 6958 + // i.e. "left" was on the right, its horizontal margin was not a small negative value but a + // large positive one. + CPPUNIT_ASSERT_LESS(static_cast<SwTwips>(0), nInlineLeft); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |