summaryrefslogtreecommitdiffstats
path: root/connectivity
diff options
context:
space:
mode:
authorkerem <hallackerem@gmail.com>2016-02-08 16:09:56 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-02-09 10:02:32 +0000
commit098c1e495ee87f0674018fd18c77a3a1abef698d (patch)
treec018712b6adff5b529495fa6b1c248bc30c9be62 /connectivity
parentgtk3: endless trudge as gtk changes theming yet again (diff)
downloadcore-098c1e495ee87f0674018fd18c77a3a1abef698d.tar.gz
core-098c1e495ee87f0674018fd18c77a3a1abef698d.zip
tdf#88462 convert manual XInterface implementations
Change-Id: I00561b7a6de6265cfdea0e3a92f404fac86982f6 Reviewed-on: https://gerrit.libreoffice.org/22213 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/postgresql/pq_baseresultset.cxx42
-rw-r--r--connectivity/source/drivers/postgresql/pq_baseresultset.hxx19
2 files changed, 23 insertions, 38 deletions
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 <cppuhelper/typeprovider.hxx>
#include <cppuhelper/queryinterface.hxx>
+#include <comphelper/sequence.hxx>
+
#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<Type > 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<XResultSet>::get(),
- cppu::UnoType<XResultSetMetaDataSupplier>::get(),
- cppu::UnoType<XRow>::get(),
- cppu::UnoType<XColumnLocate>::get(),
- cppu::UnoType<XCloseable>::get(),
- cppu::UnoType<XPropertySet>::get(),
- cppu::UnoType<XFastPropertySet>::get(),
- cppu::UnoType<XMultiPropertySet>::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;