From d239bf6d79e93f650a4241fcd2da0cb77c9cb95b Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Thu, 17 Aug 2017 12:18:23 +0200 Subject: tdf#109184 auto cell color should be transparent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't add color to the property map if is set to auto. In this case white color was assumed and tables were white instead of transparent. Change-Id: I7f203b8f3831b86ba8de33dc57de227b3029c6d9 Reviewed-on: https://gerrit.libreoffice.org/41255 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos --- sw/qa/extras/ooxmlexport/data/tdf109184.docx | Bin 0 -> 20720 bytes sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 sw/qa/extras/ooxmlexport/data/tdf109184.docx (limited to 'sw') diff --git a/sw/qa/extras/ooxmlexport/data/tdf109184.docx b/sw/qa/extras/ooxmlexport/data/tdf109184.docx new file mode 100755 index 000000000000..36e5232ae671 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf109184.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 9821751bd668..0f5e9c6320e5 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -917,6 +917,25 @@ DECLARE_OOXMLEXPORT_TEST(testActiveXControlAlign, "activex_control_align.odt") getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:pict/v:shape", "id")); } +DECLARE_OOXMLEXPORT_TEST(testTdf109184, "tdf109184.docx") +{ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); + + // Before table background color was white, should be transparent (auto). + uno::Reference xCell1(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast(-1), getProperty(xCell1, "BackColor")); + + // Cell with auto color but with 15% fill, shouldn't be transparent. + uno::Reference xCell2(xTable->getCellByName("B1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast(0xd8d8d8), getProperty(xCell2, "BackColor")); + + // Cell with color defined (red). + uno::Reference xCell3(xTable->getCellByName("A2"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast(0xff0000), getProperty(xCell3, "BackColor")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit