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 b273e82aaa916b0f6198097dc32740faced73741 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Dec 10 13:57:58 2020 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Dec 10 15:27:09 2020 +0100 tdf#129961 oox: add PPTX import for table shadow as direct format PPTX export and ODP filter is still missing. Change-Id: I451b334ada80d9d228b7d7f36b5f26473b575ef6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107529 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins 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 0dd0f0991154..d666b3d332a7 100644 --- a/oox/qa/unit/drawingml.cxx +++ b/oox/qa/unit/drawingml.cxx @@ -291,6 +291,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 bbfc94845369..84e80dccd710 100644 --- a/oox/source/drawingml/table/tablecontext.cxx +++ b/oox/source/drawingml/table/tablecontext.cxx @@ -24,6 +24,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> @@ -66,6 +67,10 @@ TableContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& r rTableStyle = std::make_shared<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() ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits