summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-09-09 11:42:20 +0200
committerDavid Tardon <dtardon@redhat.com>2016-09-09 12:14:04 +0200
commit87bc9685c250b403d4c002b54d5c49a6a81222fb (patch)
tree655448c40762068649f039a9e1f438a648b2a237 /xmloff
parenta13b6bd7317e39c3b54d4792aeea99fda0922a9d (diff)
use std::unique_ptr
Change-Id: I33d75ede0031da63c00c35af7b42867fea0b8d80
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlnumfi.cxx11
1 files changed, 6 insertions, 5 deletions
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;
}