diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2015-01-15 12:45:45 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-01-15 13:01:00 +0000 |
commit | 79b5bf5cab66efbec81f9eac4e023af4f5f5141f (patch) | |
tree | a95b173bdc4977c1655af1d23def43a4265837b4 /connectivity/source/drivers/postgresql/pq_statement.cxx | |
parent | 658be21de31427e73bc6f87704869aa80012134f (diff) |
PostgreSQL statement: use :cppu::WeakComponentImplHelper
Change-Id: I081d375b0249a3b0e47c1dd6db3f86fef272e7fd
Reviewed-on: https://gerrit.libreoffice.org/13925
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'connectivity/source/drivers/postgresql/pq_statement.cxx')
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_statement.cxx | 43 |
1 files changed, 13 insertions, 30 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx index 9b5fbe5c25b0..2bbec00f2e8e 100644 --- a/connectivity/source/drivers/postgresql/pq_statement.cxx +++ b/connectivity/source/drivers/postgresql/pq_statement.cxx @@ -49,6 +49,8 @@ #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/queryinterface.hxx> +#include <comphelper/sequence.hxx> + #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/sdbc/ResultSetConcurrency.hpp> @@ -157,8 +159,8 @@ static ::cppu::IPropertyArrayHelper & getStatementPropertyArrayHelper() Statement::Statement( const ::rtl::Reference< RefCountedMutex > & refMutex, const Reference< XConnection > & conn, struct ConnectionSettings *pSettings ) - : OComponentHelper( refMutex->mutex ) - , OPropertySetHelper( OComponentHelper::rBHelper ) + : Statement_BASE( refMutex->mutex ) + , OPropertySetHelper( Statement_BASE::rBHelper ) , m_connection( conn ) , m_pSettings( pSettings ) , m_refMutex( refMutex ) @@ -187,48 +189,29 @@ void Statement::checkClosed() throw (SQLException, RuntimeException ) *this, OUString(),1,Any()); } -Any Statement::queryInterface( const Type & reqType ) throw (RuntimeException, std::exception) +Any Statement::queryInterface( const Type & rType ) throw (RuntimeException, std::exception) { - Any ret; - - ret = OComponentHelper::queryInterface( reqType ); - if( ! ret.hasValue() ) - ret = ::cppu::queryInterface( reqType, - static_cast< XWarningsSupplier * > ( this ), - static_cast< XStatement * > ( this ), - static_cast< com::sun::star::sdbc::XResultSetMetaDataSupplier * > ( this ), - static_cast< XCloseable * > ( this ), - static_cast< XPropertySet * > ( this ), - static_cast< XMultipleResults * > ( this ), - static_cast< XMultiPropertySet * > ( this ), - static_cast< XGeneratedResultSet * > ( this ), - static_cast< XFastPropertySet * > ( this ) ); - return ret; + Any aRet = Statement_BASE::queryInterface(rType); + return aRet.hasValue() ? aRet : OPropertySetHelper::queryInterface(rType); } Sequence< Type > Statement::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<XWarningsSupplier>::get(), - cppu::UnoType<XStatement>::get(), - cppu::UnoType<com::sun::star::sdbc::XResultSetMetaDataSupplier>::get(), - cppu::UnoType<XCloseable>::get(), - cppu::UnoType<XPropertySet>::get(), - cppu::UnoType<XFastPropertySet>::get(), - cppu::UnoType<XMultiPropertySet>::get(), - cppu::UnoType<XGeneratedResultSet>::get(), - OComponentHelper::getTypes()); + static Sequence< Type > collection( + ::comphelper::concatSequences( + OPropertySetHelper::getTypes(), + Statement_BASE::getTypes())); pCollection = &collection; } } - return pCollection->getTypes(); + return *pCollection; } Sequence< sal_Int8> Statement::getImplementationId() throw ( RuntimeException, std::exception ) |