summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ww8import
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-03-27 17:35:45 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-03-27 18:29:46 +0000
commit59af9cbbccee600408c89e872d548d153523ab1f (patch)
tree66323e79644cb3dcdc03e73876078c0ec7f8c66e /sw/qa/extras/ww8import
parent3632df3df311ec709e86544329cd0a8a87614c70 (diff)
tdf#106799 WW8: Accept TTP Mark without Cell Mark
Paragraph mark of inner table (0x0D) sometimes has sprmPFInnerTtp, but no sprmPFInnerTableCell. This still counts as cell end (at least, MS Word treats it that way). Unit test included. Change-Id: I5589cdd486c03ca4567d61882826cc7c245a40c9 Reviewed-on: https://gerrit.libreoffice.org/35763 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/qa/extras/ww8import')
-rw-r--r--sw/qa/extras/ww8import/data/tdf106799.docbin0 -> 11264 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx15
2 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8import/data/tdf106799.doc b/sw/qa/extras/ww8import/data/tdf106799.doc
new file mode 100644
index 000000000000..0637e8cce692
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/tdf106799.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index c50ab96722f8..1a2ec45af6fb 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -108,6 +108,21 @@ DECLARE_WW8IMPORT_TEST( testTdf105570, "tdf105570.doc" )
CPPUNIT_ASSERT_EQUAL( sal_uInt16(0), pTableNd->GetTable().GetRowsToRepeat() );
}
+DECLARE_WW8IMPORT_TEST(testTdf106799, "tdf106799.doc")
+{
+ sal_Int32 nCellWidths[3][4] = { { 9530, 0, 0, 0 },{ 2382, 2382, 2382, 2384 },{ 2382, 2382, 2382, 2384 } };
+ sal_Int32 nCellTxtLns[3][4] = { { 1, 0, 0, 0 },{ 1, 0, 0, 0},{ 1, 1, 1, 1 } };
+ // Table was distorted because of missing sprmPFInnerTableCell at paragraph marks (0x0D) with sprmPFInnerTtp
+ for (sal_Int32 nRow : { 0, 1, 2 })
+ for (sal_Int32 nCell : { 0, 1, 2, 3 })
+ {
+ OString cellXPath("/root/page/body/tab/row/cell/tab/row[" + OString::number(nRow+1) + "]/cell[" + OString::number(nCell+1) + "]/");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(cellXPath.getStr(), nCellWidths[nRow][nCell], parseDump(cellXPath + "infos/bounds", "width").toInt32());
+ if (nCellTxtLns[nRow][nCell] != 0)
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(cellXPath.getStr(), nCellTxtLns[nRow][nCell], parseDump(cellXPath + "txt/Text", "nLength").toInt32());
+ }
+}
+
// tests should only be added to ww8IMPORT *if* they fail round-tripping in ww8EXPORT
CPPUNIT_PLUGIN_IMPLEMENT();