diff options
author | David Tardon <dtardon@redhat.com> | 2016-09-09 10:26:03 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-09-09 12:14:04 +0200 |
commit | 2e0cea44050e931bf7b290980a6b8c23de6526d5 (patch) | |
tree | 214a1aaf2a64dbb1596e7a496e47cb791c3274cb /xmloff | |
parent | 109ea4752b734683483aef5154d8debca2d300a3 (diff) |
use std::unique_ptr
Change-Id: I8ebbb94ae5f77fa44f46fb771f7d8ad5fc89a5bc
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/animationimport.cxx | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index 85e635f41a7d..102457a43672 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -53,6 +53,9 @@ #include <sax/tools/converter.hxx> #include <list> + +#include <o3tl/make_unique.hxx> + #include <xmloff/xmltypes.hxx> #include "sdpropls.hxx" #include <xmloff/xmltoken.hxx> @@ -106,12 +109,11 @@ class AnimationsImportHelperImpl private: SvXMLImport& mrImport; - SvXMLTokenMap* mpAnimationNodeTokenMap; - SvXMLTokenMap* mpAnimationNodeAttributeTokenMap; + std::unique_ptr<SvXMLTokenMap> mpAnimationNodeTokenMap; + std::unique_ptr<SvXMLTokenMap> mpAnimationNodeAttributeTokenMap; public: explicit AnimationsImportHelperImpl( SvXMLImport& rImport ); - ~AnimationsImportHelperImpl(); const SvXMLTokenMap& getAnimationNodeTokenMap(); const SvXMLTokenMap& getAnimationNodeAttributeTokenMap(); @@ -127,16 +129,8 @@ public: }; AnimationsImportHelperImpl::AnimationsImportHelperImpl( SvXMLImport& rImport ) -: mrImport( rImport ), - mpAnimationNodeTokenMap( nullptr ), - mpAnimationNodeAttributeTokenMap( nullptr ) -{ -} - -AnimationsImportHelperImpl::~AnimationsImportHelperImpl() +: mrImport( rImport ) { - delete mpAnimationNodeTokenMap; - delete mpAnimationNodeAttributeTokenMap; } const SvXMLTokenMap& AnimationsImportHelperImpl::getAnimationNodeTokenMap() @@ -159,7 +153,7 @@ const SvXMLTokenMap& AnimationsImportHelperImpl::getAnimationNodeTokenMap() XML_TOKEN_MAP_END }; - mpAnimationNodeTokenMap = new SvXMLTokenMap( aAnimationNodeTokenMap ); + mpAnimationNodeTokenMap = o3tl::make_unique<SvXMLTokenMap>( aAnimationNodeTokenMap ); } return *mpAnimationNodeTokenMap; @@ -278,7 +272,7 @@ const SvXMLTokenMap& AnimationsImportHelperImpl::getAnimationNodeAttributeTokenM XML_TOKEN_MAP_END }; - mpAnimationNodeAttributeTokenMap = new SvXMLTokenMap( aAnimationNodeAttributeTokenMap ); + mpAnimationNodeAttributeTokenMap = o3tl::make_unique<SvXMLTokenMap>( aAnimationNodeAttributeTokenMap ); } return *mpAnimationNodeAttributeTokenMap; |