diff options
-rwxr-xr-x | sw/qa/extras/ooxmlexport/data/tdf109184.docx | bin | 0 -> 20720 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 19 | ||||
-rw-r--r-- | writerfilter/source/dmapper/CellColorHandler.cxx | 2 |
3 files changed, 20 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf109184.docx b/sw/qa/extras/ooxmlexport/data/tdf109184.docx Binary files differnew file mode 100755 index 000000000000..36e5232ae671 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf109184.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index f281144d70e2..a22ab5d7e13f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -636,6 +636,25 @@ DECLARE_OOXMLEXPORT_TEST(tdf112169, "tdf112169.odt") // LO crashed while export because of chararacter background color handling } +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: */ diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx b/writerfilter/source/dmapper/CellColorHandler.cxx index 58c2a35457cc..a1cfa2f3cbd1 100644 --- a/writerfilter/source/dmapper/CellColorHandler.cxx +++ b/writerfilter/source/dmapper/CellColorHandler.cxx @@ -281,7 +281,7 @@ TablePropertyMapPtr CellColorHandler::getProperties() pPropertyMap->Insert(PROP_FILL_COLOR, uno::makeAny(nApplyColor)); } - else + else if (nWW8BrushStyle || !m_bAutoFillColor) pPropertyMap->Insert( m_OutputFormat == Form ? PROP_BACK_COLOR : PROP_CHAR_BACK_COLOR, uno::makeAny( nApplyColor )); |