diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-20 15:18:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-21 08:20:49 +0200 |
commit | 9375d1bb04baf4e2f4911195b1fbc47496a584c2 (patch) | |
tree | 57fa4fbda2aeddaf825906fc4d386c3165c91877 /forms | |
parent | 517c070d0642756fcef58214385407af603e22b6 (diff) |
loplugin:useuniqueptr in StandardFormatsSupplier
Change-Id: I54e0b958f4b6e6b6d99b7e82c327817cf2967e3d
Reviewed-on: https://gerrit.libreoffice.org/56186
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/FormattedField.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index c3b2914f7ba7..2279b49dfcff 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -77,7 +77,7 @@ namespace frm class StandardFormatsSupplier : protected SvNumberFormatsSupplierObj, public ::utl::ITerminationListener { protected: - SvNumberFormatter* m_pMyPrivateFormatter; + std::unique_ptr<SvNumberFormatter> m_pMyPrivateFormatter; static WeakReference< XNumberFormatsSupplier > s_xDefaultFormatsSupplier; public: static Reference< XNumberFormatsSupplier > get( const Reference< XComponentContext >& _rxORB ); @@ -93,14 +93,13 @@ StandardFormatsSupplier::StandardFormatsSupplier(const Reference< XComponentCont :SvNumberFormatsSupplierObj() ,m_pMyPrivateFormatter(new SvNumberFormatter(_rxContext, _eSysLanguage)) { - SetNumberFormatter(m_pMyPrivateFormatter); + SetNumberFormatter(m_pMyPrivateFormatter.get()); // #i29147# ::utl::DesktopTerminationObserver::registerTerminationListener( this ); } StandardFormatsSupplier::~StandardFormatsSupplier() { ::utl::DesktopTerminationObserver::revokeTerminationListener( this ); - DELETEZ( m_pMyPrivateFormatter ); } Reference< XNumberFormatsSupplier > StandardFormatsSupplier::get( const Reference< XComponentContext >& _rxORB ) { @@ -138,7 +137,7 @@ void StandardFormatsSupplier::notifyTermination() // #i29147# s_xDefaultFormatsSupplier = WeakReference< XNumberFormatsSupplier >( ); SetNumberFormatter( nullptr ); - DELETEZ( m_pMyPrivateFormatter ); + m_pMyPrivateFormatter.reset(); } Sequence<Type> OFormattedControl::_getTypes() { |