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

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


 forms/source/xforms/propertysetbase.cxx |    4 +---
 forms/source/xforms/propertysetbase.hxx |    2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 10433ad91f29e5ef316ab2e8fd2d4713a3217a41
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Jun 20 15:21:43 2018 +0200

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

diff --git a/forms/source/xforms/propertysetbase.cxx b/forms/source/xforms/propertysetbase.cxx
index 4d426815fc98..393182c2f8f1 100644
--- a/forms/source/xforms/propertysetbase.cxx
+++ b/forms/source/xforms/propertysetbase.cxx
@@ -44,13 +44,11 @@ PropertyAccessorBase::~PropertyAccessorBase()
 }
 
 PropertySetBase::PropertySetBase( )
-    :m_pProperties( nullptr )
 {
 }
 
 PropertySetBase::~PropertySetBase( )
 {
-    DELETEZ( m_pProperties );
 }
 
 cppu::IPropertyArrayHelper& SAL_CALL PropertySetBase::getInfoHelper()
@@ -58,7 +56,7 @@ cppu::IPropertyArrayHelper& SAL_CALL PropertySetBase::getInfoHelper()
     if ( !m_pProperties )
     {
         OSL_ENSURE( !m_aProperties.empty(), "PropertySetBase::getInfoHelper: no registered properties!" );
-        m_pProperties = new cppu::OPropertyArrayHelper( &m_aProperties[0], m_aProperties.size(), false );
+        m_pProperties.reset(new cppu::OPropertyArrayHelper( &m_aProperties[0], m_aProperties.size(), false ));
     }
     return *m_pProperties;
 }
diff --git a/forms/source/xforms/propertysetbase.hxx b/forms/source/xforms/propertysetbase.hxx
index 5627055a8a61..409a4a6ebc8c 100644
--- a/forms/source/xforms/propertysetbase.hxx
+++ b/forms/source/xforms/propertysetbase.hxx
@@ -181,7 +181,7 @@ private:
     typedef ::std::map< const sal_Int32, css::uno::Any >                                PropertyValueCache;
 
     PropertyArray                   m_aProperties;
-    cppu::IPropertyArrayHelper*     m_pProperties;
+    std::unique_ptr<cppu::IPropertyArrayHelper> m_pProperties;
     PropertyAccessors               m_aAccessors;
     PropertyValueCache              m_aCache;
 


More information about the Libreoffice-commits mailing list