summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-01-24 15:25:36 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-01-25 12:57:32 +0100
commitd91236ad8fc74e1ec15c39b90660717ebab013ac (patch)
tree953d4e1729b6ba729e6e91bf62378934ae0a7d67 /sw/qa
parentda7c0245bf0fd6cca7a589f7cf7e0b39412aa577 (diff)
tdf#115180: take table base width into account
Change-Id: I4238e6c757499e289193efa3498fb1e68d5f3e9c Reviewed-on: https://gerrit.libreoffice.org/48501 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtfexport/data/tdf115180.docxbin0 -> 10151 bytes
-rw-r--r--sw/qa/extras/rtfexport/rtfexport3.cxx15
2 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf115180.docx b/sw/qa/extras/rtfexport/data/tdf115180.docx
new file mode 100644
index 000000000000..2e41c7a24a1d
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf115180.docx
Binary files differ
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index c8941ed26633..870650ab9b88 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -80,6 +80,21 @@ DECLARE_RTFEXPORT_TEST(testTdf114333, "tdf114333.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int32(8498), getProperty<sal_Int32>(xTable, "Width"));
}
+DECLARE_RTFEXPORT_TEST(testTdf115180, "tdf115180.docx")
+{
+ // On export to RTF, column separator positions were written without taking base width
+ // into account and then arrived huge, ~64000, which resulted in wrong table and cell widths
+
+ sal_Int32 rowWidth = parseDump("/root/page/body/tab/row/infos/bounds", "width").toInt32();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Row width", sal_Int32(9360), rowWidth);
+ sal_Int32 cell1Width
+ = parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "width").toInt32();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("First cell width", sal_Int32(9142), cell1Width);
+ sal_Int32 cell2Width
+ = parseDump("/root/page/body/tab/row/cell[2]/infos/bounds", "width").toInt32();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("First cell width", sal_Int32(218), cell2Width);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */