sw/qa/extras/ooxmlexport/data/table-style-cell-back-color.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx                       |   11 
++++++++++
 writerfilter/source/dmapper/StyleSheetTable.cxx                |    3 ++
 3 files changed, 14 insertions(+)

New commits:
commit 78766aaa12ae4fae9dd2f3274617ba41de57eefd
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Thu Oct 2 18:00:34 2014 +0200

    DOCX import: handle <w:tcPr> directly under <w:style>
    
    Change-Id: I10dfb947bbd9e792c98932608acb2f0987fd8605

diff --git a/sw/qa/extras/ooxmlexport/data/table-style-cell-back-color.docx 
b/sw/qa/extras/ooxmlexport/data/table-style-cell-back-color.docx
new file mode 100644
index 0000000..f622b9d
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/table-style-cell-back-color.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index c5cfe79..19ea3a1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -367,6 +367,17 @@ DECLARE_OOXMLEXPORT_TEST(testWpsCharColor, 
"wps-char-color.docx")
     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();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index eb22ecf..6fee9e2 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -574,6 +574,9 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
                 StyleSheetEntry* pEntry = m_pImpl->m_pCurrentEntry.get();
                 TableStyleSheetEntry& rTableEntry = 
dynamic_cast<TableStyleSheetEntry&>(*pEntry);
                 
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;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to