diff options
author | David Tardon <dtardon@redhat.com> | 2016-09-09 11:42:20 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-09-09 12:14:04 +0200 |
commit | 87bc9685c250b403d4c002b54d5c49a6a81222fb (patch) | |
tree | 655448c40762068649f039a9e1f438a648b2a237 | |
parent | a13b6bd7317e39c3b54d4792aeea99fda0922a9d (diff) |
use std::unique_ptr
Change-Id: I33d75ede0031da63c00c35af7b42867fea0b8d80
-rw-r--r-- | include/xmloff/xmlnumfi.hxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfi.cxx | 11 |
2 files changed, 8 insertions, 7 deletions
diff --git a/include/xmloff/xmlnumfi.hxx b/include/xmloff/xmlnumfi.hxx index e12491790800..a2ea8b47ac4a 100644 --- a/include/xmloff/xmlnumfi.hxx +++ b/include/xmloff/xmlnumfi.hxx @@ -72,7 +72,7 @@ namespace com { namespace sun { namespace star { namespace lang { class SvXMLNumFmtHelper { - SvXMLNumImpData* pData; + std::unique_ptr<SvXMLNumImpData> pData; public: SvXMLNumFmtHelper( @@ -91,7 +91,7 @@ public: const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList, SvXMLStylesContext& rStyles); - SvXMLNumImpData* getData() { return pData; } + SvXMLNumImpData* getData() { return pData.get(); } const SvXMLTokenMap& GetStylesElemTokenMap(); diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 1d94ea3711e6..9d035e4cd820 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -18,6 +18,9 @@ */ #include <comphelper/string.hxx> + +#include <o3tl/make_unique.hxx> + #include <unotools/syslocale.hxx> #include <svl/zforlist.hxx> @@ -2307,7 +2310,7 @@ SvXMLNumFmtHelper::SvXMLNumFmtHelper( if (pObj) pFormatter = pObj->GetNumberFormatter(); - pData = new SvXMLNumImpData( pFormatter, rxContext ); + pData = o3tl::make_unique<SvXMLNumImpData>( pFormatter, rxContext ); } SvXMLNumFmtHelper::SvXMLNumFmtHelper( @@ -2316,15 +2319,13 @@ SvXMLNumFmtHelper::SvXMLNumFmtHelper( { SAL_WARN_IF( !rxContext.is(), "xmloff", "got no service manager" ); - pData = new SvXMLNumImpData( pNumberFormatter, rxContext ); + pData = o3tl::make_unique<SvXMLNumImpData>( pNumberFormatter, rxContext ); } SvXMLNumFmtHelper::~SvXMLNumFmtHelper() { // remove temporary (volatile) formats from NumberFormatter pData->RemoveVolatileFormats(); - - delete pData; } SvXMLStyleContext* SvXMLNumFmtHelper::CreateChildContext( SvXMLImport& rImport, @@ -2346,7 +2347,7 @@ SvXMLStyleContext* SvXMLNumFmtHelper::CreateChildContext( SvXMLImport& rImport, case XML_TOK_STYLES_BOOLEAN_STYLE: case XML_TOK_STYLES_TEXT_STYLE: pContext = new SvXMLNumFormatContext( rImport, nPrefix, rLocalName, - pData, nToken, xAttrList, rStyles ); + pData.get(), nToken, xAttrList, rStyles ); break; } |