diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-09 14:35:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-12 08:36:20 +0200 |
commit | d4eabd5da8ea3b5ac40659c22cde19b26b3c002b (patch) | |
tree | 63c93e0287aa5668d8b2147b756d08ced533e7fd /comphelper | |
parent | 089ff7a374df9870c506c36720a1b9cab3a252f6 (diff) |
pass comphelper::PropertySetInfo around using rtl::Reference
and remove some manual ref counting
Change-Id: Ib78122fbbf914e87e0aef1f8fffe3952639e5b22
Reviewed-on: https://gerrit.libreoffice.org/38607
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/property/propertysethelper.cxx | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/comphelper/source/property/propertysethelper.cxx b/comphelper/source/property/propertysethelper.cxx index 5005fb626653..b9405ab555bf 100644 --- a/comphelper/source/property/propertysethelper.cxx +++ b/comphelper/source/property/propertysethelper.cxx @@ -36,15 +36,15 @@ class PropertySetHelperImpl public: PropertyMapEntry const * find( const OUString& aName ) const throw(); - PropertySetInfo* mpInfo; + rtl::Reference<PropertySetInfo> mxInfo; }; } PropertyMapEntry const * PropertySetHelperImpl::find( const OUString& aName ) const throw() { - PropertyMap::const_iterator aIter = mpInfo->getPropertyMap().find( aName ); + PropertyMap::const_iterator aIter = mxInfo->getPropertyMap().find( aName ); - if( mpInfo->getPropertyMap().end() != aIter ) + if( mxInfo->getPropertyMap().end() != aIter ) { return (*aIter).second; } @@ -55,28 +55,20 @@ PropertyMapEntry const * PropertySetHelperImpl::find( const OUString& aName ) co } -PropertySetHelper::PropertySetHelper( comphelper::PropertySetInfo* pInfo ) throw() +PropertySetHelper::PropertySetHelper( rtl::Reference<comphelper::PropertySetInfo> const & xInfo ) throw() : mpImpl(new PropertySetHelperImpl) { - mpImpl->mpInfo = pInfo; - pInfo->acquire(); -} - -PropertySetHelper::PropertySetHelper( comphelper::PropertySetInfo* pInfo, __sal_NoAcquire ) throw() - : mpImpl(new PropertySetHelperImpl) -{ - mpImpl->mpInfo = pInfo; + mpImpl->mxInfo = xInfo; } PropertySetHelper::~PropertySetHelper() throw() { - mpImpl->mpInfo->release(); } // XPropertySet Reference< XPropertySetInfo > SAL_CALL PropertySetHelper::getPropertySetInfo( ) { - return mpImpl->mpInfo; + return mpImpl->mxInfo.get(); } void SAL_CALL PropertySetHelper::setPropertyValue( const OUString& aPropertyName, const Any& aValue ) |