diff options
-rw-r--r-- | xmloff/inc/xmltabi.hxx | 6 | ||||
-rw-r--r-- | xmloff/source/style/xmltabi.cxx | 11 |
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 ); |