summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-09-09 10:32:04 +0200
committerDavid Tardon <dtardon@redhat.com>2016-09-09 12:14:04 +0200
commit7afc5ab572d4584f005a04cd57188a7c646b164b (patch)
treea71e0bcc7bd565727ba779f1c0536a6d31ae9239
parent2e0cea44050e931bf7b290980a6b8c23de6526d5 (diff)
use std::shared_ptr to manage memory
Change-Id: I3fcf285a75a1bf8252e0784c9ff4aceee64f4b5b
-rw-r--r--xmloff/inc/animimp.hxx5
-rw-r--r--xmloff/source/draw/animimp.cxx13
2 files changed, 7 insertions, 11 deletions
diff --git a/xmloff/inc/animimp.hxx b/xmloff/inc/animimp.hxx
index 19b9bbed303a..0a07b3fe0e28 100644
--- a/xmloff/inc/animimp.hxx
+++ b/xmloff/inc/animimp.hxx
@@ -20,6 +20,8 @@
#ifndef INCLUDED_XMLOFF_INC_ANIMIMP_HXX
#define INCLUDED_XMLOFF_INC_ANIMIMP_HXX
+#include <memory>
+
#include <xmloff/xmlictxt.hxx>
#include <com/sun/star/drawing/XShapes.hpp>
@@ -29,7 +31,7 @@ class AnimImpImpl;
class XMLAnimationsContext : public SvXMLImportContext
{
- AnimImpImpl* mpImpl;
+ std::shared_ptr<AnimImpImpl> mpImpl;
public:
@@ -37,7 +39,6 @@ public:
sal_uInt16 nPrfx,
const OUString& rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList);
- virtual ~XMLAnimationsContext();
virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override;
diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx
index 03781227a748..6ba0a22b9e44 100644
--- a/xmloff/source/draw/animimp.cxx
+++ b/xmloff/source/draw/animimp.cxx
@@ -361,7 +361,7 @@ enum XMLActionKind
class XMLAnimationsEffectContext : public SvXMLImportContext
{
public:
- AnimImpImpl* mpImpl;
+ std::shared_ptr<AnimImpImpl> mpImpl;
XMLActionKind meKind;
bool mbTextEffect;
@@ -383,7 +383,7 @@ public:
sal_uInt16 nPrfx,
const OUString& rLocalName,
const Reference< XAttributeList >& xAttrList,
- AnimImpImpl* pImpl);
+ const std::shared_ptr<AnimImpImpl>& pImpl);
virtual ~XMLAnimationsEffectContext();
virtual void EndElement() override;
@@ -439,7 +439,7 @@ XMLAnimationsSoundContext::~XMLAnimationsSoundContext()
}
-XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, AnimImpImpl* pImpl )
+XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, const std::shared_ptr<AnimImpImpl>& pImpl )
: SvXMLImportContext(rImport, nPrfx, rLocalName),
mpImpl( pImpl ),
meKind( XMLE_SHOW ), mbTextEffect( false ),
@@ -638,13 +638,8 @@ void XMLAnimationsEffectContext::EndElement()
XMLAnimationsContext::XMLAnimationsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList>& )
: SvXMLImportContext(rImport, nPrfx, rLocalName)
+, mpImpl(std::make_shared<AnimImpImpl>())
{
- mpImpl = new AnimImpImpl();
-}
-
-XMLAnimationsContext::~XMLAnimationsContext()
-{
- delete mpImpl;
}
SvXMLImportContext * XMLAnimationsContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,