summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-04 16:27:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-11 08:27:04 +0200
commit8955578f2cd3b0b20247d489dbceb71abbf6adf3 (patch)
tree72ada405aafaca14e87526b3458b323b5f05b9ee /chart2
parent0c195667cf9408c489913b7591d16505fc237741 (diff)
loplugin:useuniqueptr in WrappedPropertySet
Change-Id: I08f00c00b22c6a680ec59d2e86eb035c58b17609 Reviewed-on: https://gerrit.libreoffice.org/55526 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/inc/WrappedPropertySet.hxx5
-rw-r--r--chart2/source/tools/WrappedPropertySet.cxx16
2 files changed, 11 insertions, 10 deletions
diff --git a/chart2/source/inc/WrappedPropertySet.hxx b/chart2/source/inc/WrappedPropertySet.hxx
index dd70bed2cde2..a0398bafe180 100644
--- a/chart2/source/inc/WrappedPropertySet.hxx
+++ b/chart2/source/inc/WrappedPropertySet.hxx
@@ -30,6 +30,7 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/propshlp.hxx>
+#include <memory>
#include <vector>
namespace chart
@@ -105,9 +106,9 @@ protected: //methods
protected: //member
css::uno::Reference< css::beans::XPropertySetInfo > m_xInfo;//outer PropertySetInfo
- ::cppu::OPropertyArrayHelper* m_pPropertyArrayHelper;//holds all possible outer properties
+ std::unique_ptr<::cppu::OPropertyArrayHelper> m_pPropertyArrayHelper;//holds all possible outer properties
- tWrappedPropertyMap* m_pWrappedPropertyMap;//holds all wrapped properties (containing the special mapping from inner to outer properties)
+ std::unique_ptr<tWrappedPropertyMap> m_pWrappedPropertyMap;//holds all wrapped properties (containing the special mapping from inner to outer properties)
//Container for the XProperyChangedListener. The listeners are inserted by handle.
//OMultiTypeInterfaceContainerHelperInt32 m_aBoundListenerContainer;
diff --git a/chart2/source/tools/WrappedPropertySet.cxx b/chart2/source/tools/WrappedPropertySet.cxx
index 72c296ea6185..8ffe2e27b04f 100644
--- a/chart2/source/tools/WrappedPropertySet.cxx
+++ b/chart2/source/tools/WrappedPropertySet.cxx
@@ -61,8 +61,8 @@ void WrappedPropertySet::clearWrappedPropertySet()
}
}
- DELETEZ(m_pPropertyArrayHelper);
- DELETEZ(m_pWrappedPropertyMap);
+ m_pPropertyArrayHelper.reset();
+ m_pWrappedPropertyMap.reset();
m_xInfo = nullptr;
}
@@ -393,16 +393,16 @@ Sequence< Any > SAL_CALL WrappedPropertySet::getPropertyDefaults( const Sequence
::cppu::IPropertyArrayHelper& WrappedPropertySet::getInfoHelper()
{
- ::cppu::OPropertyArrayHelper* p = m_pPropertyArrayHelper;
+ ::cppu::OPropertyArrayHelper* p = m_pPropertyArrayHelper.get();
if(!p)
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );//do not use different mutex than is already used for static property sequence
- p = m_pPropertyArrayHelper;
+ p = m_pPropertyArrayHelper.get();
if(!p)
{
p = new ::cppu::OPropertyArrayHelper( getPropertySequence(), true );
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
- m_pPropertyArrayHelper = p;
+ m_pPropertyArrayHelper.reset(p);
}
}
else
@@ -414,11 +414,11 @@ Sequence< Any > SAL_CALL WrappedPropertySet::getPropertyDefaults( const Sequence
tWrappedPropertyMap& WrappedPropertySet::getWrappedPropertyMap()
{
- tWrappedPropertyMap* p = m_pWrappedPropertyMap;
+ tWrappedPropertyMap* p = m_pWrappedPropertyMap.get();
if(!p)
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );//do not use different mutex than is already used for static property sequence
- p = m_pWrappedPropertyMap;
+ p = m_pWrappedPropertyMap.get();
if(!p)
{
std::vector< WrappedProperty* > aPropList( createWrappedProperties() );
@@ -447,7 +447,7 @@ tWrappedPropertyMap& WrappedPropertySet::getWrappedPropertyMap()
}
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
- m_pWrappedPropertyMap = p;
+ m_pWrappedPropertyMap.reset(p);
}
}
else