summaryrefslogtreecommitdiff
path: root/svl/source/numbers/supservs.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-12 08:21:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-13 11:20:22 +0100
commite5404aef868f21ac15e8255892e2171a9377cb47 (patch)
tree12bf2d1262e40344d88d00a21f7f5e316167b94a /svl/source/numbers/supservs.cxx
parent37464a0fb7f3bafe72126e65d34f2c15377a3964 (diff)
loplugin:useuniqueptr in svl
Change-Id: I89aa05b3c59ca3ad680d35899400957a399ccf0e Reviewed-on: https://gerrit.libreoffice.org/47795 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl/source/numbers/supservs.cxx')
-rw-r--r--svl/source/numbers/supservs.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/svl/source/numbers/supservs.cxx b/svl/source/numbers/supservs.cxx
index c0724ce0cc57..9a287a75c148 100644
--- a/svl/source/numbers/supservs.cxx
+++ b/svl/source/numbers/supservs.cxx
@@ -46,11 +46,6 @@ SvNumberFormatsSupplierServiceObject::SvNumberFormatsSupplierServiceObject(const
SvNumberFormatsSupplierServiceObject::~SvNumberFormatsSupplierServiceObject()
{
- if (m_pOwnFormatter)
- {
- delete m_pOwnFormatter;
- m_pOwnFormatter = nullptr;
- }
}
Any SAL_CALL SvNumberFormatsSupplierServiceObject::queryAggregation( const Type& _rType )
@@ -76,9 +71,8 @@ void SAL_CALL SvNumberFormatsSupplierServiceObject::initialize( const Sequence<
// you should use XMultiServiceFactory::createInstanceWithArguments to avoid that
if (m_pOwnFormatter)
{ // !!! this is only a emergency handling, normally this should not occur !!!
- delete m_pOwnFormatter;
- m_pOwnFormatter = nullptr;
- SetNumberFormatter(m_pOwnFormatter);
+ m_pOwnFormatter.reset();
+ SetNumberFormatter(m_pOwnFormatter.get());
}
Type aExpectedArgType = ::cppu::UnoType<css::lang::Locale>::get();
@@ -102,9 +96,9 @@ void SAL_CALL SvNumberFormatsSupplierServiceObject::initialize( const Sequence<
#endif
}
- m_pOwnFormatter = new SvNumberFormatter( m_xORB, eNewFormatterLanguage);
+ m_pOwnFormatter.reset( new SvNumberFormatter( m_xORB, eNewFormatterLanguage) );
m_pOwnFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_FORMAT_INTL );
- SetNumberFormatter(m_pOwnFormatter);
+ SetNumberFormatter(m_pOwnFormatter.get());
}
OUString SAL_CALL SvNumberFormatsSupplierServiceObject::getImplementationName( )