oox/inc/oox/vml/vmlshapecontainer.hxx | 2 +- oox/source/shape/ShapeContextHandler.cxx | 2 +- oox/source/vml/vmlshapecontainer.cxx | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)
New commits: commit 78ef70018013f4f02fdecaac8dbf2ab51ad247d2 Author: LuboÅ¡ LuÅák <[email protected]> Date: Tue Jun 19 15:08:21 2012 +0200 avoid a crash because of shared_ptr ownership Change-Id: Ib12a80d9806d995d161d4ee71fa2b7e69eb944ea Signed-off-by: Eike Rathke <[email protected]> diff --git a/oox/inc/oox/vml/vmlshapecontainer.hxx b/oox/inc/oox/vml/vmlshapecontainer.hxx index 9b11c6c..49c3980 100644 --- a/oox/inc/oox/vml/vmlshapecontainer.hxx +++ b/oox/inc/oox/vml/vmlshapecontainer.hxx @@ -93,7 +93,7 @@ public: const ShapeBase* findShape( const Functor& rFunctor ) const; /** Returns and removes the last shape in the collection (Word only). */ - const ShapeBase* takeLastShape(); + boost::shared_ptr< ShapeBase > takeLastShape(); /** Creates and inserts all UNO shapes into the passed container. */ void convertAndInsert( diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index 3234238..04edd85 100644 --- a/oox/source/shape/ShapeContextHandler.cxx +++ b/oox/source/shape/ShapeContextHandler.cxx @@ -244,7 +244,7 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException) if ( getContextHandler() == getDrawingShapeContext() ) { mpDrawing->finalizeFragmentImport(); - if( const ::oox::vml::ShapeBase* pShape = mpDrawing->getShapes().takeLastShape() ) + if( boost::shared_ptr< ::oox::vml::ShapeBase > pShape = mpDrawing->getShapes().takeLastShape() ) xResult = pShape->convertAndInsert( xShapes ); } else if (mpShape.get() != NULL) diff --git a/oox/source/vml/vmlshapecontainer.cxx b/oox/source/vml/vmlshapecontainer.cxx index 9502e4c..1d16a97 100644 --- a/oox/source/vml/vmlshapecontainer.cxx +++ b/oox/source/vml/vmlshapecontainer.cxx @@ -118,12 +118,12 @@ const ShapeBase* ShapeContainer::getShapeById( const OUString& rShapeId, bool bD return 0; } -const ShapeBase* ShapeContainer::takeLastShape() +boost::shared_ptr< ShapeBase > ShapeContainer::takeLastShape() { assert( mrDrawing.getType() == VMLDRAWING_WORD ); if( maShapes.empty()) - return NULL; - const ShapeBase* ret = maShapes.back().get(); + return boost::shared_ptr< ShapeBase >(); + boost::shared_ptr< ShapeBase > ret = maShapes.back(); maShapes.pop_back(); return ret; }
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
