summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-08-17 14:35:51 +0300
committerAndras Timar <andras.timar@collabora.com>2018-08-29 11:15:23 +0200
commit9c016e2aed1ceb3a1248a9887c41ab48c6b47c51 (patch)
treed98cc61ad57a55651606893387ea4e1fea3335f2 /sw/qa
parenta5599938fedc8525e1142b76a386dc2675fc3250 (diff)
tdf#116436 docx export: add missing table background fill
MS formats only have support for Table and Cell fill. Interestingly, MS Word doesn't let the cells inherit from the Table fill setting (even though LO docx import currently does), so that value also needs to be written out into every cell. Change-Id: Ib49fddf52758ff641428de747ea290d1fcb894f3 Reviewed-on: https://gerrit.libreoffice.org/59260 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 8cc753d54ad1834709c5802115580adf65def89e) Reviewed-on: https://gerrit.libreoffice.org/59286 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit e7d3e0b101ff25bb7edd49df61e330ccb4b75a24)
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf116436_rowFill.odtbin0 -> 10835 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport11.cxx9
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport5.cxx7
3 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf116436_rowFill.odt b/sw/qa/extras/ooxmlexport/data/tdf116436_rowFill.odt
new file mode 100644
index 000000000000..45f4a1c54b02
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf116436_rowFill.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 131953eb9723..f60a3167efbd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -48,6 +48,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92524_autoColor, "tdf92524_autoColor.doc")
CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<sal_uInt32>(getParagraph(1), "ParaBackColor"));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf116436_rowFill, "tdf116436_rowFill.odt")
+{
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<table::XCell> xCell = xTable->getCellByName("A1");
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0xF8DF7C), getProperty<sal_Int32>(xCell, "BackColor"));
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf46938_clearTabStop, "tdf46938_clearTabStop.docx")
{
// Number of tabstops should be zero, overriding the one in the style
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 9823f4e13de0..22ab51aff521 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -999,6 +999,13 @@ DECLARE_OOXMLEXPORT_TEST(testOO47778_2, "ooo47778-4.odt")
{
if (xmlDocPtr pXmlDoc = parseExport("word/document.xml"))
assertXPathContent(pXmlDoc, "(//w:t)[4]", "c");
+
+ // tdf116436: The problem was that the table background was undefined, not white.
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<table::XCell> xCell = xTable->getCellByName("A1");
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xCell, "BackColor"));
}
DECLARE_OOXMLEXPORT_TEST(testOO67471, "ooo67471-2.odt")