summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-02-12 09:45:59 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-12 13:03:52 +0000
commit542988856011fad099cfbe6ba93305fb6a4e0214 (patch)
tree8cd62eeed37db6c62a453ac031c47509bff631ac /oox
parent6f3fd680ea3769384a98fa620532a64d12fede4a (diff)
coverity#1103671 Unchecked dynamic_cast
Change-Id: I7a0e483550b0f7bbe91f20acde5a09ca43eb02c2
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())