oox/qa/unit/data/tdf156902_GlowOnGroup.docx |binary
 oox/qa/unit/shape.cxx                       |   12 ++++++++++++
 oox/source/drawingml/shape.cxx              |    3 ++-
 3 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit e84ae94270f0f0037fa2662a5f2765b37a50c33e
Author:     Regina Henschel <rb.hensc...@t-online.de>
AuthorDate: Sat Oct 7 17:37:46 2023 +0200
Commit:     Regina Henschel <rb.hensc...@t-online.de>
CommitDate: Sat Oct 7 21:52:48 2023 +0200

    tdf#156902 Do not set glow on group shape in import
    
    Currently a group is not able to use glow. But in MS Office it is
    possible. When we try to set glow at the group, we produce an
    exception and no children are imported. So for now the patch prevents
    setting glow.
    
    Change-Id: Ifa7245ebf3c38f8685239c2b62eefccd35aab870
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157679
    Tested-by: Jenkins
    Reviewed-by: Regina Henschel <rb.hensc...@t-online.de>

diff --git a/oox/qa/unit/data/tdf156902_GlowOnGroup.docx 
b/oox/qa/unit/data/tdf156902_GlowOnGroup.docx
new file mode 100644
index 000000000000..0c176eefa025
Binary files /dev/null and b/oox/qa/unit/data/tdf156902_GlowOnGroup.docx differ
diff --git a/oox/qa/unit/shape.cxx b/oox/qa/unit/shape.cxx
index 565ac39b52ad..5033ed660e30 100644
--- a/oox/qa/unit/shape.cxx
+++ b/oox/qa/unit/shape.cxx
@@ -817,6 +817,18 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWordArtDefaultColor)
     CPPUNIT_ASSERT_EQUAL(uno::Any(Color(3, 74, 144)),
                          xShapeProps->getPropertyValue(u"FillColor"_ustr));
 }
+
+CPPUNIT_TEST_FIXTURE(OoxShapeTest, testGlowOnGroup)
+{
+    // The document contains a group of two shapes. A glow-effect is set on 
the group.
+    // Without the fix, the children of the group were not imported at all.
+    loadFromURL(u"tdf156902_GlowOnGroup.docx");
+    uno::Reference<drawing::XDrawPagesSupplier> 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<drawing::XDrawPage> 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+                                                 uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xGroup(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xGroup->getCount());
+}
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 03a22dc441b4..f48b4d856a4a 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1914,7 +1914,8 @@ Reference< XShape > const & Shape::createAndInsert(
         }
 
         // Set glow effect properties
-        if ( aEffectProperties.maGlow.moGlowRad.has_value() )
+        if (aEffectProperties.maGlow.moGlowRad.has_value()
+            && aServiceName != "com.sun.star.drawing.GroupShape")
         {
             uno::Reference<beans::XPropertySet> propertySet (mxShape, 
uno::UNO_QUERY);
             propertySet->setPropertyValue("GlowEffectRadius", 
Any(convertEmuToHmm(aEffectProperties.maGlow.moGlowRad.value())));

Reply via email to