Kaydet (Commit) 7afc5ab5 authored tarafından David Tardon's avatar David Tardon

use std::shared_ptr to manage memory

Change-Id: I3fcf285a75a1bf8252e0784c9ff4aceee64f4b5b
üst 2e0cea44
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#ifndef INCLUDED_XMLOFF_INC_ANIMIMP_HXX #ifndef INCLUDED_XMLOFF_INC_ANIMIMP_HXX
#define INCLUDED_XMLOFF_INC_ANIMIMP_HXX #define INCLUDED_XMLOFF_INC_ANIMIMP_HXX
#include <memory>
#include <xmloff/xmlictxt.hxx> #include <xmloff/xmlictxt.hxx>
#include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/drawing/XShapes.hpp>
...@@ -29,7 +31,7 @@ class AnimImpImpl; ...@@ -29,7 +31,7 @@ class AnimImpImpl;
class XMLAnimationsContext : public SvXMLImportContext class XMLAnimationsContext : public SvXMLImportContext
{ {
AnimImpImpl* mpImpl; std::shared_ptr<AnimImpImpl> mpImpl;
public: public:
...@@ -37,7 +39,6 @@ public: ...@@ -37,7 +39,6 @@ public:
sal_uInt16 nPrfx, sal_uInt16 nPrfx,
const OUString& rLocalName, const OUString& rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList); const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList);
virtual ~XMLAnimationsContext();
virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override;
......
...@@ -361,7 +361,7 @@ enum XMLActionKind ...@@ -361,7 +361,7 @@ enum XMLActionKind
class XMLAnimationsEffectContext : public SvXMLImportContext class XMLAnimationsEffectContext : public SvXMLImportContext
{ {
public: public:
AnimImpImpl* mpImpl; std::shared_ptr<AnimImpImpl> mpImpl;
XMLActionKind meKind; XMLActionKind meKind;
bool mbTextEffect; bool mbTextEffect;
...@@ -383,7 +383,7 @@ public: ...@@ -383,7 +383,7 @@ public:
sal_uInt16 nPrfx, sal_uInt16 nPrfx,
const OUString& rLocalName, const OUString& rLocalName,
const Reference< XAttributeList >& xAttrList, const Reference< XAttributeList >& xAttrList,
AnimImpImpl* pImpl); const std::shared_ptr<AnimImpImpl>& pImpl);
virtual ~XMLAnimationsEffectContext(); virtual ~XMLAnimationsEffectContext();
virtual void EndElement() override; virtual void EndElement() override;
...@@ -439,7 +439,7 @@ XMLAnimationsSoundContext::~XMLAnimationsSoundContext() ...@@ -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), : SvXMLImportContext(rImport, nPrfx, rLocalName),
mpImpl( pImpl ), mpImpl( pImpl ),
meKind( XMLE_SHOW ), mbTextEffect( false ), meKind( XMLE_SHOW ), mbTextEffect( false ),
...@@ -638,13 +638,8 @@ void XMLAnimationsEffectContext::EndElement() ...@@ -638,13 +638,8 @@ void XMLAnimationsEffectContext::EndElement()
XMLAnimationsContext::XMLAnimationsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, XMLAnimationsContext::XMLAnimationsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList>& ) const css::uno::Reference< css::xml::sax::XAttributeList>& )
: SvXMLImportContext(rImport, nPrfx, rLocalName) : 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, SvXMLImportContext * XMLAnimationsContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment