Kaydet (Commit) 8955578f authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in WrappedPropertySet

Change-Id: I08f00c00b22c6a680ec59d2e86eb035c58b17609
Reviewed-on: https://gerrit.libreoffice.org/55526Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 0c195667
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment