diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-03-02 18:55:50 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-07 09:00:30 +0000 |
commit | 7d265e093bc8078471e87da85c625ef2365a1637 (patch) | |
tree | fe7fab942aa58ea52f1af1feebac47cecfb7f145 /sw/qa/extras | |
parent | f4e6a22c27ef5ce3ecb046ecd88a1dc0b37c7870 (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: If043cfc466879d45141c655f7be1588792f898d3
Reviewed-on: https://gerrit.libreoffice.org/34820
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/34884
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/ww8import/data/tdf106291.doc | bin | 0 -> 24064 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8import/ww8import.cxx | 9 |
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 Binary files differnew file mode 100644 index 000000000000..893004d46118 --- /dev/null +++ b/sw/qa/extras/ww8import/data/tdf106291.doc diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 1df4a6c5bbf8..3220a523740a 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -553,6 +553,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 +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |