sw/qa/extras/ww8export/data/tdf54862.doc |binary sw/qa/extras/ww8export/ww8export4.cxx | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+)
New commits: commit 2bacf24d46350e451db444d72a88a3c407b419f3 Author: Adam Seskunas <adamsesku...@gmail.com> AuthorDate: Wed Sep 4 21:48:44 2024 -0700 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Sep 6 10:07:51 2024 +0200 tdf#54862 Add Unit test Change-Id: I321b8fc30cb814c17b397eb5353fb05fc2b2410c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172878 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/sw/qa/extras/ww8export/data/tdf54862.doc b/sw/qa/extras/ww8export/data/tdf54862.doc new file mode 100644 index 000000000000..3f04d18adf15 Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf54862.doc differ diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx index 512b24667d22..59a682a347f9 100644 --- a/sw/qa/extras/ww8export/ww8export4.cxx +++ b/sw/qa/extras/ww8export/ww8export4.cxx @@ -612,6 +612,33 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf120629) // i.e. numbering type gets changed to ARABIC, should stay the same CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(56), numFormat_after); } + +CPPUNIT_TEST_FIXTURE(Test, testTdf54862) +{ + createSwDoc("tdf54862.doc"); + auto verify = [this]() { + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount()); + + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + + sal_Int32 nCellA2Height = getXPath(pXmlDoc, "//tab/row[1]/cell[2]/infos/bounds"_ostr, "height"_ostr).toInt32(); + sal_Int32 nCellB4Height = getXPath(pXmlDoc, "//tab/row[4]/cell[2]/infos/bounds"_ostr, "height"_ostr).toInt32(); + + // Without the fix in place this is this fails with: + // Expected: 1269, 9021 + // Actual: 562, 623 + // i.e. Cells A2 and B4 are not vertically merged, making them the wrong height + CPPUNIT_ASSERT_EQUAL(sal_Int32(1269), nCellA2Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(9021), nCellB4Height); + }; + + verify(); + saveAndReload(mpFilter); + verify(); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT();