diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-14 08:19:47 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-15 06:07:36 +0200 |
commit | 05bc93db2de56000f65764d7e394d03747cac23d (patch) | |
tree | 975de9ae83572aac8a5c3ea8db281e1017ee5be0 /connectivity | |
parent | 8cbb414ed737f9ffc76e1258e6671769bf63fc6c (diff) |
Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 1
The header got some changes:
1. Move UnoTunnelIdInit and isUnoTunnelId into 'comphelper' namespace
2. Rename UnoTunnelIdInit to UnoIdInit, as a precondition to replace
of uses of OImplementationId with it, including in XTypeProvider
3. Introduce convenience functions 'getSomething_cast' to cast between
sal_Int64 and object pointers uniformly.
4. Rename getUnoTunnelImplementation to getFromUnoTunnel, both to make
it a bit shorter, and to reflect its function better. Templatize it
to take also css::uno::Any for convenience.
5. Introduce getSomethingImpl, inspired by sw::UnoTunnelImpl; allow it
handle cases both with and without fallback to parent.
6. Adjust UNO3_GETIMPLEMENTATION_* macros
TODO (in separate commits):
- Drop sw::UnoTunnelImpl and sw::UnoTunnelGetImplementation
- Replace all uses of OImplementationId in core with UnoIdInit
- Deprecate OImplementationId in <cppuhelper/typeprovider.hxx>
- Change implementations of getSomething to use getSomethingImpl
- Revise uses of getSomething to use getFromUnoTunnel
Change-Id: If4a3cb024130f1f552f988f0479589da1cd066e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122022
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'connectivity')
39 files changed, 44 insertions, 45 deletions
diff --git a/connectivity/source/commontools/ConnectionWrapper.cxx b/connectivity/source/commontools/ConnectionWrapper.cxx index d7d999058a24..eb08aa4fe82c 100644 --- a/connectivity/source/commontools/ConnectionWrapper.cxx +++ b/connectivity/source/commontools/ConnectionWrapper.cxx @@ -154,7 +154,7 @@ Sequence< Type > SAL_CALL OConnectionWrapper::getTypes( ) // css::lang::XUnoTunnel sal_Int64 SAL_CALL OConnectionWrapper::getSomething( const Sequence< sal_Int8 >& rId ) { - if (isUnoTunnelId<OConnectionWrapper>(rId)) + if (comphelper::isUnoTunnelId<OConnectionWrapper>(rId)) return reinterpret_cast< sal_Int64 >( this ); if(m_xUnoTunnel.is()) diff --git a/connectivity/source/commontools/TConnection.cxx b/connectivity/source/commontools/TConnection.cxx index 89ab7e9ca11d..6e7709cc2e1a 100644 --- a/connectivity/source/commontools/TConnection.cxx +++ b/connectivity/source/commontools/TConnection.cxx @@ -57,7 +57,7 @@ void OMetaConnection::disposing() //XUnoTunnel sal_Int64 SAL_CALL OMetaConnection::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) { - return (isUnoTunnelId<OMetaConnection>(rId)) + return (comphelper::isUnoTunnelId<OMetaConnection>(rId)) ? reinterpret_cast< sal_Int64 >( this ) : sal_Int64(0); } diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx index c73e2cb245af..2f0f5ca53f2e 100644 --- a/connectivity/source/drivers/ado/AColumn.cxx +++ b/connectivity/source/drivers/ado/AColumn.cxx @@ -90,7 +90,7 @@ Sequence< sal_Int8 > OAdoColumn::getUnoTunnelId() sal_Int64 OAdoColumn::getSomething( const Sequence< sal_Int8 > & rId ) { - return isUnoTunnelId<OAdoColumn>(rId) + return comphelper::isUnoTunnelId<OAdoColumn>(rId) ? reinterpret_cast< sal_Int64 >( this ) : OColumn_ADO::getSomething(rId); } diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx index 88d10ecd9af3..6297871d5b62 100644 --- a/connectivity/source/drivers/ado/AColumns.cxx +++ b/connectivity/source/drivers/ado/AColumns.cxx @@ -62,7 +62,7 @@ Reference< XPropertySet > OColumns::createDescriptor() // XAppend sdbcx::ObjectType OColumns::appendObject( const OUString&, const Reference< XPropertySet >& descriptor ) { - rtl::Reference<OAdoColumn> pColumn = getUnoTunnelImplementation<OAdoColumn>( descriptor ); + rtl::Reference<OAdoColumn> pColumn = getFromUnoTunnel<OAdoColumn>( descriptor ); Reference< XPropertySet > xColumn; if ( !pColumn.is() ) { diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index 664990f66564..0669955356bf 100644 --- a/connectivity/source/drivers/ado/AConnection.cxx +++ b/connectivity/source/drivers/ado/AConnection.cxx @@ -490,7 +490,7 @@ void OConnection::disposing() sal_Int64 SAL_CALL OConnection::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) { - return isUnoTunnelId<OConnection>(rId) + return comphelper::isUnoTunnelId<OConnection>(rId) ? reinterpret_cast< sal_Int64 >( this ) : diff --git a/connectivity/source/drivers/ado/AGroup.cxx b/connectivity/source/drivers/ado/AGroup.cxx index b41fbdbba05d..3a5a736431c0 100644 --- a/connectivity/source/drivers/ado/AGroup.cxx +++ b/connectivity/source/drivers/ado/AGroup.cxx @@ -93,7 +93,7 @@ Sequence< sal_Int8 > OAdoGroup::getUnoTunnelId() sal_Int64 OAdoGroup::getSomething( const Sequence< sal_Int8 > & rId ) { - return isUnoTunnelId<OAdoGroup>(rId) + return comphelper::isUnoTunnelId<OAdoGroup>(rId) ? reinterpret_cast< sal_Int64 >( this ) : OGroup_ADO::getSomething(rId); } diff --git a/connectivity/source/drivers/ado/AGroups.cxx b/connectivity/source/drivers/ado/AGroups.cxx index 211f34f6bebe..e3fb165b0a34 100644 --- a/connectivity/source/drivers/ado/AGroups.cxx +++ b/connectivity/source/drivers/ado/AGroups.cxx @@ -58,7 +58,7 @@ Reference< XPropertySet > OGroups::createDescriptor() // XAppend sdbcx::ObjectType OGroups::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { - OAdoGroup* pGroup = getUnoTunnelImplementation<OAdoGroup>(descriptor); + OAdoGroup* pGroup = getFromUnoTunnel<OAdoGroup>(descriptor); if ( pGroup == nullptr ) m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_GROUP_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) ); diff --git a/connectivity/source/drivers/ado/AIndex.cxx b/connectivity/source/drivers/ado/AIndex.cxx index 61a047bc9b00..3445ab78a240 100644 --- a/connectivity/source/drivers/ado/AIndex.cxx +++ b/connectivity/source/drivers/ado/AIndex.cxx @@ -82,7 +82,7 @@ Sequence< sal_Int8 > OAdoIndex::getUnoTunnelId() sal_Int64 OAdoIndex::getSomething( const Sequence< sal_Int8 > & rId ) { - return isUnoTunnelId<OAdoIndex>(rId) + return comphelper::isUnoTunnelId<OAdoIndex>(rId) ? reinterpret_cast< sal_Int64 >( this ) : sdbcx::OIndex::getSomething(rId); } diff --git a/connectivity/source/drivers/ado/AIndexes.cxx b/connectivity/source/drivers/ado/AIndexes.cxx index 616cd863ada4..c2cdb76081d2 100644 --- a/connectivity/source/drivers/ado/AIndexes.cxx +++ b/connectivity/source/drivers/ado/AIndexes.cxx @@ -58,7 +58,7 @@ Reference< XPropertySet > OIndexes::createDescriptor() // XAppend sdbcx::ObjectType OIndexes::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { - OAdoIndex* pIndex = getUnoTunnelImplementation<OAdoIndex>(descriptor); + OAdoIndex* pIndex = getFromUnoTunnel<OAdoIndex>(descriptor); if ( pIndex == nullptr ) m_pConnection->throwGenericSQLException( STR_INVALID_INDEX_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) ); diff --git a/connectivity/source/drivers/ado/AKey.cxx b/connectivity/source/drivers/ado/AKey.cxx index 764765b35620..6c3db4537e85 100644 --- a/connectivity/source/drivers/ado/AKey.cxx +++ b/connectivity/source/drivers/ado/AKey.cxx @@ -78,7 +78,7 @@ Sequence< sal_Int8 > OAdoKey::getUnoTunnelId() sal_Int64 OAdoKey::getSomething( const Sequence< sal_Int8 > & rId ) { - return isUnoTunnelId<OAdoKey>(rId) + return comphelper::isUnoTunnelId<OAdoKey>(rId) ? reinterpret_cast< sal_Int64 >( this ) : OKey_ADO::getSomething(rId); } diff --git a/connectivity/source/drivers/ado/AKeys.cxx b/connectivity/source/drivers/ado/AKeys.cxx index 0d921c39842b..a18d91709455 100644 --- a/connectivity/source/drivers/ado/AKeys.cxx +++ b/connectivity/source/drivers/ado/AKeys.cxx @@ -58,7 +58,7 @@ Reference< XPropertySet > OKeys::createDescriptor() // XAppend sdbcx::ObjectType OKeys::appendObject( const OUString&, const Reference< XPropertySet >& descriptor ) { - OAdoKey* pKey = getUnoTunnelImplementation<OAdoKey>( descriptor ); + OAdoKey* pKey = getFromUnoTunnel<OAdoKey>( descriptor ); if ( pKey == nullptr) m_pConnection->throwGenericSQLException( STR_INVALID_KEY_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) ); diff --git a/connectivity/source/drivers/ado/ATable.cxx b/connectivity/source/drivers/ado/ATable.cxx index 92f28ce56a06..6b2175a46b29 100644 --- a/connectivity/source/drivers/ado/ATable.cxx +++ b/connectivity/source/drivers/ado/ATable.cxx @@ -139,7 +139,7 @@ Sequence< sal_Int8 > OAdoTable::getUnoTunnelId() sal_Int64 OAdoTable::getSomething( const Sequence< sal_Int8 > & rId ) { - return isUnoTunnelId<OAdoTable>(rId) + return comphelper::isUnoTunnelId<OAdoTable>(rId) ? reinterpret_cast< sal_Int64 >( this ) : OTable_TYPEDEF::getSomething(rId); } @@ -168,7 +168,7 @@ void SAL_CALL OAdoTable::alterColumnByName( const OUString& colName, const Refer checkDisposed(OTableDescriptor_BASE_TYPEDEF::rBHelper.bDisposed); bool bError = true; - OAdoColumn* pColumn = comphelper::getUnoTunnelImplementation<OAdoColumn>(descriptor); + OAdoColumn* pColumn = comphelper::getFromUnoTunnel<OAdoColumn>(descriptor); if(pColumn != nullptr) { WpADOColumns aColumns = m_aTable.get_Columns(); diff --git a/connectivity/source/drivers/ado/ATables.cxx b/connectivity/source/drivers/ado/ATables.cxx index 9ce87634e425..b8f6fb9d2c72 100644 --- a/connectivity/source/drivers/ado/ATables.cxx +++ b/connectivity/source/drivers/ado/ATables.cxx @@ -65,7 +65,7 @@ Reference< XPropertySet > OTables::createDescriptor() // XAppend sdbcx::ObjectType OTables::appendObject( const OUString&, const Reference< XPropertySet >& descriptor ) { - OAdoTable* pTable = getUnoTunnelImplementation<OAdoTable>( descriptor ); + OAdoTable* pTable = getFromUnoTunnel<OAdoTable>( descriptor ); if ( pTable == nullptr ) m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_TABLE_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) ); diff --git a/connectivity/source/drivers/ado/AUser.cxx b/connectivity/source/drivers/ado/AUser.cxx index 724334cea696..4d86ce97d63f 100644 --- a/connectivity/source/drivers/ado/AUser.cxx +++ b/connectivity/source/drivers/ado/AUser.cxx @@ -77,7 +77,7 @@ Sequence< sal_Int8 > OAdoUser::getUnoTunnelId() sal_Int64 OAdoUser::getSomething( const Sequence< sal_Int8 > & rId ) { - return isUnoTunnelId<OAdoUser>(rId) + return comphelper::isUnoTunnelId<OAdoUser>(rId) ? reinterpret_cast< sal_Int64 >( this ) : OUser_TYPEDEF::getSomething(rId); } diff --git a/connectivity/source/drivers/ado/AUsers.cxx b/connectivity/source/drivers/ado/AUsers.cxx index 2620e915a89e..9d0dab6e8d4c 100644 --- a/connectivity/source/drivers/ado/AUsers.cxx +++ b/connectivity/source/drivers/ado/AUsers.cxx @@ -56,7 +56,7 @@ Reference< XPropertySet > OUsers::createDescriptor() // XAppend sdbcx::ObjectType OUsers::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { - OUserExtend* pUser = getUnoTunnelImplementation<OUserExtend>( descriptor ); + OUserExtend* pUser = getFromUnoTunnel<OUserExtend>( descriptor ); if ( pUser == nullptr ) m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_USER_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) ); diff --git a/connectivity/source/drivers/ado/AView.cxx b/connectivity/source/drivers/ado/AView.cxx index b53c1a026200..5460bab249c2 100644 --- a/connectivity/source/drivers/ado/AView.cxx +++ b/connectivity/source/drivers/ado/AView.cxx @@ -52,7 +52,7 @@ Sequence< sal_Int8 > OAdoView::getUnoTunnelId() sal_Int64 OAdoView::getSomething( const Sequence< sal_Int8 > & rId ) { - return isUnoTunnelId<OAdoView>(rId) + return comphelper::isUnoTunnelId<OAdoView>(rId) ? reinterpret_cast< sal_Int64 >( this ) : OView_ADO::getSomething(rId); } diff --git a/connectivity/source/drivers/ado/AViews.cxx b/connectivity/source/drivers/ado/AViews.cxx index cbe239e73825..22fe40142d25 100644 --- a/connectivity/source/drivers/ado/AViews.cxx +++ b/connectivity/source/drivers/ado/AViews.cxx @@ -61,7 +61,7 @@ Reference< XPropertySet > OViews::createDescriptor() // XAppend sdbcx::ObjectType OViews::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { - OAdoView* pView = getUnoTunnelImplementation<OAdoView>( descriptor ); + OAdoView* pView = getFromUnoTunnel<OAdoView>( descriptor ); if ( pView == nullptr ) m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_VIEW_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) ); diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx index f2c50362ab30..382142ece38e 100644 --- a/connectivity/source/drivers/calc/CTable.cxx +++ b/connectivity/source/drivers/calc/CTable.cxx @@ -621,7 +621,7 @@ Sequence< sal_Int8 > OCalcTable::getUnoTunnelId() sal_Int64 OCalcTable::getSomething( const Sequence< sal_Int8 > & rId ) { - return (isUnoTunnelId<OCalcTable>(rId)) + return (comphelper::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 4bb3a0c7179a..601f1585eaef 100644 --- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx +++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx @@ -294,7 +294,7 @@ Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getIndexInfo( aRow[4] = new ORowSetValueDecorator(getBOOL(xIndex->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISUNIQUE)))); aRow[6] = new ORowSetValueDecorator(*pBegin); - auto pIndex = comphelper::getUnoTunnelImplementation<ODbaseIndex>(xIndex); + auto pIndex = comphelper::getFromUnoTunnel<ODbaseIndex>(xIndex); 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 04f46be9a513..f2dce48c62b7 100644 --- a/connectivity/source/drivers/dbase/DIndex.cxx +++ b/connectivity/source/drivers/dbase/DIndex.cxx @@ -111,7 +111,7 @@ Sequence< sal_Int8 > ODbaseIndex::getUnoTunnelId() sal_Int64 ODbaseIndex::getSomething( const Sequence< sal_Int8 > & rId ) { - return (isUnoTunnelId<ODbaseIndex>(rId)) + return (comphelper::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 2a4cf72fb496..d97e1187b5fd 100644 --- a/connectivity/source/drivers/dbase/DIndexes.cxx +++ b/connectivity/source/drivers/dbase/DIndexes.cxx @@ -107,7 +107,7 @@ sdbcx::ObjectType ODbaseIndexes::appendObject( const OUString& _rForName, const // XDrop void ODbaseIndexes::dropObject(sal_Int32 _nPos, const OUString& /*_sElementName*/) { - auto pIndex = comphelper::getUnoTunnelImplementation<ODbaseIndex>(getObject(_nPos)); + auto pIndex = comphelper::getFromUnoTunnel<ODbaseIndex>(getObject(_nPos)); if ( pIndex ) pIndex->DropImpl(); } diff --git a/connectivity/source/drivers/dbase/DResultSet.cxx b/connectivity/source/drivers/dbase/DResultSet.cxx index 17cbac2e41ab..148dc145ad9e 100644 --- a/connectivity/source/drivers/dbase/DResultSet.cxx +++ b/connectivity/source/drivers/dbase/DResultSet.cxx @@ -155,7 +155,7 @@ Sequence< sal_Int32 > SAL_CALL ODbaseResultSet::deleteRows( const Sequence< An bool ODbaseResultSet::fillIndexValues(const Reference< XColumnsSupplier> &_xIndex) { - auto pIndex = comphelper::getUnoTunnelImplementation<dbase::ODbaseIndex>(_xIndex); + auto pIndex = comphelper::getFromUnoTunnel<dbase::ODbaseIndex>(_xIndex); 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 f597ce615b5f..a270d3ad007f 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -742,7 +742,7 @@ Sequence< sal_Int8 > ODbaseTable::getUnoTunnelId() sal_Int64 ODbaseTable::getSomething( const Sequence< sal_Int8 > & rId ) { - return (isUnoTunnelId<ODbaseTable>(rId)) + return (comphelper::isUnoTunnelId<ODbaseTable>(rId)) ? reinterpret_cast< sal_Int64 >( this ) : ODbaseTable_BASE::getSomething(rId); } diff --git a/connectivity/source/drivers/dbase/DTables.cxx b/connectivity/source/drivers/dbase/DTables.cxx index 74c81c62601b..266816eeb776 100644 --- a/connectivity/source/drivers/dbase/DTables.cxx +++ b/connectivity/source/drivers/dbase/DTables.cxx @@ -65,7 +65,7 @@ Reference< XPropertySet > ODbaseTables::createDescriptor() // XAppend sdbcx::ObjectType ODbaseTables::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { - auto pTable = comphelper::getUnoTunnelImplementation<ODbaseTable>(descriptor); + auto pTable = comphelper::getFromUnoTunnel<ODbaseTable>(descriptor); if(pTable) { pTable->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME),makeAny(_rForName)); diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx index 964d8ff16861..3b0dacea6f37 100644 --- a/connectivity/source/drivers/file/FConnection.cxx +++ b/connectivity/source/drivers/file/FConnection.cxx @@ -401,7 +401,7 @@ Reference< XDynamicResultSet > OConnection::getDir() const sal_Int64 SAL_CALL OConnection::getSomething( const Sequence< sal_Int8 >& rId ) { - return (isUnoTunnelId<OConnection>(rId)) + return (comphelper::isUnoTunnelId<OConnection>(rId)) ? reinterpret_cast< sal_Int64 >( this ) : sal_Int64(0); } diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx index 215c381aa8c1..c41f985d0bb0 100644 --- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx @@ -393,7 +393,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges( xNames->getByName(*pBegin), css::uno::UNO_QUERY); if(xTable.is()) { - auto pTable = comphelper::getUnoTunnelImplementation<OFileTable>(xTable); + auto pTable = comphelper::getFromUnoTunnel<OFileTable>(xTable); if(pTable && !pTable->isReadOnly()) { aRow[6] = ODatabaseMetaDataResultSet::getInsertValue(); diff --git a/connectivity/source/drivers/file/FDriver.cxx b/connectivity/source/drivers/file/FDriver.cxx index 9bd0692bac26..4b6d45fe7420 100644 --- a/connectivity/source/drivers/file/FDriver.cxx +++ b/connectivity/source/drivers/file/FDriver.cxx @@ -172,7 +172,7 @@ Reference< XTablesSupplier > SAL_CALL OFileDriver::getDataDefinitionByConnection ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(ODriver_BASE::rBHelper.bDisposed); - if (OConnection* pSearchConnection = comphelper::getUnoTunnelImplementation<OConnection>(connection)) + if (OConnection* pSearchConnection = comphelper::getFromUnoTunnel<OConnection>(connection)) { for (auto const& elem : m_xConnections) { diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 4d29f1de7a84..7c2649d8fc8f 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -1391,7 +1391,7 @@ Sequence< sal_Int8 > OResultSet::getUnoTunnelId() sal_Int64 OResultSet::getSomething( const Sequence< sal_Int8 > & rId ) { - return isUnoTunnelId<OResultSet>(rId) + return comphelper::isUnoTunnelId<OResultSet>(rId) ? reinterpret_cast< sal_Int64 >( this ) : 0; } diff --git a/connectivity/source/drivers/file/FTable.cxx b/connectivity/source/drivers/file/FTable.cxx index b47bfb811a1f..7da609bb4ae0 100644 --- a/connectivity/source/drivers/file/FTable.cxx +++ b/connectivity/source/drivers/file/FTable.cxx @@ -130,7 +130,7 @@ Sequence< sal_Int8 > OFileTable::getUnoTunnelId() sal_Int64 OFileTable::getSomething( const Sequence< sal_Int8 > & rId ) { - return isUnoTunnelId<OFileTable>(rId) + return comphelper::isUnoTunnelId<OFileTable>(rId) ? reinterpret_cast< sal_Int64 >( this ) : OTable_TYPEDEF::getSomething(rId); } diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx index 040770fe0e6d..dd827eca52a7 100644 --- a/connectivity/source/drivers/firebird/Connection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -382,7 +382,7 @@ Reference< XClob> Connection::createClob(ISC_QUAD const * pBlobId) // virtual sal_Int64 SAL_CALL Connection::getSomething(const css::uno::Sequence<sal_Int8>& rId) { - return (isUnoTunnelId<Connection>(rId)) ? reinterpret_cast<sal_Int64>(this) : sal_Int64(0); + return (comphelper::isUnoTunnelId<Connection>(rId)) ? reinterpret_cast<sal_Int64>(this) : sal_Int64(0); } // static diff --git a/connectivity/source/drivers/firebird/Driver.cxx b/connectivity/source/drivers/firebird/Driver.cxx index fbf29293a31c..c9dc6155d0e0 100644 --- a/connectivity/source/drivers/firebird/Driver.cxx +++ b/connectivity/source/drivers/firebird/Driver.cxx @@ -191,7 +191,7 @@ sal_Int32 SAL_CALL FirebirdDriver::getMinorVersion( ) uno::Reference< XTablesSupplier > SAL_CALL FirebirdDriver::getDataDefinitionByConnection( const uno::Reference< XConnection >& rConnection) { - if (Connection* pConnection = comphelper::getUnoTunnelImplementation<Connection>(rConnection)) + if (Connection* pConnection = comphelper::getFromUnoTunnel<Connection>(rConnection)) return pConnection->createCatalog(); return {}; } diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 0574130ee993..43116033add6 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -562,7 +562,7 @@ Sequence< sal_Int8 > OFlatTable::getUnoTunnelId() sal_Int64 OFlatTable::getSomething( const Sequence< sal_Int8 > & rId ) { - return (isUnoTunnelId<OFlatTable>(rId)) + return (comphelper::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 e4d4e399ba2a..962e574879cf 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -333,7 +333,7 @@ namespace connectivity if ( xOrig.is() ) { // now we have to set the URL to get the correct answer for metadata()->getURL() - auto pMetaConnection = comphelper::getUnoTunnelImplementation<OMetaConnection>(xOrig); + auto pMetaConnection = comphelper::getFromUnoTunnel<OMetaConnection>(xOrig); if ( pMetaConnection ) pMetaConnection->setURL(url); diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx index 89d75fac7e3d..76d0c5b332ee 100644 --- a/connectivity/source/drivers/hsqldb/HTable.cxx +++ b/connectivity/source/drivers/hsqldb/HTable.cxx @@ -127,7 +127,7 @@ Sequence< sal_Int8 > OHSQLTable::getUnoTunnelId() sal_Int64 OHSQLTable::getSomething( const Sequence< sal_Int8 > & rId ) { - return (isUnoTunnelId<OHSQLTable>(rId)) + return (comphelper::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 0225381c74b3..ad8ce525feac 100644 --- a/connectivity/source/drivers/mysql_jdbc/YDriver.cxx +++ b/connectivity/source/drivers/mysql_jdbc/YDriver.cxx @@ -255,8 +255,7 @@ Reference<XConnection> SAL_CALL ODriverDelegator::connect(const OUString& url, if (xConnection.is()) { // now we have to set the URL to get the correct answer for metadata()->getURL() - auto pMetaConnection - = comphelper::getUnoTunnelImplementation<OMetaConnection>(xConnection); + auto pMetaConnection = comphelper::getFromUnoTunnel<OMetaConnection>(xConnection); if (pMetaConnection) pMetaConnection->setURL(url); m_aConnections.push_back( @@ -321,7 +320,7 @@ ODriverDelegator::getDataDefinitionByConnection(const Reference<XConnection>& co checkDisposed(ODriverDelegator_BASE::rBHelper.bDisposed); Reference<XTablesSupplier> xTab; - auto pConnection = comphelper::getUnoTunnelImplementation<OMetaConnection>(connection); + auto pConnection = comphelper::getFromUnoTunnel<OMetaConnection>(connection); if (pConnection) { TWeakPairVector::iterator i diff --git a/connectivity/source/drivers/mysql_jdbc/YTable.cxx b/connectivity/source/drivers/mysql_jdbc/YTable.cxx index 26e0fde19632..22c6bfa6df6c 100644 --- a/connectivity/source/drivers/mysql_jdbc/YTable.cxx +++ b/connectivity/source/drivers/mysql_jdbc/YTable.cxx @@ -128,8 +128,8 @@ Sequence<sal_Int8> OMySQLTable::getUnoTunnelId() sal_Int64 OMySQLTable::getSomething(const Sequence<sal_Int8>& rId) { - return (isUnoTunnelId<OMySQLTable>(rId)) ? reinterpret_cast<sal_Int64>(this) - : OTable_TYPEDEF::getSomething(rId); + return (comphelper::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 8448132556e6..a1e97ab836ed 100644 --- a/connectivity/source/drivers/writer/WTable.cxx +++ b/connectivity/source/drivers/writer/WTable.cxx @@ -220,8 +220,8 @@ uno::Sequence<sal_Int8> OWriterTable::getUnoTunnelId() sal_Int64 OWriterTable::getSomething(const uno::Sequence<sal_Int8>& rId) { - return (isUnoTunnelId<OWriterTable>(rId)) ? reinterpret_cast<sal_Int64>(this) - : OWriterTable_BASE::getSomething(rId); + return (comphelper::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/sdbcx/VCollection.cxx b/connectivity/source/sdbcx/VCollection.cxx index c7f8e0ba9ff0..0aa6c0d3c627 100644 --- a/connectivity/source/sdbcx/VCollection.cxx +++ b/connectivity/source/sdbcx/VCollection.cxx @@ -374,7 +374,7 @@ void SAL_CALL OCollection::appendByDescriptor( const Reference< XPropertySet >& if ( !xNewlyCreated.is() ) throw RuntimeException(); - ODescriptor* pDescriptor = comphelper::getUnoTunnelImplementation<ODescriptor>( xNewlyCreated ); + ODescriptor* pDescriptor = comphelper::getFromUnoTunnel<ODescriptor>( xNewlyCreated ); if ( pDescriptor ) pDescriptor->setNew( false ); diff --git a/connectivity/source/sdbcx/VDescriptor.cxx b/connectivity/source/sdbcx/VDescriptor.cxx index 8a32a1b58b39..0d70aa0b41af 100644 --- a/connectivity/source/sdbcx/VDescriptor.cxx +++ b/connectivity/source/sdbcx/VDescriptor.cxx @@ -46,7 +46,7 @@ namespace connectivity::sdbcx // css::lang::XUnoTunnel sal_Int64 SAL_CALL ODescriptor::getSomething( const Sequence< sal_Int8 >& rId ) { - return (isUnoTunnelId<ODescriptor>(rId)) + return (comphelper::isUnoTunnelId<ODescriptor>(rId)) ? reinterpret_cast< sal_Int64 >( this ) : 0; } @@ -87,7 +87,7 @@ namespace connectivity::sdbcx bool ODescriptor::isNew( const Reference< XInterface >& _rxDescriptor ) { - ODescriptor* pImplementation = comphelper::getUnoTunnelImplementation<ODescriptor>( _rxDescriptor ); + ODescriptor* pImplementation = comphelper::getFromUnoTunnel<ODescriptor>( _rxDescriptor ); return pImplementation && pImplementation->isNew(); } |