From 1d1748d143ab4270a2ca1b5117852b1b1bb4c526 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 30 Aug 2016 09:14:47 +0200 Subject: Related: tdf#44986 DOCX import: handle w:gridAfter by faking cells This is similar to the w:gridBefore handling code introduced in commit cf33af732ed0d3d553bb74636e3b14c55d44c153 (handle w:gridBefore by faking cells (fdo#38414), 2014-04-23), except that the fake cells here are inserted after the real ones, not before. Change-Id: I4c03bd49e52016a58e0e002ae85dede6a96e5f55 Reviewed-on: https://gerrit.libreoffice.org/28487 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- sw/qa/extras/ooxmlexport/data/tdf44986.docx | Bin 0 -> 14593 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 10 ++++++++++ 2 files changed, 10 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf44986.docx (limited to 'sw') diff --git a/sw/qa/extras/ooxmlexport/data/tdf44986.docx b/sw/qa/extras/ooxmlexport/data/tdf44986.docx new file mode 100644 index 000000000000..7859ab4020b4 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf44986.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index cb20af147ff1..90cef9f800f8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -821,6 +822,15 @@ DECLARE_OOXMLEXPORT_TEST(testTDF99434, "protectedform.docx") CPPUNIT_ASSERT(bProt); } +DECLARE_OOXMLEXPORT_TEST(testTdf44986, "tdf44986.docx") +{ + // Check that the table at the second paragraph. + uno::Reference xTable(getParagraphOrTable(2), uno::UNO_QUERY); + uno::Reference xTableRows(xTable->getRows(), uno::UNO_QUERY); + // Check the first row of the table, it should have two cells (one separator). + // This was 0: the first row had no separators, so it had only one cell, which was too wide. + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< uno::Sequence >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); +} CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit