summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-03-02 18:55:50 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-03-03 13:40:23 +0000
commitbb2a3df2d5b5a01aa58fb3567686e50762186036 (patch)
tree97a87c1008d200e4e3b2312313e7cb5f419dc96c /sw/qa
parenta51b7a1c3a7e7cf7b0c733e1dec40288278c1884 (diff)
tdf#106291: WW8 import: Properly treat column spans
Previous code unconditionally treated all cells in merge groups as rows span, thus in some conditions it merged incorrectly when there were cells from same row. The fix is inspired by SwTable::PrepareMerge(). Also, fixed improper adjustment of too narrow cells in WW8TabDesc::CalcDefaults(), which also happens in files where column spans are represented by spanned 1-twip-wide cells. Unit test included. Change-Id: I6c3803635f006dd396805d6847daa4d80c97cad4 Reviewed-on: https://gerrit.libreoffice.org/34820 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ww8import/data/tdf106291.docbin0 -> 24064 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx9
2 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8import/data/tdf106291.doc b/sw/qa/extras/ww8import/data/tdf106291.doc
new file mode 100644
index 000000000000..893004d46118
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/tdf106291.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index c7f488fc2346..79c323f2ccde 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -65,6 +65,15 @@ DECLARE_WW8IMPORT_TEST(testTdf99120, "tdf99120.doc")
CPPUNIT_ASSERT_EQUAL(OUString("Section 2, even."), parseDump("/root/page[4]/header/txt/text()"));
}
+DECLARE_WW8IMPORT_TEST(testTdf106291, "tdf106291.doc")
+{
+ // Table cell was merged vertically instead of horizontally -> had incorrect dimensions
+ OUString cellWidth = parseDump("/root/page[1]/body/tab/row/cell[1]/infos/bounds", "width");
+ OUString cellHeight = parseDump("/root/page[1]/body/tab/row/cell[1]/infos/bounds", "height");
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(8660), cellWidth.toInt32());
+ CPPUNIT_ASSERT(cellHeight.toInt32() > 200); // height might depend on font size
+}
+
// tests should only be added to ww8IMPORT *if* they fail round-tripping in ww8EXPORT
CPPUNIT_PLUGIN_IMPLEMENT();