diff options
Diffstat (limited to 'oox/source/drawingml/diagram/layoutnodecontext.cxx')
-rw-r--r-- | oox/source/drawingml/diagram/layoutnodecontext.cxx | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/oox/source/drawingml/diagram/layoutnodecontext.cxx b/oox/source/drawingml/diagram/layoutnodecontext.cxx index 5d66de142c96..715e94d72eab 100644 --- a/oox/source/drawingml/diagram/layoutnodecontext.cxx +++ b/oox/source/drawingml/diagram/layoutnodecontext.cxx @@ -246,31 +246,23 @@ LayoutNodeContext::onCreateContext( ::sal_Int32 aElement, } case DGM_TOKEN( shape ): { - LayoutNodePtr pNode(std::dynamic_pointer_cast<LayoutNode>(mpNode)); - if( pNode ) - { - ShapePtr pShape; - - if( rAttribs.hasAttribute( XML_type ) ) - { - pShape.reset( new Shape("com.sun.star.drawing.CustomShape") ); - const sal_Int32 nType(rAttribs.getToken( XML_type, XML_obj )); - pShape->setSubType( nType ); - pShape->getCustomShapeProperties()->setShapePresetType( nType ); - } - else - { - pShape.reset( new Shape("com.sun.star.drawing.GroupShape") ); - } + ShapePtr pShape; - pNode->setShapeTemplate( pShape ); - return new ShapeContext( *this, ShapePtr(), pShape ); + if( rAttribs.hasAttribute( XML_type ) ) + { + pShape.reset( new Shape("com.sun.star.drawing.CustomShape") ); + const sal_Int32 nType(rAttribs.getToken( XML_type, XML_obj )); + pShape->setSubType( nType ); + pShape->getCustomShapeProperties()->setShapePresetType( nType ); } else { - SAL_WARN("oox", "OOX: encountered a shape in a non layoutNode context" ); + pShape.reset( new Shape("com.sun.star.drawing.GroupShape") ); } - break; + + ShapeAtomPtr pAtom( new ShapeAtom(pShape) ); + mpNode->addChild( pAtom ); + return new ShapeContext( *this, ShapePtr(), pShape ); } case DGM_TOKEN( extLst ): return nullptr; |