diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-10-19 13:44:24 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-10-19 18:36:52 +0200 |
commit | 65f508b44ecbc20c8bd5172d1656639f686730ff (patch) | |
tree | b78d709440171b970e0c17f1d0058bed920206b5 /sw/qa | |
parent | 0a0c5a5b0521bea6cb695731d448e62c41ed4c57 (diff) |
tdf#157573 sw floattable: add missing testcase
Fails with commit 626fe9ab5ebebc4ef36e35f4aa597c03a3564d22 (tdf#157573
sw floattable: fix incorrect lack of left margin after table,
2023-10-18) reverted.
Change-Id: I6a3bd69dc109e6df195d00c33118218eeaa00ce5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158179
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/core/text/data/floattable-anchor-left-margin.docx | bin | 0 -> 16806 bytes | |||
-rw-r--r-- | sw/qa/core/text/itrform2.cxx | 23 |
2 files changed, 23 insertions, 0 deletions
diff --git a/sw/qa/core/text/data/floattable-anchor-left-margin.docx b/sw/qa/core/text/data/floattable-anchor-left-margin.docx Binary files differnew file mode 100644 index 000000000000..aa55a0ce3001 --- /dev/null +++ b/sw/qa/core/text/data/floattable-anchor-left-margin.docx diff --git a/sw/qa/core/text/itrform2.cxx b/sw/qa/core/text/itrform2.cxx index 0705069b3038..02cd813ae549 100644 --- a/sw/qa/core/text/itrform2.cxx +++ b/sw/qa/core/text/itrform2.cxx @@ -15,6 +15,7 @@ #include <rootfrm.hxx> #include <sortedobjs.hxx> #include <pagefrm.hxx> +#include <cntfrm.hxx> namespace { @@ -143,6 +144,28 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlHeaderPDFExport) // i.e. not all of header, heading and body text was there on page 2, content was lost. CPPUNIT_ASSERT_EQUAL(3, nTextCount); } + +CPPUNIT_TEST_FIXTURE(Test, testSplitFlyAnchorLeftMargin) +{ + // Given a document with a floating table, anchor para is followed by an other para with a left + // margin: + createSwDoc("floattable-anchor-left-margin.docx"); + + // When laying out that document: + calcLayout(); + + // Then make sure that the left margin of this last paragraph is not lost: + SwDoc* pDoc = getSwDoc(); + SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); + auto pPage = dynamic_cast<SwPageFrame*>(pLayout->Lower()); + CPPUNIT_ASSERT(pPage); + SwContentFrame* pLastPara = pPage->FindLastBodyContent(); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 6480 + // - Actual : 0 + // i.e. the left margin was lost. + CPPUNIT_ASSERT_EQUAL(static_cast<SwTwips>(6480), pLastPara->getFramePrintArea().Left()); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |