summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-09-09 14:55:12 +0200
committerDavid Tardon <dtardon@redhat.com>2016-09-09 16:16:45 +0200
commit8e11d353665242fc90ef485ff8f67a44206b6393 (patch)
tree1da502d977387bc53eeb538fcb1579c7ca16cd30 /xmloff
parent8d458a24f79ed9ba321daa3db283eb22dbd7c27f (diff)
use std::unique_ptr
Change-Id: I8ba37267e8a7058ade54783ea0e117a8f8816c45
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/unoatrcn.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx
index 1fae778f1f90..fec3e48fa4ae 100644
--- a/xmloff/source/core/unoatrcn.cxx
+++ b/xmloff/source/core/unoatrcn.cxx
@@ -20,6 +20,7 @@
#include <string.h>
#include <com/sun/star/xml/AttributeData.hpp>
#include <o3tl/any.hxx>
+#include <o3tl/make_unique.hxx>
#include <rtl/ustrbuf.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -38,16 +39,11 @@ uno::Reference< uno::XInterface > SvUnoAttributeContainer_CreateInstance()
return *(new SvUnoAttributeContainer);
}
-SvUnoAttributeContainer::SvUnoAttributeContainer( SvXMLAttrContainerData* pContainer)
-: mpContainer( pContainer )
+SvUnoAttributeContainer::SvUnoAttributeContainer( std::unique_ptr<SvXMLAttrContainerData> pContainer)
+: mpContainer( std::move( pContainer ) )
{
- if( mpContainer == nullptr )
- mpContainer = new SvXMLAttrContainerData;
-}
-
-SvUnoAttributeContainer::~SvUnoAttributeContainer()
-{
- delete mpContainer;
+ if( !mpContainer )
+ mpContainer = o3tl::make_unique<SvXMLAttrContainerData>();
}
// container::XElementAccess