summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
Diffstat (limited to 'oox')
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index eeb70ae76943..bd983e3df714 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -452,13 +452,16 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException)
}
else if (mxChartShapeContext.is())
{
- basegfx::B2DHomMatrix aMatrix;
ChartGraphicDataContext* pChartGraphicDataContext = dynamic_cast<ChartGraphicDataContext*>(mxChartShapeContext.get());
- oox::drawingml::ShapePtr pShapePtr( pChartGraphicDataContext->getShape());
- // See SwXTextDocument::createInstance(), ODF import uses the same hack.
- pShapePtr->setServiceName("com.sun.star.drawing.temporaryForXMLImportOLE2Shape");
- pShapePtr->addShape( *mxFilterBase, mpThemePtr.get(), xShapes, aMatrix, pShapePtr->getFillProperties() );
- xResult = pShapePtr->getXShape();
+ if (pChartGraphicDataContext)
+ {
+ basegfx::B2DHomMatrix aMatrix;
+ oox::drawingml::ShapePtr xShapePtr( pChartGraphicDataContext->getShape());
+ // See SwXTextDocument::createInstance(), ODF import uses the same hack.
+ xShapePtr->setServiceName("com.sun.star.drawing.temporaryForXMLImportOLE2Shape");
+ xShapePtr->addShape( *mxFilterBase, mpThemePtr.get(), xShapes, aMatrix, xShapePtr->getFillProperties() );
+ xResult = xShapePtr->getXShape();
+ }
mxChartShapeContext.clear();
}
else if (mxWpsContext.is())