diff options
author | David Tardon <dtardon@redhat.com> | 2016-09-08 14:59:12 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-09-09 07:30:30 +0200 |
commit | c6a65137436c87a6e9f85d46193c42ba35698446 (patch) | |
tree | da103016e1f211ae8abbdae1ea74ee47939fee13 | |
parent | 516992ec6e8d67552610928b91d7b0d9f7014600 (diff) |
use std::unique_ptr
Change-Id: I352e542de656d22963eb872f79b40e20008d0a32
-rw-r--r-- | xmloff/inc/XMLTextColumnsContext.hxx | 10 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextColumnsContext.cxx | 11 |
2 files changed, 7 insertions, 14 deletions
diff --git a/xmloff/inc/XMLTextColumnsContext.hxx b/xmloff/inc/XMLTextColumnsContext.hxx index b750adb90447..15b40cdedea0 100644 --- a/xmloff/inc/XMLTextColumnsContext.hxx +++ b/xmloff/inc/XMLTextColumnsContext.hxx @@ -20,6 +20,8 @@ #ifndef INCLUDED_XMLOFF_INC_XMLTEXTCOLUMNSCONTEXT_HXX #define INCLUDED_XMLOFF_INC_XMLTEXTCOLUMNSCONTEXT_HXX +#include <memory> + #include "XMLElementPropertyContext.hxx" class XMLTextColumnContext_Impl; @@ -39,10 +41,10 @@ class XMLTextColumnsContext :public XMLElementPropertyContext const OUString sSeparatorLineStyle; - XMLTextColumnsArray_Impl *pColumns; + std::unique_ptr<XMLTextColumnsArray_Impl> pColumns; css::uno::Reference<XMLTextColumnSepContext_Impl> mxColumnSep; - SvXMLTokenMap *pColumnAttrTokenMap; - SvXMLTokenMap *pColumnSepAttrTokenMap; + std::unique_ptr<SvXMLTokenMap> pColumnAttrTokenMap; + std::unique_ptr<SvXMLTokenMap> pColumnSepAttrTokenMap; sal_Int16 nCount; bool bAutomatic; sal_Int32 nAutomaticDistance; @@ -56,8 +58,6 @@ public: const XMLPropertyState& rProp, ::std::vector< XMLPropertyState > &rProps ); - virtual ~XMLTextColumnsContext(); - virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx index 475f9c916ce7..95440b0bd8bc 100644 --- a/xmloff/source/text/XMLTextColumnsContext.cxx +++ b/xmloff/source/text/XMLTextColumnsContext.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/style/VerticalAlignment.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <o3tl/make_unique.hxx> #include <sax/tools/converter.hxx> #include <xmloff/xmltkmap.hxx> #include <xmloff/xmluconv.hxx> @@ -275,7 +276,6 @@ XMLTextColumnsContext::XMLTextColumnsContext( , sSeparatorLineVerticalAlignment("SeparatorLineVerticalAlignment") , sAutomaticDistance("AutomaticDistance") , sSeparatorLineStyle("SeparatorLineStyle") -, pColumns( nullptr ) , pColumnAttrTokenMap( new SvXMLTokenMap(aColAttrTokenMap) ) , pColumnSepAttrTokenMap( new SvXMLTokenMap(aColSepAttrTokenMap) ) , nCount( 0 ) @@ -308,13 +308,6 @@ XMLTextColumnsContext::XMLTextColumnsContext( } } -XMLTextColumnsContext::~XMLTextColumnsContext() -{ - delete pColumns; - delete pColumnAttrTokenMap; - delete pColumnSepAttrTokenMap; -} - SvXMLImportContext *XMLTextColumnsContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, @@ -331,7 +324,7 @@ SvXMLImportContext *XMLTextColumnsContext::CreateChildContext( // add new tabstop to array of tabstops if( !pColumns ) - pColumns = new XMLTextColumnsArray_Impl; + pColumns = o3tl::make_unique<XMLTextColumnsArray_Impl>(); pColumns->push_back( xColumn ); |