diff options
author | David Tardon <dtardon@redhat.com> | 2016-09-09 10:43:53 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-09-09 12:14:04 +0200 |
commit | 22547c51cf9484b0d7e1a7ed317fe5f70aaab694 (patch) | |
tree | c8b4e99821e6e1a1e1a527a982e6c733f320376f /xmloff | |
parent | 8304c237c3d3538cdb597e668aa43df54d4b43c3 (diff) |
use std::shared_ptr
Change-Id: Ie3f89c611f06be3c2fd5f43a4fa691f719078307
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/shapeimport.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index 08c184cd53ca..5738e703fa9e 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -88,7 +88,7 @@ struct XMLShapeImportPageContextImpl uno::Reference < drawing::XShapes > mxShapes; - struct XMLShapeImportPageContextImpl* mpNext; + std::shared_ptr<XMLShapeImportPageContextImpl> mpNext; }; /** this class is to enable adding members to the XMLShapeImportHelper without getting incompatible */ @@ -111,7 +111,6 @@ XMLShapeImportHelper::XMLShapeImportHelper( const uno::Reference< frame::XModel>& rModel, SvXMLImportPropertyMapper *pExtMapper ) : mpImpl( new XMLShapeImportHelperImpl() ), - mpPageContext(nullptr), mpPropertySetMapper(nullptr), mpPresPagePropsMapper(nullptr), @@ -1021,8 +1020,8 @@ sal_Int32 XMLShapeImportHelper::getGluePointId( const css::uno::Reference< css:: /** this method must be calling before the first shape is imported for the given page */ void XMLShapeImportHelper::startPage( css::uno::Reference< css::drawing::XShapes >& rShapes ) { - XMLShapeImportPageContextImpl* pOldContext = mpPageContext; - mpPageContext = new XMLShapeImportPageContextImpl(); + const std::shared_ptr<XMLShapeImportPageContextImpl> pOldContext = mpPageContext; + mpPageContext = std::make_shared<XMLShapeImportPageContextImpl>(); mpPageContext->mpNext = pOldContext; mpPageContext->mxShapes = rShapes; } @@ -1036,9 +1035,7 @@ void XMLShapeImportHelper::endPage( css::uno::Reference< css::drawing::XShapes > restoreConnections(); - XMLShapeImportPageContextImpl* pNextContext = mpPageContext->mpNext; - delete mpPageContext; - mpPageContext = pNextContext; + mpPageContext = mpPageContext->mpNext; } /** defines if the import should increment the progress bar or not */ |