From a13b6bd7317e39c3b54d4792aeea99fda0922a9d Mon Sep 17 00:00:00 2001 From: David Tardon Date: Fri, 9 Sep 2016 11:39:20 +0200 Subject: use std::unique_ptr Change-Id: I71627aa2a524a59180e8934df9561cf67a1c6126 --- xmloff/source/draw/ximpstyl.cxx | 11 +++-------- xmloff/source/draw/ximpstyl.hxx | 6 +++--- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index dadbdaa35457..2533f27a6901 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -24,6 +24,7 @@ #include #include "ximpnote.hxx" #include +#include #include #include @@ -923,14 +924,8 @@ SdXMLStylesContext::SdXMLStylesContext( mbIsAutoStyle(bIsAutoStyle) { Reference< uno::XComponentContext > xContext = rImport.GetComponentContext(); - mpNumFormatter = new SvNumberFormatter( xContext, LANGUAGE_SYSTEM ); - mpNumFmtHelper = new SvXMLNumFmtHelper( mpNumFormatter, xContext ); -} - -SdXMLStylesContext::~SdXMLStylesContext() -{ - delete mpNumFmtHelper; - delete mpNumFormatter; + mpNumFormatter = o3tl::make_unique( xContext, LANGUAGE_SYSTEM ); + mpNumFmtHelper = o3tl::make_unique( mpNumFormatter.get(), xContext ); } SvXMLStyleContext* SdXMLStylesContext::CreateStyleChildContext( diff --git a/xmloff/source/draw/ximpstyl.hxx b/xmloff/source/draw/ximpstyl.hxx index 83445547d3e7..867f5b3fff39 100644 --- a/xmloff/source/draw/ximpstyl.hxx +++ b/xmloff/source/draw/ximpstyl.hxx @@ -25,6 +25,7 @@ #include "ximppage.hxx" #include #include +#include #include class SvNumberFormatter; @@ -176,8 +177,8 @@ class SdXMLStylesContext : public SvXMLStylesContext { rtl::Reference< SvXMLImportPropertyMapper > xPresImpPropMapper; bool mbIsAutoStyle; - SvXMLNumFmtHelper* mpNumFmtHelper; - SvNumberFormatter* mpNumFormatter; + std::unique_ptr mpNumFmtHelper; + std::unique_ptr mpNumFormatter; const SdXMLImport& GetSdImport() const { return static_cast(GetImport()); } SdXMLImport& GetSdImport() { return static_cast(GetImport()); } @@ -211,7 +212,6 @@ public: const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, bool bIsAutoStyle); - virtual ~SdXMLStylesContext(); virtual sal_uInt16 GetFamily( const OUString& rFamily ) const override; virtual void EndElement() override; -- cgit