From 10433ad91f29e5ef316ab2e8fd2d4713a3217a41 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 20 Jun 2018 15:21:43 +0200 Subject: loplugin:useuniqueptr in PropertySetBase Change-Id: I82af72050329bd206c4e796334a3ac9bc1177768 Reviewed-on: https://gerrit.libreoffice.org/56187 Tested-by: Jenkins Reviewed-by: Noel Grandin --- forms/source/xforms/propertysetbase.cxx | 4 +--- forms/source/xforms/propertysetbase.hxx | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'forms') 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 m_pProperties; PropertyAccessors m_aAccessors; PropertyValueCache m_aCache; -- cgit v1.2.3