From 098c1e495ee87f0674018fd18c77a3a1abef698d Mon Sep 17 00:00:00 2001 From: kerem Date: Mon, 8 Feb 2016 16:09:56 +0200 Subject: tdf#88462 convert manual XInterface implementations Change-Id: I00561b7a6de6265cfdea0e3a92f404fac86982f6 Reviewed-on: https://gerrit.libreoffice.org/22213 Tested-by: Jenkins Reviewed-by: Lionel Elie Mamane Reviewed-by: Stephan Bergmann --- .../source/drivers/postgresql/pq_baseresultset.cxx | 42 +++++++--------------- .../source/drivers/postgresql/pq_baseresultset.hxx | 19 +++++----- 2 files changed, 23 insertions(+), 38 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx index dc4e13371dff..f8ce6ce78694 100644 --- a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx @@ -41,6 +41,8 @@ #include #include +#include + #include "pq_tools.hxx" #include "pq_array.hxx" #include "pq_statement.hxx" @@ -138,8 +140,8 @@ BaseResultSet::BaseResultSet( sal_Int32 rowCount, sal_Int32 colCount, const Reference< com::sun::star::script::XTypeConverter > & tc ) - : OComponentHelper( refMutex->mutex ) - , OPropertySetHelper( OComponentHelper::rBHelper ) + : BaseResultSet_BASE( refMutex->mutex ) + , OPropertySetHelper( BaseResultSet_BASE::rBHelper ) , m_owner( owner ) , m_tc( tc ) , m_refMutex( refMutex ) @@ -159,22 +161,10 @@ BaseResultSet::~BaseResultSet() POSTGRE_TRACE( "dtor BaseResultSet" ); } -Any BaseResultSet::queryInterface( const Type & reqType ) throw (RuntimeException, std::exception) +Any BaseResultSet::queryInterface( const Type & rType ) throw (RuntimeException, std::exception) { - Any ret; - - ret = OComponentHelper::queryInterface( reqType ); - if( ! ret.hasValue() ) - ret = ::cppu::queryInterface( reqType, - static_cast< XResultSet * > ( this ), - static_cast< XResultSetMetaDataSupplier * > ( this ), - static_cast< XRow * > ( this ), - static_cast< XColumnLocate * > ( this ), - static_cast< XCloseable * > ( this ), - static_cast< XPropertySet * > ( this ), - static_cast< XMultiPropertySet * > ( this ), - static_cast< XFastPropertySet * > ( this ) ); - return ret; + Any aRet = BaseResultSet_BASE::queryInterface(rType); + return aRet.hasValue() ? aRet : OPropertySetHelper::queryInterface(rType); } // void BaseResultSet::close( ) throw (SQLException, RuntimeException) @@ -195,26 +185,20 @@ Any BaseResultSet::queryInterface( const Type & reqType ) throw (RuntimeExceptio Sequence BaseResultSet::getTypes() throw( RuntimeException, std::exception ) { - static cppu::OTypeCollection *pCollection; + static Sequence< Type > *pCollection; if( ! pCollection ) { MutexGuard guard( osl::Mutex::getGlobalMutex() ); if( !pCollection ) { - static cppu::OTypeCollection collection( - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - OComponentHelper::getTypes()); + static Sequence< Type > collection( + ::comphelper::concatSequences( + OPropertySetHelper::getTypes(), + BaseResultSet_BASE::getTypes())); pCollection = &collection; } } - return pCollection->getTypes(); + return *pCollection; } Sequence< sal_Int8> BaseResultSet::getImplementationId() throw( RuntimeException, std::exception ) diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.hxx b/connectivity/source/drivers/postgresql/pq_baseresultset.hxx index aad0fbd6c81d..340126b009f6 100644 --- a/connectivity/source/drivers/postgresql/pq_baseresultset.hxx +++ b/connectivity/source/drivers/postgresql/pq_baseresultset.hxx @@ -59,13 +59,14 @@ static const sal_Int32 BASERESULTSET_RESULT_SET_TYPE = 6; #define BASERESULTSET_SIZE 7 -class BaseResultSet : public cppu::OComponentHelper, - public cppu::OPropertySetHelper, - public com::sun::star::sdbc::XCloseable, - public com::sun::star::sdbc::XResultSetMetaDataSupplier, - public com::sun::star::sdbc::XResultSet, - public com::sun::star::sdbc::XRow, - public com::sun::star::sdbc::XColumnLocate +typedef ::cppu::WeakComponentImplHelper< ::com::sun::star::sdbc::XCloseable, + ::com::sun::star::sdbc::XResultSetMetaDataSupplier, + ::com::sun::star::sdbc::XResultSet, + ::com::sun::star::sdbc::XRow, + ::com::sun::star::sdbc::XColumnLocate + > BaseResultSet_BASE; +class BaseResultSet : public BaseResultSet_BASE, + public cppu::OPropertySetHelper { protected: com::sun::star::uno::Any m_props[BASERESULTSET_SIZE]; @@ -100,8 +101,8 @@ protected: virtual ~BaseResultSet(); public: // XInterface - virtual void SAL_CALL acquire() throw() override { OComponentHelper::acquire(); } - virtual void SAL_CALL release() throw() override { OComponentHelper::release(); } + virtual void SAL_CALL acquire() throw() override { BaseResultSet_BASE::acquire(); } + virtual void SAL_CALL release() throw() override { BaseResultSet_BASE::release(); } virtual com::sun::star::uno::Any SAL_CALL queryInterface( const com::sun::star::uno::Type & reqType ) throw (com::sun::star::uno::RuntimeException, std::exception) override; -- cgit