summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-08-17 12:18:23 +0200
committerAndras Timar <andras.timar@collabora.com>2017-08-25 15:43:21 +0200
commit729a4ae3b859d97376b7c7179de5069683b45169 (patch)
tree02ffd4a4ade40012af47004507a0dcebdf46f1dc /sw/qa
parent9b40796fd3e8f724d69a343e0444220b69a6d6ab (diff)
tdf#109184 auto cell color should be transparent
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. Reviewed-on: https://gerrit.libreoffice.org/41255 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit d239bf6d79e93f650a4241fcd2da0cb77c9cb95b) Change-Id: I7f203b8f3831b86ba8de33dc57de227b3029c6d9 Reviewed-on: https://gerrit.libreoffice.org/41451 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf109184.docxbin0 -> 20720 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx19
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf109184.docx b/sw/qa/extras/ooxmlexport/data/tdf109184.docx
new file mode 100644
index 000000000000..36e5232ae671
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf109184.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 0a0ea9f3804e..9b98417a361b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -527,6 +527,25 @@ DECLARE_OOXMLEXPORT_TEST(testActiveXControlAtRunEnd, "activex_control_at_run_end
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER,getProperty<text::TextContentAnchorType>(xPropertySet2,"AnchorType"));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf109184, "tdf109184.docx")
+{
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+
+ // Before table background color was white, should be transparent (auto).
+ uno::Reference<text::XTextRange> xCell1(xTable->getCellByName("A1"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), getProperty<sal_Int32>(xCell1, "BackColor"));
+
+ // Cell with auto color but with 15% fill, shouldn't be transparent.
+ uno::Reference<text::XTextRange> xCell2(xTable->getCellByName("B1"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xd8d8d8), getProperty<sal_Int32>(xCell2, "BackColor"));
+
+ // Cell with color defined (red).
+ uno::Reference<text::XTextRange> xCell3(xTable->getCellByName("A2"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xff0000), getProperty<sal_Int32>(xCell3, "BackColor"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */