Kaydet (Commit) 78766aaa authored tarafından Miklos Vajna's avatar Miklos Vajna

DOCX import: handle <w:tcPr> directly under <w:style>

Change-Id: I10dfb947bbd9e792c98932608acb2f0987fd8605
üst dc358107
...@@ -367,6 +367,17 @@ DECLARE_OOXMLEXPORT_TEST(testWpsCharColor, "wps-char-color.docx") ...@@ -367,6 +367,17 @@ DECLARE_OOXMLEXPORT_TEST(testWpsCharColor, "wps-char-color.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xShape->getStart(), "CharColor")); CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xShape->getStart(), "CharColor"));
} }
DECLARE_OOXMLEXPORT_TEST(testTableStyleCellBackColor, "table-style-cell-back-color.docx")
{
// The problem was that cell background was white, not green.
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");
// This was 0xffffff.
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), getProperty<sal_Int32>(xCell, "BackColor"));
}
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -574,6 +574,9 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm) ...@@ -574,6 +574,9 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
StyleSheetEntry* pEntry = m_pImpl->m_pCurrentEntry.get(); StyleSheetEntry* pEntry = m_pImpl->m_pCurrentEntry.get();
TableStyleSheetEntry& rTableEntry = dynamic_cast<TableStyleSheetEntry&>(*pEntry); TableStyleSheetEntry& rTableEntry = dynamic_cast<TableStyleSheetEntry&>(*pEntry);
rTableEntry.AppendInteropGrabBag(pTblStylePrHandler->getInteropGrabBag("tcPr")); rTableEntry.AppendInteropGrabBag(pTblStylePrHandler->getInteropGrabBag("tcPr"));
// This is a <w:tcPr> directly under <w:style>, so it affects the whole table.
rTableEntry.pProperties->InsertProps(pTblStylePrHandler->getProperties());
} }
} }
break; break;
......
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