summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorAdam Seskunas <adamseskunas@gmail.com>2024-09-04 21:48:44 -0700
committerXisco Fauli <xiscofauli@libreoffice.org>2024-09-06 10:07:51 +0200
commit2bacf24d46350e451db444d72a88a3c407b419f3 (patch)
treee15c9b241d24088f7cfb2b3b612fd8c081566df5 /sw
parentc647937e6066fb911b8ddc5a77b2621d5cb874e4 (diff)
tdf#54862 Add Unit test
Change-Id: I321b8fc30cb814c17b397eb5353fb05fc2b2410c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172878 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ww8export/data/tdf54862.docbin0 -> 16384 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export4.cxx27
2 files changed, 27 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf54862.doc
Binary files 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();