summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-09-08 14:50:52 +0200
committerDavid Tardon <dtardon@redhat.com>2016-09-09 07:30:30 +0200
commit73f32870cf3b88b65c40e362fae9bb63e51ec5ce (patch)
tree5f5a72e2c8555ff50bd68122ad4d63cc268076f0 /xmloff
parent655b94643cae76e09d179adc8172790fcff3f881 (diff)
use std::unique_ptr
Change-Id: I3cbe6058cd0d1bccb786866a6adf4859424e36ab
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/xmltabi.hxx6
-rw-r--r--xmloff/source/style/xmltabi.cxx11
2 files changed, 6 insertions, 11 deletions
diff --git a/xmloff/inc/xmltabi.hxx b/xmloff/inc/xmltabi.hxx
index ecc1b4af282b..de941e55c4c2 100644
--- a/xmloff/inc/xmltabi.hxx
+++ b/xmloff/inc/xmltabi.hxx
@@ -20,6 +20,8 @@
#ifndef INCLUDED_XMLOFF_INC_XMLTABI_HXX
#define INCLUDED_XMLOFF_INC_XMLTABI_HXX
+#include <memory>
+
#include "XMLElementPropertyContext.hxx"
class SvXMLImport;
@@ -30,7 +32,7 @@ typedef std::vector<css::uno::Reference<SvxXMLTabStopContext_Impl>> SvxXMLTabSto
class SvxXMLTabStopImportContext : public XMLElementPropertyContext
{
private:
- SvxXMLTabStopArray_Impl* mpTabStops;
+ std::unique_ptr<SvxXMLTabStopArray_Impl> mpTabStops;
public:
@@ -39,8 +41,6 @@ public:
const XMLPropertyState& rProp,
::std::vector< XMLPropertyState > &rProps );
- virtual ~SvxXMLTabStopImportContext();
-
virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
const OUString& rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override;
diff --git a/xmloff/source/style/xmltabi.cxx b/xmloff/source/style/xmltabi.cxx
index c2b65577e45a..33382e921625 100644
--- a/xmloff/source/style/xmltabi.cxx
+++ b/xmloff/source/style/xmltabi.cxx
@@ -18,6 +18,7 @@
*/
#include <com/sun/star/style/TabAlign.hpp>
+#include <o3tl/make_unique.hxx>
#include <rtl/ustrbuf.hxx>
#include <xmloff/xmltkmap.hxx>
#include <xmloff/nmspmap.hxx>
@@ -172,16 +173,10 @@ SvxXMLTabStopImportContext::SvxXMLTabStopImportContext(
const OUString& rLName,
const XMLPropertyState& rProp,
::std::vector< XMLPropertyState > &rProps )
-: XMLElementPropertyContext( rImport, nPrfx, rLName, rProp, rProps ),
- mpTabStops( nullptr )
+: XMLElementPropertyContext( rImport, nPrfx, rLName, rProp, rProps )
{
}
-SvxXMLTabStopImportContext::~SvxXMLTabStopImportContext()
-{
- delete mpTabStops;
-}
-
SvXMLImportContext *SvxXMLTabStopImportContext::CreateChildContext(
sal_uInt16 nPrefix,
const OUString& rLocalName,
@@ -198,7 +193,7 @@ SvXMLImportContext *SvxXMLTabStopImportContext::CreateChildContext(
// add new tabstop to array of tabstops
if( !mpTabStops )
- mpTabStops = new SvxXMLTabStopArray_Impl;
+ mpTabStops = o3tl::make_unique<SvxXMLTabStopArray_Impl>();
mpTabStops->push_back( xTabStopContext );