[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - oox/qa oox/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 11 16:35:05 UTC 2020


 oox/qa/unit/data/table-shadow.pptx          |binary
 oox/qa/unit/drawingml.cxx                   |   19 +++++++++++++++++++
 oox/source/drawingml/table/tablecontext.cxx |    5 +++++
 3 files changed, 24 insertions(+)

New commits:
commit b200bf2b33fd525b405c4d6dfb3eb4f6bf5f6c1f
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Dec 10 13:57:58 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Dec 11 17:34:33 2020 +0100

    tdf#129961 oox: add PPTX import for table shadow as direct format
    
    PPTX export and ODP filter is still missing.
    
    (cherry picked from commit b273e82aaa916b0f6198097dc32740faced73741)
    
    Change-Id: I451b334ada80d9d228b7d7f36b5f26473b575ef6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107595
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/oox/qa/unit/data/table-shadow.pptx b/oox/qa/unit/data/table-shadow.pptx
new file mode 100644
index 000000000000..3247404cbc48
Binary files /dev/null and b/oox/qa/unit/data/table-shadow.pptx differ
diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx
index f17d1050fe85..b86e5ad2e665 100644
--- a/oox/qa/unit/drawingml.cxx
+++ b/oox/qa/unit/drawingml.cxx
@@ -299,6 +299,25 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testCameraRotationRevolution)
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(27000), nRotateAngle1);
 }
 
+CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTableShadow)
+{
+    OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "table-shadow.pptx";
+    load(aURL);
+    uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(getComponent(), uno::UNO_QUERY);
+    uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+                                                 uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+    bool bShadow = false;
+    CPPUNIT_ASSERT(xShape->getPropertyValue("Shadow") >>= bShadow);
+
+    // Without the accompanying fix in place, this test would have failed, because shadow on a table
+    // was lost on import.
+    CPPUNIT_ASSERT(bShadow);
+    sal_Int32 nColor = 0;
+    CPPUNIT_ASSERT(xShape->getPropertyValue("ShadowColor") >>= nColor);
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xff0000), nColor);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/table/tablecontext.cxx b/oox/source/drawingml/table/tablecontext.cxx
index 90191f615d4d..a48114a82402 100644
--- a/oox/source/drawingml/table/tablecontext.cxx
+++ b/oox/source/drawingml/table/tablecontext.cxx
@@ -23,6 +23,7 @@
 #include <drawingml/table/tableproperties.hxx>
 #include <drawingml/table/tablestylecontext.hxx>
 #include <drawingml/table/tablerowcontext.hxx>
+#include <drawingml/effectpropertiescontext.hxx>
 #include <oox/token/namespaces.hxx>
 #include <oox/token/tokens.hxx>
 
@@ -65,6 +66,10 @@ TableContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& r
             rTableStyle.reset( new TableStyle() );
             return new TableStyleContext( *this, rAttribs, *rTableStyle );
         }
+    case A_TOKEN( effectLst ):  // CT_EffectList
+        {
+            return new EffectPropertiesContext(*this, mpShapePtr->getEffectProperties());
+        }
     case A_TOKEN( tableStyleId ):       // ST_Guid
         return new oox::drawingml::GuidContext( *this, mrTableProperties.getStyleId() );
 


More information about the Libreoffice-commits mailing list