From 6e57eb3aebb41b504d51ddb8f5cfd2d44ca7434e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 10 Jun 2014 15:30:02 +0100 Subject: coverity#1169822 Unchecked dynamic_cast Change-Id: If68af1250b285c82539ecf08c713753dc5e74217 --- chart2/source/view/main/DummyXShape.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx index a90ef5810833..12d93678db3a 100644 --- a/chart2/source/view/main/DummyXShape.cxx +++ b/chart2/source/view/main/DummyXShape.cxx @@ -1081,11 +1081,10 @@ void DummyXShapes::release() void SAL_CALL DummyXShapes::add( const uno::Reference< drawing::XShape>& xShape ) throw(uno::RuntimeException, std::exception) { - DummyXShape* pChild = dynamic_cast(xShape.get()); - assert(pChild); + DummyXShape& rChild = dynamic_cast(*xShape.get()); maUNOShapes.push_back(xShape); - pChild->setParent(static_cast< ::cppu::OWeakObject* >( this )); - maShapes.push_back(pChild); + rChild.setParent(static_cast< ::cppu::OWeakObject* >( this )); + maShapes.push_back(&rChild); } void SAL_CALL DummyXShapes::remove( const uno::Reference< drawing::XShape>& xShape ) -- cgit