Kaydet (Commit) d239bf6d authored tarafından Szymon Kłos's avatar Szymon Kłos

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.

Change-Id: I7f203b8f3831b86ba8de33dc57de227b3029c6d9
Reviewed-on: https://gerrit.libreoffice.org/41255Reviewed-by: 's avatarSzymon Kłos <szymon.klos@collabora.com>
Tested-by: 's avatarSzymon Kłos <szymon.klos@collabora.com>
üst 93904913
...@@ -917,6 +917,25 @@ DECLARE_OOXMLEXPORT_TEST(testActiveXControlAlign, "activex_control_align.odt") ...@@ -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")); getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:pict/v:shape", "id"));
} }
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(); CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -278,7 +278,7 @@ TablePropertyMapPtr CellColorHandler::getProperties() ...@@ -278,7 +278,7 @@ TablePropertyMapPtr CellColorHandler::getProperties()
pPropertyMap->Insert(PROP_FILL_COLOR, uno::makeAny(nApplyColor)); pPropertyMap->Insert(PROP_FILL_COLOR, uno::makeAny(nApplyColor));
} }
else else if (nWW8BrushStyle || !m_bAutoFillColor)
pPropertyMap->Insert( m_OutputFormat == Form ? PROP_BACK_COLOR pPropertyMap->Insert( m_OutputFormat == Form ? PROP_BACK_COLOR
: PROP_CHAR_BACK_COLOR, uno::makeAny( nApplyColor )); : PROP_CHAR_BACK_COLOR, uno::makeAny( nApplyColor ));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment