[Libreoffice-commits] core.git: forms/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Jun 21 06:21:15 UTC 2018


 forms/source/component/FormattedField.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 9375d1bb04baf4e2f4911195b1fbc47496a584c2
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Jun 20 15:18:54 2018 +0200

    loplugin:useuniqueptr in StandardFormatsSupplier
    
    Change-Id: I54e0b958f4b6e6b6d99b7e82c327817cf2967e3d
    Reviewed-on: https://gerrit.libreoffice.org/56186
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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()
 {


More information about the Libreoffice-commits mailing list