diff options
author | David Tardon <dtardon@redhat.com> | 2016-09-09 11:39:20 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-09-09 12:14:04 +0200 |
commit | a13b6bd7317e39c3b54d4792aeea99fda0922a9d (patch) | |
tree | 98ae28516e291f572c6432f82ddce49f35d53c1e /xmloff | |
parent | 44c7366d5b58116c14d1dfd41ab6d2c8daec223a (diff) |
use std::unique_ptr
Change-Id: I71627aa2a524a59180e8934df9561cf67a1c6126
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/ximpstyl.cxx | 11 | ||||
-rw-r--r-- | xmloff/source/draw/ximpstyl.hxx | 6 |
2 files changed, 6 insertions, 11 deletions
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 <xmloff/xmluconv.hxx> #include "ximpnote.hxx" #include <tools/debug.hxx> +#include <o3tl/make_unique.hxx> #include <osl/diagnose.h> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -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<SvNumberFormatter>( xContext, LANGUAGE_SYSTEM ); + mpNumFmtHelper = o3tl::make_unique<SvXMLNumFmtHelper>( 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 <xmloff/xmlstyle.hxx> #include <com/sun/star/view/PaperOrientation.hpp> +#include <memory> #include <vector> class SvNumberFormatter; @@ -176,8 +177,8 @@ class SdXMLStylesContext : public SvXMLStylesContext { rtl::Reference< SvXMLImportPropertyMapper > xPresImpPropMapper; bool mbIsAutoStyle; - SvXMLNumFmtHelper* mpNumFmtHelper; - SvNumberFormatter* mpNumFormatter; + std::unique_ptr<SvXMLNumFmtHelper> mpNumFmtHelper; + std::unique_ptr<SvNumberFormatter> mpNumFormatter; const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); } SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(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; |