diff options
author | Noel Grandin <noel@peralex.com> | 2014-07-08 16:41:11 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-07-10 11:04:11 +0200 |
commit | a7470048bd5be5c1668bafc02d58dba97ff5a558 (patch) | |
tree | a7280173c92a0dd9e33da6ac7ee7c7ca87df2530 /extensions | |
parent | df906cf2acffac4a4611f8b34724cdbcda068c74 (diff) |
use SimpleReferenceObject in extensions module
to replace hand-rolled version
Change-Id: Ia983f5b87c55d8e5cce6f388e0f77077b6415745
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/propctrlr/enumrepresentation.hxx | 3 | ||||
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 19 | ||||
-rw-r--r-- | extensions/source/propctrlr/formmetadata.cxx | 20 | ||||
-rw-r--r-- | extensions/source/propctrlr/formmetadata.hxx | 5 | ||||
-rw-r--r-- | extensions/source/propctrlr/genericpropertyhandler.cxx | 23 | ||||
-rw-r--r-- | extensions/source/propctrlr/sqlcommanddesign.hxx | 3 | ||||
-rw-r--r-- | extensions/source/propctrlr/xsddatatypes.cxx | 18 | ||||
-rw-r--r-- | extensions/source/propctrlr/xsddatatypes.hxx | 10 |
8 files changed, 8 insertions, 93 deletions
diff --git a/extensions/source/propctrlr/enumrepresentation.hxx b/extensions/source/propctrlr/enumrepresentation.hxx index 1d56c55dbffb..d2739f172155 100644 --- a/extensions/source/propctrlr/enumrepresentation.hxx +++ b/extensions/source/propctrlr/enumrepresentation.hxx @@ -23,6 +23,7 @@ #include <com/sun/star/uno/Any.hxx> #include <rtl/ref.hxx> #include <rtl/ustring.hxx> +#include <salhelper/simplereferenceobject.hxx> #include <vector> @@ -34,7 +35,7 @@ namespace pcr //= IPropertyEnumRepresentation - class SAL_NO_VTABLE IPropertyEnumRepresentation : public ::rtl::IReference + class SAL_NO_VTABLE IPropertyEnumRepresentation : public salhelper::SimpleReferenceObject { public: /** retrieves all descriptions of all possible values of the enumeration property diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 256317f33b3f..6c44f12ec9fd 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -2968,32 +2968,13 @@ namespace pcr protected: SQLCommandPropertyUI( const Reference< XPropertySet >& _rxObject ) : m_xObject(_rxObject) - , m_refCount(0) { if ( !m_xObject.is() ) throw NullPointerException(); } - virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE - { - return osl_atomic_increment( &m_refCount ); - } - - virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE - { - if ( 0 == osl_atomic_decrement( &m_refCount ) ) - { - delete this; - return 0; - } - return m_refCount; - } - protected: Reference< XPropertySet > m_xObject; - - private: - oslInterlockedCount m_refCount; }; diff --git a/extensions/source/propctrlr/formmetadata.cxx b/extensions/source/propctrlr/formmetadata.cxx index f7278830f034..f9dca526ae4a 100644 --- a/extensions/source/propctrlr/formmetadata.cxx +++ b/extensions/source/propctrlr/formmetadata.cxx @@ -580,8 +580,7 @@ namespace pcr DefaultEnumRepresentation::DefaultEnumRepresentation( const IPropertyInfoService& _rInfo, const Type& _rType, sal_Int32 _nPropertyId ) - :m_refCount( 0 ) - ,m_rMetaData( _rInfo ) + :m_rMetaData( _rInfo ) ,m_aType( _rType ) ,m_nPropertyId( _nPropertyId ) { @@ -666,23 +665,6 @@ namespace pcr } - oslInterlockedCount SAL_CALL DefaultEnumRepresentation::acquire() - { - return osl_atomic_increment( &m_refCount ); - } - - - oslInterlockedCount SAL_CALL DefaultEnumRepresentation::release() - { - if ( 0 == osl_atomic_decrement( &m_refCount ) ) - { - delete this; - return 0; - } - return m_refCount; - } - - } // namespace pcr diff --git a/extensions/source/propctrlr/formmetadata.hxx b/extensions/source/propctrlr/formmetadata.hxx index 3aed7fa86418..28d17eaf169a 100644 --- a/extensions/source/propctrlr/formmetadata.hxx +++ b/extensions/source/propctrlr/formmetadata.hxx @@ -72,7 +72,6 @@ namespace pcr class DefaultEnumRepresentation : public IPropertyEnumRepresentation { private: - oslInterlockedCount m_refCount; const IPropertyInfoService& m_rMetaData; ::com::sun::star::uno::Type m_aType; const sal_Int32 m_nPropertyId; @@ -96,10 +95,6 @@ namespace pcr virtual void SAL_CALL getValueFromDescription( const OUString& _rDescription, ::com::sun::star::uno::Any& _out_rValue ) const SAL_OVERRIDE; virtual OUString SAL_CALL getDescriptionForValue( const ::com::sun::star::uno::Any& _rEnumValue ) const SAL_OVERRIDE; - // IReference implementqation - virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE; - virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE; - private: DefaultEnumRepresentation(); // never implemented DefaultEnumRepresentation( const DefaultEnumRepresentation& ); // never implemented diff --git a/extensions/source/propctrlr/genericpropertyhandler.cxx b/extensions/source/propctrlr/genericpropertyhandler.cxx index e29196bfd3c2..1d15275c2042 100644 --- a/extensions/source/propctrlr/genericpropertyhandler.cxx +++ b/extensions/source/propctrlr/genericpropertyhandler.cxx @@ -66,7 +66,6 @@ namespace pcr public IPropertyEnumRepresentation, private boost::noncopyable { private: - oslInterlockedCount m_refCount; Reference< XEnumTypeDescription > m_xTypeDescription; Type m_aEnumType; @@ -79,17 +78,12 @@ namespace pcr virtual void SAL_CALL getValueFromDescription( const OUString& _rDescription, ::com::sun::star::uno::Any& _out_rValue ) const SAL_OVERRIDE; virtual OUString SAL_CALL getDescriptionForValue( const ::com::sun::star::uno::Any& _rEnumValue ) const SAL_OVERRIDE; - // IReference implementqation - virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE; - virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE; - private: void impl_getValues( Sequence< sal_Int32 >& _out_rValues ) const; }; EnumRepresentation::EnumRepresentation( const Reference< XComponentContext >& _rxContext, const Type& _rEnumType ) - :m_refCount( 0 ) - ,m_aEnumType( _rEnumType ) + :m_aEnumType( _rEnumType ) { try { @@ -180,21 +174,6 @@ namespace pcr return sDescription; } - oslInterlockedCount SAL_CALL EnumRepresentation::acquire() - { - return osl_atomic_increment( &m_refCount ); - } - - oslInterlockedCount SAL_CALL EnumRepresentation::release() - { - if ( 0 == osl_atomic_decrement( &m_refCount ) ) - { - delete this; - return 0; - } - return m_refCount; - } - typedef ::cppu::WeakImplHelper1 < XActionListener > UrlClickHandler_Base; class UrlClickHandler : public UrlClickHandler_Base diff --git a/extensions/source/propctrlr/sqlcommanddesign.hxx b/extensions/source/propctrlr/sqlcommanddesign.hxx index bfd8ba5e526e..c80a7c794d09 100644 --- a/extensions/source/propctrlr/sqlcommanddesign.hxx +++ b/extensions/source/propctrlr/sqlcommanddesign.hxx @@ -31,6 +31,7 @@ #include <tools/link.hxx> #include <cppuhelper/implbase1.hxx> #include <rtl/ref.hxx> +#include <salhelper/simplereferenceobject.hxx> namespace pcr @@ -189,7 +190,7 @@ namespace pcr /** an adapter to forward changed SQL command property values to a component */ - class ISQLCommandAdapter : public ::rtl::IReference + class ISQLCommandAdapter : public salhelper::SimpleReferenceObject { public: /// retrieves the current SQL command of the component diff --git a/extensions/source/propctrlr/xsddatatypes.cxx b/extensions/source/propctrlr/xsddatatypes.cxx index 27c60277371e..18441620a042 100644 --- a/extensions/source/propctrlr/xsddatatypes.cxx +++ b/extensions/source/propctrlr/xsddatatypes.cxx @@ -51,7 +51,6 @@ namespace pcr XSDDataType::XSDDataType( const Reference< XDataType >& _rxDataType ) :m_xDataType( _rxDataType ) - ,m_refCount( 0 ) { DBG_ASSERT( m_xDataType.is(), "XSDDataType::XSDDataType: invalid UNO object!" ); if ( m_xDataType.is() ) @@ -59,23 +58,6 @@ namespace pcr } - oslInterlockedCount SAL_CALL XSDDataType::acquire() - { - return osl_atomic_increment( &m_refCount ); - } - - - oslInterlockedCount SAL_CALL XSDDataType::release() - { - if ( 0 == osl_atomic_decrement( &m_refCount ) ) - { - delete this; - return 0; - } - return m_refCount; - } - - XSDDataType::~XSDDataType() { } diff --git a/extensions/source/propctrlr/xsddatatypes.hxx b/extensions/source/propctrlr/xsddatatypes.hxx index 1cd2ee3d40a7..431efbfcce3e 100644 --- a/extensions/source/propctrlr/xsddatatypes.hxx +++ b/extensions/source/propctrlr/xsddatatypes.hxx @@ -22,6 +22,7 @@ #include <com/sun/star/uno/Reference.hxx> #include <rtl/ref.hxx> +#include <salhelper/simplereferenceobject.hxx> namespace com { namespace sun { namespace star { namespace xsd { @@ -40,7 +41,7 @@ namespace pcr //= XSDDataType - class XSDDataType : public ::rtl::IReference + class XSDDataType : public salhelper::SimpleReferenceObject { private: ::com::sun::star::uno::Reference< ::com::sun::star::xsd::XDataType > @@ -49,9 +50,6 @@ namespace pcr m_xFacetInfo; protected: - oslInterlockedCount m_refCount; - - protected: inline ::com::sun::star::xsd::XDataType* getDataTypeInterface() const { return m_xDataType.get(); } public: @@ -59,10 +57,6 @@ namespace pcr const ::com::sun::star::uno::Reference< ::com::sun::star::xsd::XDataType >& _rxDataType ); - // IReference - virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE; - virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE; - /// retrieves the underlying UNO component inline const ::com::sun::star::uno::Reference< ::com::sun::star::xsd::XDataType >& getUnoDataType() const { return m_xDataType; } |