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 /svtools | |
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 'svtools')
-rw-r--r-- | svtools/source/graphic/descriptor.cxx | 12 | ||||
-rw-r--r-- | svtools/source/graphic/descriptor.hxx | 2 | ||||
-rw-r--r-- | svtools/source/graphic/renderer.cxx | 12 | ||||
-rw-r--r-- | svtools/source/uno/unoimap.cxx | 10 |
4 files changed, 12 insertions, 24 deletions
diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx index 8bba24751935..ed47c6e3822b 100644 --- a/svtools/source/graphic/descriptor.cxx +++ b/svtools/source/graphic/descriptor.cxx @@ -55,7 +55,7 @@ namespace unographic { GraphicDescriptor::GraphicDescriptor() : - ::comphelper::PropertySetHelper( createPropertySetInfo(), SAL_NO_ACQUIRE ), + ::comphelper::PropertySetHelper( createPropertySetInfo() ), mpGraphic( nullptr ), meType( GraphicType::NONE ), mnBitsPerPixel ( 0 ), @@ -232,11 +232,8 @@ uno::Sequence< sal_Int8 > SAL_CALL GraphicDescriptor::getImplementationId() } -::comphelper::PropertySetInfo* GraphicDescriptor::createPropertySetInfo() +rtl::Reference<::comphelper::PropertySetInfo> GraphicDescriptor::createPropertySetInfo() { - SolarMutexGuard aGuard; - ::comphelper::PropertySetInfo* pRet = new ::comphelper::PropertySetInfo(); - static ::comphelper::PropertyMapEntry const aEntries[] = { { OUString( "GraphicType" ), static_cast< sal_Int32 >( UnoGraphicProperty::GraphicType ), cppu::UnoType< sal_Int8 >::get(), beans::PropertyAttribute::READONLY, 0 }, @@ -250,10 +247,7 @@ uno::Sequence< sal_Int8 > SAL_CALL GraphicDescriptor::getImplementationId() { OUString(), 0, css::uno::Type(), 0, 0 } }; - pRet->acquire(); - pRet->add( aEntries ); - - return pRet; + return rtl::Reference<::comphelper::PropertySetInfo>( new ::comphelper::PropertySetInfo(aEntries) ); } diff --git a/svtools/source/graphic/descriptor.hxx b/svtools/source/graphic/descriptor.hxx index 8c1c352b64fd..d831d17ab8d1 100644 --- a/svtools/source/graphic/descriptor.hxx +++ b/svtools/source/graphic/descriptor.hxx @@ -77,7 +77,7 @@ public: protected: - static ::comphelper::PropertySetInfo* createPropertySetInfo(); + static rtl::Reference<::comphelper::PropertySetInfo> createPropertySetInfo(); // XInterface virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx index 1db2117506df..262d97387717 100644 --- a/svtools/source/graphic/renderer.cxx +++ b/svtools/source/graphic/renderer.cxx @@ -53,7 +53,7 @@ class GraphicRendererVCL : public ::cppu::OWeakAggObject, public ::comphelper::PropertySetHelper, public css::graphic::XGraphicRenderer { - static ::comphelper::PropertySetInfo* createPropertySetInfo(); + static rtl::Reference<::comphelper::PropertySetInfo> createPropertySetInfo(); public: @@ -179,11 +179,8 @@ uno::Sequence< sal_Int8 > SAL_CALL GraphicRendererVCL::getImplementationId() } -::comphelper::PropertySetInfo* GraphicRendererVCL::createPropertySetInfo() +rtl::Reference<::comphelper::PropertySetInfo> GraphicRendererVCL::createPropertySetInfo() { - SolarMutexGuard aGuard; - ::comphelper::PropertySetInfo* pRet = new ::comphelper::PropertySetInfo(); - static ::comphelper::PropertyMapEntry const aEntries[] = { { OUString("Device"), UNOGRAPHIC_DEVICE, cppu::UnoType<uno::Any>::get(), 0, 0 }, @@ -192,10 +189,7 @@ uno::Sequence< sal_Int8 > SAL_CALL GraphicRendererVCL::getImplementationId() { OUString(), 0, css::uno::Type(), 0, 0 } }; - pRet->acquire(); - pRet->add( aEntries ); - - return pRet; + return rtl::Reference<::comphelper::PropertySetInfo>( new ::comphelper::PropertySetInfo(aEntries) ); } diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx index 388b6240cb82..a99ca91662d7 100644 --- a/svtools/source/uno/unoimap.cxx +++ b/svtools/source/uno/unoimap.cxx @@ -105,7 +105,7 @@ public: virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; private: - static PropertySetInfo* createPropertySetInfo( sal_uInt16 nType ); + static rtl::Reference<PropertySetInfo> createPropertySetInfo( sal_uInt16 nType ); sal_uInt16 mnType; @@ -124,7 +124,7 @@ private: UNO3_GETIMPLEMENTATION_IMPL( SvUnoImageMapObject ); -PropertySetInfo * SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType ) +rtl::Reference<PropertySetInfo> SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType ) { switch( nType ) { @@ -142,7 +142,7 @@ PropertySetInfo * SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType ) { OUString(), 0, css::uno::Type(), 0, 0 } }; - return new PropertySetInfo( aPolygonObj_Impl ); + return rtl::Reference<PropertySetInfo>(new PropertySetInfo( aPolygonObj_Impl )); } case IMAP_OBJ_CIRCLE: { @@ -159,7 +159,7 @@ PropertySetInfo * SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType ) { OUString(), 0, css::uno::Type(), 0, 0 } }; - return new PropertySetInfo( aCircleObj_Impl ); + return rtl::Reference<PropertySetInfo>(new PropertySetInfo( aCircleObj_Impl )); } case IMAP_OBJ_RECTANGLE: default: @@ -176,7 +176,7 @@ PropertySetInfo * SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType ) { OUString(), 0, css::uno::Type(), 0, 0 } }; - return new PropertySetInfo( aRectangleObj_Impl ); + return rtl::Reference<PropertySetInfo>(new PropertySetInfo( aRectangleObj_Impl )); } } } |