summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-09-06 00:50:24 +0300
committerStephan Bergmann <sbergman@redhat.com>2019-09-06 11:55:50 +0200
commitf599c31fe68882f510cf3d101102e71f9bf795c8 (patch)
treeced0a58620c5aea8420638847192f298d139297b /connectivity
parent8811516e2e9e71dd45198081d26c748cdf4d831a (diff)
tdf#39593 use isUnoTunnelId
Adapt getUnoTunnelId methods where required: rename or make public. Change-Id: I0fd2120bf9f0ff1aa690329a65ff64a154c89315 Reviewed-on: https://gerrit.libreoffice.org/78680 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/ConnectionWrapper.cxx5
-rw-r--r--connectivity/source/commontools/TConnection.cxx5
-rw-r--r--connectivity/source/drivers/calc/CTable.cxx5
-rw-r--r--connectivity/source/drivers/dbase/DDatabaseMetaData.cxx2
-rw-r--r--connectivity/source/drivers/dbase/DIndex.cxx5
-rw-r--r--connectivity/source/drivers/dbase/DIndexes.cxx4
-rw-r--r--connectivity/source/drivers/dbase/DResultSet.cxx2
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx11
-rw-r--r--connectivity/source/drivers/dbase/DTables.cxx4
-rw-r--r--connectivity/source/drivers/file/FConnection.cxx5
-rw-r--r--connectivity/source/drivers/file/FDriver.cxx2
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx5
-rw-r--r--connectivity/source/drivers/hsqldb/HDriver.cxx2
-rw-r--r--connectivity/source/drivers/hsqldb/HTable.cxx5
-rw-r--r--connectivity/source/drivers/mysql_jdbc/YDriver.cxx4
-rw-r--r--connectivity/source/drivers/mysql_jdbc/YTable.cxx9
-rw-r--r--connectivity/source/drivers/writer/WTable.cxx9
-rw-r--r--connectivity/source/inc/TConnection.hxx2
-rw-r--r--connectivity/source/inc/calc/CTable.hxx2
-rw-r--r--connectivity/source/inc/dbase/DIndex.hxx2
-rw-r--r--connectivity/source/inc/dbase/DTable.hxx2
-rw-r--r--connectivity/source/inc/file/FConnection.hxx2
-rw-r--r--connectivity/source/inc/flat/ETable.hxx2
-rw-r--r--connectivity/source/inc/hsqldb/HTable.hxx2
-rw-r--r--connectivity/source/inc/mysql/YTable.hxx2
-rw-r--r--connectivity/source/inc/writer/WTable.hxx2
-rw-r--r--connectivity/source/sdbcx/VDescriptor.cxx2
27 files changed, 55 insertions, 49 deletions
diff --git a/connectivity/source/commontools/ConnectionWrapper.cxx b/connectivity/source/commontools/ConnectionWrapper.cxx
index e5a10447316e..fba26d8937ae 100644
--- a/connectivity/source/commontools/ConnectionWrapper.cxx
+++ b/connectivity/source/commontools/ConnectionWrapper.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <comphelper/uno3.hxx>
#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/hash.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
@@ -157,7 +158,7 @@ Sequence< Type > SAL_CALL OConnectionWrapper::getTypes( )
// css::lang::XUnoTunnel
sal_Int64 SAL_CALL OConnectionWrapper::getSomething( const Sequence< sal_Int8 >& rId )
{
- if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ if (isUnoTunnelId<OConnectionWrapper>(rId))
return reinterpret_cast< sal_Int64 >( this );
if(m_xUnoTunnel.is())
@@ -166,7 +167,7 @@ sal_Int64 SAL_CALL OConnectionWrapper::getSomething( const Sequence< sal_Int8 >&
}
-Sequence< sal_Int8 > OConnectionWrapper::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OConnectionWrapper::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
diff --git a/connectivity/source/commontools/TConnection.cxx b/connectivity/source/commontools/TConnection.cxx
index 779ea853520f..255776a3ceb4 100644
--- a/connectivity/source/commontools/TConnection.cxx
+++ b/connectivity/source/commontools/TConnection.cxx
@@ -20,6 +20,7 @@
#include <string.h>
#include <TConnection.hxx>
#include <cppuhelper/typeprovider.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
@@ -57,12 +58,12 @@ void OMetaConnection::disposing()
//XUnoTunnel
sal_Int64 SAL_CALL OMetaConnection::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return (isUnoTunnelId<OMetaConnection>(rId))
? reinterpret_cast< sal_Int64 >( this )
: sal_Int64(0);
}
-Sequence< sal_Int8 > OMetaConnection::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OMetaConnection::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
index ef9e0951670e..004b0af38232 100644
--- a/connectivity/source/drivers/calc/CTable.cxx
+++ b/connectivity/source/drivers/calc/CTable.cxx
@@ -46,6 +46,7 @@
#include <rtl/math.hxx>
#include <connectivity/dbexception.hxx>
#include <connectivity/dbconversion.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <cppuhelper/typeprovider.hxx>
@@ -617,7 +618,7 @@ void SAL_CALL OCalcTable::disposing()
}
-Sequence< sal_Int8 > OCalcTable::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OCalcTable::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -628,7 +629,7 @@ Sequence< sal_Int8 > OCalcTable::getUnoTunnelImplementationId()
sal_Int64 OCalcTable::getSomething( const Sequence< sal_Int8 > & rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return (isUnoTunnelId<OCalcTable>(rId))
? reinterpret_cast< sal_Int64 >( this )
: OCalcTable_BASE::getSomething(rId);
}
diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
index 0f40fe79ca6e..1db65083b06a 100644
--- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
@@ -299,7 +299,7 @@ Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getIndexInfo(
Reference< XUnoTunnel> xTunnel(xIndex,UNO_QUERY);
if(xTunnel.is())
{
- ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
+ ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelId()) );
if(pIndex)
{
aRow[11] = new ORowSetValueDecorator(static_cast<sal_Int32>(pIndex->getHeader().db_maxkeys));
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index 23a5d28f9fd9..ee77ea8b2e6f 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/sdbcx/XRowLocate.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <unotools/ucbhelper.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <connectivity/dbexception.hxx>
@@ -104,7 +105,7 @@ void ODbaseIndex::refreshColumns()
m_pColumns.reset(new ODbaseIndexColumns(this,m_aMutex,aVector));
}
-Sequence< sal_Int8 > ODbaseIndex::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > ODbaseIndex::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -115,7 +116,7 @@ Sequence< sal_Int8 > ODbaseIndex::getUnoTunnelImplementationId()
sal_Int64 ODbaseIndex::getSomething( const Sequence< sal_Int8 > & rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return (isUnoTunnelId<ODbaseIndex>(rId))
? reinterpret_cast< sal_Int64 >( this )
: ODbaseIndex_BASE::getSomething(rId);
}
diff --git a/connectivity/source/drivers/dbase/DIndexes.cxx b/connectivity/source/drivers/dbase/DIndexes.cxx
index 416e05eaa576..3758330b9f3c 100644
--- a/connectivity/source/drivers/dbase/DIndexes.cxx
+++ b/connectivity/source/drivers/dbase/DIndexes.cxx
@@ -94,7 +94,7 @@ sdbcx::ObjectType ODbaseIndexes::appendObject( const OUString& _rForName, const
Reference<XUnoTunnel> xTunnel(descriptor,UNO_QUERY);
if(xTunnel.is())
{
- ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
+ ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelId()) );
if(!pIndex)
throw SQLException();
pIndex->CreateImpl();
@@ -109,7 +109,7 @@ void ODbaseIndexes::dropObject(sal_Int32 _nPos, const OUString& /*_sElementName*
Reference< XUnoTunnel> xTunnel(getObject(_nPos),UNO_QUERY);
if ( xTunnel.is() )
{
- ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
+ ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelId()) );
if ( pIndex )
pIndex->DropImpl();
}
diff --git a/connectivity/source/drivers/dbase/DResultSet.cxx b/connectivity/source/drivers/dbase/DResultSet.cxx
index 572eaa27d69c..260e009611fc 100644
--- a/connectivity/source/drivers/dbase/DResultSet.cxx
+++ b/connectivity/source/drivers/dbase/DResultSet.cxx
@@ -158,7 +158,7 @@ bool ODbaseResultSet::fillIndexValues(const Reference< XColumnsSupplier> &_xInde
Reference<XUnoTunnel> xTunnel(_xIndex,UNO_QUERY);
if(xTunnel.is())
{
- dbase::ODbaseIndex* pIndex = reinterpret_cast< dbase::ODbaseIndex* >( xTunnel->getSomething(dbase::ODbaseIndex::getUnoTunnelImplementationId()) );
+ dbase::ODbaseIndex* pIndex = reinterpret_cast< dbase::ODbaseIndex* >( xTunnel->getSomething(dbase::ODbaseIndex::getUnoTunnelId()) );
if(pIndex)
{
std::unique_ptr<dbase::OIndexIterator> pIter = pIndex->createIterator();
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 9cfee8f0b8af..3f91c546fb2d 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <comphelper/property.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/string.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/ucbhelper.hxx>
@@ -733,7 +734,7 @@ Any SAL_CALL ODbaseTable::queryInterface( const Type & rType )
}
-Sequence< sal_Int8 > ODbaseTable::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > ODbaseTable::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -744,7 +745,7 @@ Sequence< sal_Int8 > ODbaseTable::getUnoTunnelImplementationId()
sal_Int64 ODbaseTable::getSomething( const Sequence< sal_Int8 > & rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return (isUnoTunnelId<ODbaseTable>(rId))
? reinterpret_cast< sal_Int64 >( this )
: ODbaseTable_BASE::getSomething(rId);
}
@@ -1567,7 +1568,7 @@ bool ODbaseTable::DeleteRow(const OSQLColumns& _rCols)
Reference<XUnoTunnel> xTunnel(xIndex,UNO_QUERY);
OSL_ENSURE(xTunnel.is(),"No TunnelImplementation!");
- ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
+ ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelId()) );
OSL_ENSURE(pIndex,"ODbaseTable::DeleteRow: No Index returned!");
OSQLColumns::Vector::const_iterator aIter = std::find_if(_rCols.get().begin(), _rCols.get().end(),
@@ -1673,7 +1674,7 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, const OValueRefRow& pOrgRo
{
Reference<XUnoTunnel> xTunnel(xIndex,UNO_QUERY);
OSL_ENSURE(xTunnel.is(),"No TunnelImplementation!");
- ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
+ ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelId()) );
OSL_ENSURE(pIndex,"ODbaseTable::UpdateBuffer: No Index returned!");
if (pIndex->Find(0,*rRow.get()[nPos]))
@@ -1781,7 +1782,7 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, const OValueRefRow& pOrgRo
{
Reference<XUnoTunnel> xTunnel(aIndexedCols[i],UNO_QUERY);
OSL_ENSURE(xTunnel.is(),"No TunnelImplementation!");
- ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
+ ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelId()) );
OSL_ENSURE(pIndex,"ODbaseTable::UpdateBuffer: No Index returned!");
// Update !!
if (pOrgRow.is() && !thisColIsNull)
diff --git a/connectivity/source/drivers/dbase/DTables.cxx b/connectivity/source/drivers/dbase/DTables.cxx
index 99c192dd2751..d72061b4538f 100644
--- a/connectivity/source/drivers/dbase/DTables.cxx
+++ b/connectivity/source/drivers/dbase/DTables.cxx
@@ -72,7 +72,7 @@ sdbcx::ObjectType ODbaseTables::appendObject( const OUString& _rForName, const R
Reference<XUnoTunnel> xTunnel(descriptor,UNO_QUERY);
if(xTunnel.is())
{
- ODbaseTable* pTable = reinterpret_cast< ODbaseTable* >( xTunnel->getSomething(ODbaseTable::getUnoTunnelImplementationId()) );
+ ODbaseTable* pTable = reinterpret_cast< ODbaseTable* >( xTunnel->getSomething(ODbaseTable::getUnoTunnelId()) );
if(pTable)
{
pTable->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME),makeAny(_rForName));
@@ -111,7 +111,7 @@ void ODbaseTables::dropObject(sal_Int32 _nPos, const OUString& _sElementName)
if ( xTunnel.is() )
{
- ODbaseTable* pTable = reinterpret_cast< ODbaseTable* >( xTunnel->getSomething(ODbaseTable::getUnoTunnelImplementationId()) );
+ ODbaseTable* pTable = reinterpret_cast< ODbaseTable* >( xTunnel->getSomething(ODbaseTable::getUnoTunnelId()) );
if(pTable)
pTable->DropImpl();
}
diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx
index afa6cc598668..3eeea6735f1e 100644
--- a/connectivity/source/drivers/file/FConnection.cxx
+++ b/connectivity/source/drivers/file/FConnection.cxx
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <file/FConnection.hxx>
#include <file/FDatabaseMetaData.hxx>
@@ -405,12 +406,12 @@ Reference< XDynamicResultSet > OConnection::getDir() const
sal_Int64 SAL_CALL OConnection::getSomething( const Sequence< sal_Int8 >& rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return (isUnoTunnelId<OConnection>(rId))
? reinterpret_cast< sal_Int64 >( this )
: sal_Int64(0);
}
-Sequence< sal_Int8 > OConnection::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OConnection::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
diff --git a/connectivity/source/drivers/file/FDriver.cxx b/connectivity/source/drivers/file/FDriver.cxx
index 25ccc578f959..367fd1f3416c 100644
--- a/connectivity/source/drivers/file/FDriver.cxx
+++ b/connectivity/source/drivers/file/FDriver.cxx
@@ -189,7 +189,7 @@ Reference< XTablesSupplier > SAL_CALL OFileDriver::getDataDefinitionByConnection
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()) );
OConnection* pConnection = nullptr;
for (auto const& elem : m_xConnections)
{
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index b535c35ae627..bc978bcc3599 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -34,6 +34,7 @@
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/numbers.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <flat/EDriver.hxx>
#include <com/sun/star/util/NumberFormat.hpp>
@@ -553,7 +554,7 @@ Any SAL_CALL OFlatTable::queryInterface( const Type & rType )
}
-Sequence< sal_Int8 > OFlatTable::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OFlatTable::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -564,7 +565,7 @@ Sequence< sal_Int8 > OFlatTable::getUnoTunnelImplementationId()
sal_Int64 OFlatTable::getSomething( const Sequence< sal_Int8 > & rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return (isUnoTunnelId<OFlatTable>(rId))
? reinterpret_cast< sal_Int64 >( this )
: OFlatTable_BASE::getSomething(rId);
}
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index e7811fdac811..5ab48b138a1e 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -345,7 +345,7 @@ namespace connectivity
Reference< XUnoTunnel> xTunnel(xOrig,UNO_QUERY);
if ( xTunnel.is() )
{
- OMetaConnection* pMetaConnection = reinterpret_cast<OMetaConnection*>(xTunnel->getSomething( OMetaConnection::getUnoTunnelImplementationId() ));
+ OMetaConnection* pMetaConnection = reinterpret_cast<OMetaConnection*>(xTunnel->getSomething( OMetaConnection::getUnoTunnelId() ));
if ( pMetaConnection )
pMetaConnection->setURL(url);
}
diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx
index b7a841a76ff4..ab7d95812f40 100644
--- a/connectivity/source/drivers/hsqldb/HTable.cxx
+++ b/connectivity/source/drivers/hsqldb/HTable.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <com/sun/star/sdbcx/Privilege.hpp>
#include <comphelper/property.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbtools.hxx>
#include <connectivity/sdbcx/VColumn.hxx>
@@ -126,7 +127,7 @@ sdbcx::OCollection* OHSQLTable::createIndexes(const ::std::vector< OUString>& _r
return new OIndexesHelper(this,m_aMutex,_rNames);
}
-Sequence< sal_Int8 > OHSQLTable::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > OHSQLTable::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -137,7 +138,7 @@ Sequence< sal_Int8 > OHSQLTable::getUnoTunnelImplementationId()
sal_Int64 OHSQLTable::getSomething( const Sequence< sal_Int8 > & rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return (isUnoTunnelId<OHSQLTable>(rId))
? reinterpret_cast< sal_Int64 >( this )
: OTable_TYPEDEF::getSomething(rId);
}
diff --git a/connectivity/source/drivers/mysql_jdbc/YDriver.cxx b/connectivity/source/drivers/mysql_jdbc/YDriver.cxx
index d36f78fb3819..06631edda7f1 100644
--- a/connectivity/source/drivers/mysql_jdbc/YDriver.cxx
+++ b/connectivity/source/drivers/mysql_jdbc/YDriver.cxx
@@ -271,7 +271,7 @@ Reference<XConnection> SAL_CALL ODriverDelegator::connect(const OUString& url,
if (xTunnel.is())
{
pMetaConnection = reinterpret_cast<OMetaConnection*>(
- xTunnel->getSomething(OMetaConnection::getUnoTunnelImplementationId()));
+ xTunnel->getSomething(OMetaConnection::getUnoTunnelId()));
if (pMetaConnection)
pMetaConnection->setURL(url);
}
@@ -344,7 +344,7 @@ ODriverDelegator::getDataDefinitionByConnection(const Reference<XConnection>& co
if (xTunnel.is())
{
OMetaConnection* pConnection = reinterpret_cast<OMetaConnection*>(
- xTunnel->getSomething(OMetaConnection::getUnoTunnelImplementationId()));
+ xTunnel->getSomething(OMetaConnection::getUnoTunnelId()));
if (pConnection)
{
TWeakPairVector::iterator i
diff --git a/connectivity/source/drivers/mysql_jdbc/YTable.cxx b/connectivity/source/drivers/mysql_jdbc/YTable.cxx
index a3f303982839..f62779499d58 100644
--- a/connectivity/source/drivers/mysql_jdbc/YTable.cxx
+++ b/connectivity/source/drivers/mysql_jdbc/YTable.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <com/sun/star/sdbcx/Privilege.hpp>
#include <comphelper/property.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbtools.hxx>
#include <connectivity/sdbcx/VColumn.hxx>
@@ -125,7 +126,7 @@ sdbcx::OCollection* OMySQLTable::createIndexes(const ::std::vector<OUString>& _r
return new OIndexesHelper(this, m_aMutex, _rNames);
}
-Sequence<sal_Int8> OMySQLTable::getUnoTunnelImplementationId()
+Sequence<sal_Int8> OMySQLTable::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -136,10 +137,8 @@ Sequence<sal_Int8> OMySQLTable::getUnoTunnelImplementationId()
sal_Int64 OMySQLTable::getSomething(const Sequence<sal_Int8>& rId)
{
- return (rId.getLength() == 16
- && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16))
- ? reinterpret_cast<sal_Int64>(this)
- : OTable_TYPEDEF::getSomething(rId);
+ return (isUnoTunnelId<OMySQLTable>(rId)) ? reinterpret_cast<sal_Int64>(this)
+ : OTable_TYPEDEF::getSomething(rId);
}
// XAlterTable
diff --git a/connectivity/source/drivers/writer/WTable.cxx b/connectivity/source/drivers/writer/WTable.cxx
index 82aea711a4a9..cf9ca7850fd5 100644
--- a/connectivity/source/drivers/writer/WTable.cxx
+++ b/connectivity/source/drivers/writer/WTable.cxx
@@ -28,6 +28,7 @@
#include <writer/WConnection.hxx>
#include <connectivity/sdbcx/VColumn.hxx>
#include <sal/log.hxx>
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/typeprovider.hxx>
namespace com
@@ -222,7 +223,7 @@ void SAL_CALL OWriterTable::disposing()
m_pWriterConnection = nullptr;
}
-uno::Sequence<sal_Int8> OWriterTable::getUnoTunnelImplementationId()
+uno::Sequence<sal_Int8> OWriterTable::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -231,10 +232,8 @@ uno::Sequence<sal_Int8> OWriterTable::getUnoTunnelImplementationId()
sal_Int64 OWriterTable::getSomething(const uno::Sequence<sal_Int8>& rId)
{
- return (rId.getLength() == 16
- && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16))
- ? reinterpret_cast<sal_Int64>(this)
- : OWriterTable_BASE::getSomething(rId);
+ return (isUnoTunnelId<OWriterTable>(rId)) ? reinterpret_cast<sal_Int64>(this)
+ : OWriterTable_BASE::getSomething(rId);
}
bool OWriterTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns& _rCols, bool bRetrieveData)
diff --git a/connectivity/source/inc/TConnection.hxx b/connectivity/source/inc/TConnection.hxx
index 8737da6dddbc..af528c894a34 100644
--- a/connectivity/source/inc/TConnection.hxx
+++ b/connectivity/source/inc/TConnection.hxx
@@ -75,7 +75,7 @@ namespace connectivity
//XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+ static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
};
}
#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_TCONNECTION_HXX
diff --git a/connectivity/source/inc/calc/CTable.hxx b/connectivity/source/inc/calc/CTable.hxx
index 00e91ee7f095..570a6bc87134 100644
--- a/connectivity/source/inc/calc/CTable.hxx
+++ b/connectivity/source/inc/calc/CTable.hxx
@@ -69,7 +69,7 @@ namespace connectivity
// css::lang::XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+ static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
void construct() override;
};
diff --git a/connectivity/source/inc/dbase/DIndex.hxx b/connectivity/source/inc/dbase/DIndex.hxx
index d4a9d7dbfafd..ce2a3c594998 100644
--- a/connectivity/source/inc/dbase/DIndex.hxx
+++ b/connectivity/source/inc/dbase/DIndex.hxx
@@ -97,7 +97,7 @@ namespace connectivity
// css::lang::XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+ static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
const ODbaseTable* getTable() const { return m_pTable; }
const NDXHeader& getHeader() const { return m_aHeader; }
diff --git a/connectivity/source/inc/dbase/DTable.hxx b/connectivity/source/inc/dbase/DTable.hxx
index ace8f3c54959..7551dd01b527 100644
--- a/connectivity/source/inc/dbase/DTable.hxx
+++ b/connectivity/source/inc/dbase/DTable.hxx
@@ -167,7 +167,7 @@ namespace connectivity
// css::lang::XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+ static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
// XAlterTable
virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void SAL_CALL alterColumnByIndex( sal_Int32 index, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
diff --git a/connectivity/source/inc/file/FConnection.hxx b/connectivity/source/inc/file/FConnection.hxx
index ddb3dbc63264..4041e060816f 100644
--- a/connectivity/source/inc/file/FConnection.hxx
+++ b/connectivity/source/inc/file/FConnection.hxx
@@ -107,7 +107,7 @@ namespace connectivity
virtual void SAL_CALL clearWarnings( ) override;
//XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+ static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
// no interface methods
css::uno::Reference< css::ucb::XDynamicResultSet > getDir() const;
diff --git a/connectivity/source/inc/flat/ETable.hxx b/connectivity/source/inc/flat/ETable.hxx
index 7dbc56de195b..b36111c9637a 100644
--- a/connectivity/source/inc/flat/ETable.hxx
+++ b/connectivity/source/inc/flat/ETable.hxx
@@ -98,7 +98,7 @@ namespace connectivity
// css::lang::XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+ static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
OUString getEntry() const;
};
diff --git a/connectivity/source/inc/hsqldb/HTable.hxx b/connectivity/source/inc/hsqldb/HTable.hxx
index 9f3bbe42f18c..efae11c1a145 100644
--- a/connectivity/source/inc/hsqldb/HTable.hxx
+++ b/connectivity/source/inc/hsqldb/HTable.hxx
@@ -87,7 +87,7 @@ namespace connectivity
virtual void construct() override;
// css::lang::XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+ static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
//XTypeProvider
diff --git a/connectivity/source/inc/mysql/YTable.hxx b/connectivity/source/inc/mysql/YTable.hxx
index 5c5f5e48ec7b..9e7ea59a6607 100644
--- a/connectivity/source/inc/mysql/YTable.hxx
+++ b/connectivity/source/inc/mysql/YTable.hxx
@@ -94,7 +94,7 @@ namespace connectivity
virtual void construct() override;
// css::lang::XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+ static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
// XAlterTable
virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
diff --git a/connectivity/source/inc/writer/WTable.hxx b/connectivity/source/inc/writer/WTable.hxx
index 6e2c3e89e88a..fa533e1e34da 100644
--- a/connectivity/source/inc/writer/WTable.hxx
+++ b/connectivity/source/inc/writer/WTable.hxx
@@ -78,7 +78,7 @@ public:
// css::lang::XUnoTunnel
sal_Int64 SAL_CALL getSomething(const css::uno::Sequence<sal_Int8>& rId) override;
- static css::uno::Sequence<sal_Int8> getUnoTunnelImplementationId();
+ static css::uno::Sequence<sal_Int8> getUnoTunnelId();
void construct() override;
};
diff --git a/connectivity/source/sdbcx/VDescriptor.cxx b/connectivity/source/sdbcx/VDescriptor.cxx
index cde97530a186..7b56d400c878 100644
--- a/connectivity/source/sdbcx/VDescriptor.cxx
+++ b/connectivity/source/sdbcx/VDescriptor.cxx
@@ -49,7 +49,7 @@ namespace connectivity
// css::lang::XUnoTunnel
sal_Int64 SAL_CALL ODescriptor::getSomething( const Sequence< sal_Int8 >& rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) )
+ return (isUnoTunnelId<ODescriptor>(rId))
? reinterpret_cast< sal_Int64 >( this )
: 0;
}