summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/ado
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-09-07 00:15:12 +0300
committerArkadiy Illarionov <qarkai@gmail.com>2019-09-07 00:05:26 +0200
commit03747db026a5b4959ec0700d9addf0482e6f5977 (patch)
tree06e20de1f6e7d80f52de021936807c5832f0acc3 /connectivity/source/drivers/ado
parent6c5a9db12e34cdf9d55312711b5a1d63c5ff812d (diff)
tdf#39593 use isUnoTunnelId in connectivity
Change-Id: I458049e23e9fc1855cb4ba9519b9b940f170b024 Reviewed-on: https://gerrit.libreoffice.org/78732 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'connectivity/source/drivers/ado')
-rw-r--r--connectivity/source/drivers/ado/AColumn.cxx5
-rw-r--r--connectivity/source/drivers/ado/AConnection.cxx5
-rw-r--r--connectivity/source/drivers/ado/ADriver.cxx2
-rw-r--r--connectivity/source/drivers/ado/AGroup.cxx5
-rw-r--r--connectivity/source/drivers/ado/AIndex.cxx5
-rw-r--r--connectivity/source/drivers/ado/AKey.cxx5
-rw-r--r--connectivity/source/drivers/ado/ATable.cxx5
-rw-r--r--connectivity/source/drivers/ado/AUser.cxx5
-rw-r--r--connectivity/source/drivers/ado/AView.cxx5
9 files changed, 25 insertions, 17 deletions
diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx
index 236d758760d1..c7d5a5fce5c2 100644
--- a/connectivity/source/drivers/ado/AColumn.cxx
+++ b/connectivity/source/drivers/ado/AColumn.cxx
@@ -23,6 +23,7 @@
#include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <comphelper/extract.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <ado/ACatalog.hxx>
@@ -74,7 +75,7 @@ OAdoColumn::OAdoColumn(bool _bCase,OConnection* _pConnection)
}
-Sequence< sal_Int8 > OAdoColumn::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OAdoColumn::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -85,7 +86,7 @@ Sequence< sal_Int8 > OAdoColumn::getUnoTunnelImplementationId()
sal_Int64 OAdoColumn::getSomething( const Sequence< sal_Int8 > & rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return isUnoTunnelId<OAdoColumn>(rId)
? reinterpret_cast< sal_Int64 >( this )
: OColumn_ADO::getSomething(rId);
}
diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx
index 32e0bcd4d2b6..c9251a9be88b 100644
--- a/connectivity/source/drivers/ado/AConnection.cxx
+++ b/connectivity/source/drivers/ado/AConnection.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/sdbc/TransactionIsolation.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <connectivity/dbexception.hxx>
#include <osl/file.hxx>
@@ -487,14 +488,14 @@ void OConnection::disposing()
sal_Int64 SAL_CALL OConnection::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return isUnoTunnelId<OConnection>(rId)
?
reinterpret_cast< sal_Int64 >( this )
:
OConnection_BASE::getSomething(rId);
}
-Sequence< sal_Int8 > OConnection::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OConnection::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx
index d97d018bc202..eae5ee686996 100644
--- a/connectivity/source/drivers/ado/ADriver.cxx
+++ b/connectivity/source/drivers/ado/ADriver.cxx
@@ -199,7 +199,7 @@ Reference< XTablesSupplier > SAL_CALL ODriver::getDataDefinitionByConnection( co
Reference< css::lang::XUnoTunnel> xTunnel(connection,UNO_QUERY);
if(xTunnel.is())
{
- OConnection* pSearchConnection = reinterpret_cast< OConnection* >( xTunnel->getSomething(OConnection::getUnoTunnelImplementationId()) );
+ OConnection* pSearchConnection = reinterpret_cast< OConnection* >( xTunnel->getSomething(OConnection::getUnoTunnelId()) );
auto foundConnection = std::any_of(m_xConnections.begin(), m_xConnections.end(),
[&pSearchConnection](const css::uno::WeakReferenceHelper& rxConnection) {
diff --git a/connectivity/source/drivers/ado/AGroup.cxx b/connectivity/source/drivers/ado/AGroup.cxx
index 0b251a6f2cf3..b41fbdbba05d 100644
--- a/connectivity/source/drivers/ado/AGroup.cxx
+++ b/connectivity/source/drivers/ado/AGroup.cxx
@@ -20,6 +20,7 @@
#include <ado/AGroup.hxx>
#include <ado/AUsers.hxx>
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
@@ -81,7 +82,7 @@ void OAdoGroup::refreshUsers()
m_pUsers.reset(new OUsers(m_pCatalog, m_aMutex, aVector, aUsers, isCaseSensitive()));
}
-Sequence< sal_Int8 > OAdoGroup::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OAdoGroup::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -92,7 +93,7 @@ Sequence< sal_Int8 > OAdoGroup::getUnoTunnelImplementationId()
sal_Int64 OAdoGroup::getSomething( const Sequence< sal_Int8 > & rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return isUnoTunnelId<OAdoGroup>(rId)
? reinterpret_cast< sal_Int64 >( this )
: OGroup_ADO::getSomething(rId);
}
diff --git a/connectivity/source/drivers/ado/AIndex.cxx b/connectivity/source/drivers/ado/AIndex.cxx
index 0888fa1bf2b8..61a047bc9b00 100644
--- a/connectivity/source/drivers/ado/AIndex.cxx
+++ b/connectivity/source/drivers/ado/AIndex.cxx
@@ -23,6 +23,7 @@
#include <cppuhelper/typeprovider.hxx>
#include <ado/AColumns.hxx>
#include <TConnection.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
using namespace ::comphelper;
@@ -70,7 +71,7 @@ void OAdoIndex::refreshColumns()
}
-Sequence< sal_Int8 > OAdoIndex::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OAdoIndex::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -81,7 +82,7 @@ Sequence< sal_Int8 > OAdoIndex::getUnoTunnelImplementationId()
sal_Int64 OAdoIndex::getSomething( const Sequence< sal_Int8 > & rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return isUnoTunnelId<OAdoIndex>(rId)
? reinterpret_cast< sal_Int64 >( this )
: sdbcx::OIndex::getSomething(rId);
}
diff --git a/connectivity/source/drivers/ado/AKey.cxx b/connectivity/source/drivers/ado/AKey.cxx
index 25ffeb6eece6..764765b35620 100644
--- a/connectivity/source/drivers/ado/AKey.cxx
+++ b/connectivity/source/drivers/ado/AKey.cxx
@@ -20,6 +20,7 @@
#include <ado/AKey.hxx>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <ado/AColumns.hxx>
#include <ado/AConnection.hxx>
@@ -66,7 +67,7 @@ void OAdoKey::refreshColumns()
m_pColumns.reset(new OColumns(*this, m_aMutex, aVector, aColumns, isCaseSensitive(), m_pConnection));
}
-Sequence< sal_Int8 > OAdoKey::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OAdoKey::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -77,7 +78,7 @@ Sequence< sal_Int8 > OAdoKey::getUnoTunnelImplementationId()
sal_Int64 OAdoKey::getSomething( const Sequence< sal_Int8 > & rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return isUnoTunnelId<OAdoKey>(rId)
? reinterpret_cast< sal_Int64 >( this )
: OKey_ADO::getSomething(rId);
}
diff --git a/connectivity/source/drivers/ado/ATable.cxx b/connectivity/source/drivers/ado/ATable.cxx
index 34597d55fff5..807dbb19055c 100644
--- a/connectivity/source/drivers/ado/ATable.cxx
+++ b/connectivity/source/drivers/ado/ATable.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <ado/Awrapado.hxx>
#include <TConnection.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
using namespace ::comphelper;
@@ -123,7 +124,7 @@ void OAdoTable::refreshIndexes()
m_xIndexes = new OIndexes(*this,m_aMutex,aVector,aIndexes,isCaseSensitive(),m_pCatalog->getConnection());
}
-Sequence< sal_Int8 > OAdoTable::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OAdoTable::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -134,7 +135,7 @@ Sequence< sal_Int8 > OAdoTable::getUnoTunnelImplementationId()
sal_Int64 OAdoTable::getSomething( const Sequence< sal_Int8 > & rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return isUnoTunnelId<OAdoTable>(rId)
? reinterpret_cast< sal_Int64 >( this )
: OTable_TYPEDEF::getSomething(rId);
}
diff --git a/connectivity/source/drivers/ado/AUser.cxx b/connectivity/source/drivers/ado/AUser.cxx
index 4e595de36bac..724334cea696 100644
--- a/connectivity/source/drivers/ado/AUser.cxx
+++ b/connectivity/source/drivers/ado/AUser.cxx
@@ -20,6 +20,7 @@
#include <ado/AUser.hxx>
#include <ado/ACatalog.hxx>
#include <ado/AGroups.hxx>
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
@@ -65,7 +66,7 @@ void OAdoUser::refreshGroups()
m_pGroups.reset(new OGroups(m_pCatalog, m_aMutex, aVector, aGroups, isCaseSensitive()));
}
-Sequence< sal_Int8 > OAdoUser::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OAdoUser::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -76,7 +77,7 @@ Sequence< sal_Int8 > OAdoUser::getUnoTunnelImplementationId()
sal_Int64 OAdoUser::getSomething( const Sequence< sal_Int8 > & rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return isUnoTunnelId<OAdoUser>(rId)
? reinterpret_cast< sal_Int64 >( this )
: OUser_TYPEDEF::getSomething(rId);
}
diff --git a/connectivity/source/drivers/ado/AView.cxx b/connectivity/source/drivers/ado/AView.cxx
index c2f0bc86d601..b53c1a026200 100644
--- a/connectivity/source/drivers/ado/AView.cxx
+++ b/connectivity/source/drivers/ado/AView.cxx
@@ -22,6 +22,7 @@
#include <ado/adoimp.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <ado/Awrapado.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <TConnection.hxx>
@@ -40,7 +41,7 @@ OAdoView::OAdoView(bool _bCase,ADOView* _pView) : OView_ADO(_bCase,nullptr)
{
}
-Sequence< sal_Int8 > OAdoView::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OAdoView::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -51,7 +52,7 @@ Sequence< sal_Int8 > OAdoView::getUnoTunnelImplementationId()
sal_Int64 OAdoView::getSomething( const Sequence< sal_Int8 > & rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return isUnoTunnelId<OAdoView>(rId)
? reinterpret_cast< sal_Int64 >( this )
: OView_ADO::getSomething(rId);
}