diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx index bae6d4c55015..10e419f7edf9 100644 --- a/oox/source/drawingml/shapegroupcontext.cxx +++ b/oox/source/drawingml/shapegroupcontext.cxx @@ -88,11 +88,19 @@ ContextHandlerRef ShapeGroupContext::onCreateContext( sal_Int32 aElementToken, c case XML_grpSp: // group shape return new ShapeGroupContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GroupShape" ) ) ); case XML_sp: // shape + case XML_wsp: return new ShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.CustomShape" ) ) ); case XML_pic: // CT_Picture return new GraphicShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ) ); case XML_graphicFrame: // CT_GraphicalObjectFrame return new GraphicalObjectFrameContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ), true ); + case XML_cNvGrpSpPr: + break; + case XML_grpSpLocks: + break; + default: + SAL_WARN("oox", "ShapeGroupContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); + break; } return this; diff --git a/oox/source/shape/WpgContext.cxx b/oox/source/shape/WpgContext.cxx index f83fe75ced27..c8ca50508664 100644 --- a/oox/source/shape/WpgContext.cxx +++ b/oox/source/shape/WpgContext.cxx @@ -47,6 +47,12 @@ oox::core::ContextHandlerRef WpgContext::onCreateContext(sal_Int32 nElementToken return new oox::drawingml::ShapeContext(*this, mpShape, pShape); } break; + case XML_grpSp: + { + oox::drawingml::ShapePtr pShape(new oox::drawingml::Shape("com.sun.star.drawing.GroupShape")); + return new oox::drawingml::ShapeGroupContext(*this, mpShape, pShape); + } + break; default: SAL_WARN("oox", "WpgContext::createFastChildContext: unhandled element: " << getBaseToken(nElementToken)); break; diff --git a/sw/qa/extras/ooxmlimport/data/wpg-nested.docx b/sw/qa/extras/ooxmlimport/data/wpg-nested.docx new file mode 100755 index 000000000000..eba2aad0e76c Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/wpg-nested.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 2b271a32a375..24ffb76f5f49 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1555,6 +1555,14 @@ DECLARE_OOXMLIMPORT_TEST(testWpgOnly, "wpg-only.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(548005)), xShape->getPosition().X); } +DECLARE_OOXMLIMPORT_TEST(testWpgNested, "wpg-nested.docx") +{ + uno::Reference xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference xShapeDescriptor(xGroup->getByIndex(0), uno::UNO_QUERY); + // This was a com.sun.star.drawing.CustomShape, due to lack of handling of groupshapes inside groupshapes. + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), xShapeDescriptor->getShapeType()); +} + DECLARE_OOXMLIMPORT_TEST(textboxWpgOnly, "textbox-wpg-only.docx") { uno::Reference xShape = getShape(1);