From c1e1806c9c01d2ac2f62f95dd79cbb2037bc87af Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Sat, 7 Sep 2019 01:14:48 +0300 Subject: [PATCH] tdf#39593 drop comphelper::getImplementation Replace with comphelper::getUnoTunnelImplementation. Change-Id: I96277aa9c17532ea6e2781dbc3305b2dbaa4e5c2 Reviewed-on: https://gerrit.libreoffice.org/78733 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov --- connectivity/source/drivers/ado/AColumns.cxx | 3 ++- connectivity/source/drivers/ado/AGroups.cxx | 3 ++- connectivity/source/drivers/ado/AIndexes.cxx | 3 ++- connectivity/source/drivers/ado/AKeys.cxx | 3 ++- connectivity/source/drivers/ado/ATable.cxx | 2 +- connectivity/source/drivers/ado/ATables.cxx | 3 ++- connectivity/source/drivers/ado/AUsers.cxx | 3 ++- connectivity/source/drivers/ado/AViews.cxx | 3 ++- include/comphelper/types.hxx | 10 ---------- 9 files changed, 15 insertions(+), 18 deletions(-) diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx index ef010cfb4062..e9dc7720fc99 100644 --- a/connectivity/source/drivers/ado/AColumns.cxx +++ b/connectivity/source/drivers/ado/AColumns.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +60,7 @@ Reference< XPropertySet > OColumns::createDescriptor() // XAppend sdbcx::ObjectType OColumns::appendObject( const OUString&, const Reference< XPropertySet >& descriptor ) { - OAdoColumn* pColumn = getImplementation( descriptor ); + OAdoColumn* pColumn = getUnoTunnelImplementation( descriptor ); Reference< XPropertySet > xColumn; if ( pColumn == nullptr ) { diff --git a/connectivity/source/drivers/ado/AGroups.cxx b/connectivity/source/drivers/ado/AGroups.cxx index 506aead14f7d..211f34f6bebe 100644 --- a/connectivity/source/drivers/ado/AGroups.cxx +++ b/connectivity/source/drivers/ado/AGroups.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -57,7 +58,7 @@ Reference< XPropertySet > OGroups::createDescriptor() // XAppend sdbcx::ObjectType OGroups::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { - OAdoGroup* pGroup = getImplementation(descriptor); + OAdoGroup* pGroup = getUnoTunnelImplementation(descriptor); if ( pGroup == nullptr ) m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_GROUP_DESCRIPTOR_ERROR,static_cast(this) ); diff --git a/connectivity/source/drivers/ado/AIndexes.cxx b/connectivity/source/drivers/ado/AIndexes.cxx index 46cd1c1a4b86..616cd863ada4 100644 --- a/connectivity/source/drivers/ado/AIndexes.cxx +++ b/connectivity/source/drivers/ado/AIndexes.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -57,7 +58,7 @@ Reference< XPropertySet > OIndexes::createDescriptor() // XAppend sdbcx::ObjectType OIndexes::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { - OAdoIndex* pIndex = getImplementation(descriptor); + OAdoIndex* pIndex = getUnoTunnelImplementation(descriptor); if ( pIndex == nullptr ) m_pConnection->throwGenericSQLException( STR_INVALID_INDEX_DESCRIPTOR_ERROR,static_cast(this) ); diff --git a/connectivity/source/drivers/ado/AKeys.cxx b/connectivity/source/drivers/ado/AKeys.cxx index e306f918a726..19027e79ffb6 100644 --- a/connectivity/source/drivers/ado/AKeys.cxx +++ b/connectivity/source/drivers/ado/AKeys.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -57,7 +58,7 @@ Reference< XPropertySet > OKeys::createDescriptor() // XAppend sdbcx::ObjectType OKeys::appendObject( const OUString&, const Reference< XPropertySet >& descriptor ) { - OAdoKey* pKey = getImplementation( descriptor ); + OAdoKey* pKey = getUnoTunnelImplementation( descriptor ); if ( pKey == nullptr) m_pConnection->throwGenericSQLException( STR_INVALID_KEY_DESCRIPTOR_ERROR,static_cast(this) ); diff --git a/connectivity/source/drivers/ado/ATable.cxx b/connectivity/source/drivers/ado/ATable.cxx index 807dbb19055c..209255598476 100644 --- a/connectivity/source/drivers/ado/ATable.cxx +++ b/connectivity/source/drivers/ado/ATable.cxx @@ -164,7 +164,7 @@ void SAL_CALL OAdoTable::alterColumnByName( const OUString& colName, const Refer checkDisposed(OTableDescriptor_BASE_TYPEDEF::rBHelper.bDisposed); bool bError = true; - OAdoColumn* pColumn = ::comphelper::getImplementation(descriptor); + OAdoColumn* pColumn = comphelper::getUnoTunnelImplementation(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 75fbaba3b710..9ce87634e425 100644 --- a/connectivity/source/drivers/ado/ATables.cxx +++ b/connectivity/source/drivers/ado/ATables.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -64,7 +65,7 @@ Reference< XPropertySet > OTables::createDescriptor() // XAppend sdbcx::ObjectType OTables::appendObject( const OUString&, const Reference< XPropertySet >& descriptor ) { - OAdoTable* pTable = getImplementation( descriptor ); + OAdoTable* pTable = getUnoTunnelImplementation( descriptor ); if ( pTable == nullptr ) m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_TABLE_DESCRIPTOR_ERROR,static_cast(this) ); diff --git a/connectivity/source/drivers/ado/AUsers.cxx b/connectivity/source/drivers/ado/AUsers.cxx index c7e3d6632bb0..9c39ade72749 100644 --- a/connectivity/source/drivers/ado/AUsers.cxx +++ b/connectivity/source/drivers/ado/AUsers.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -55,7 +56,7 @@ Reference< XPropertySet > OUsers::createDescriptor() // XAppend sdbcx::ObjectType OUsers::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { - OUserExtend* pUser = getImplementation( descriptor ); + OUserExtend* pUser = getUnoTunnelImplementation( descriptor ); if ( pUser == nullptr ) m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_USER_DESCRIPTOR_ERROR,static_cast(this) ); diff --git a/connectivity/source/drivers/ado/AViews.cxx b/connectivity/source/drivers/ado/AViews.cxx index 01744952f023..a778f6cc3f20 100644 --- a/connectivity/source/drivers/ado/AViews.cxx +++ b/connectivity/source/drivers/ado/AViews.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +60,7 @@ Reference< XPropertySet > OViews::createDescriptor() // XAppend sdbcx::ObjectType OViews::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { - OAdoView* pView = getImplementation( descriptor ); + OAdoView* pView = getUnoTunnelImplementation( descriptor ); if ( pView == nullptr ) m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_VIEW_DESCRIPTOR_ERROR,static_cast(this) ); diff --git a/include/comphelper/types.hxx b/include/comphelper/types.hxx index e25c38d80d3c..b35fbef5f18f 100644 --- a/include/comphelper/types.hxx +++ b/include/comphelper/types.hxx @@ -51,16 +51,6 @@ namespace comphelper } } - template - TYPE* getImplementation(const css::uno::Reference< css::uno::XInterface >& _rxIFace) - { - css::uno::Reference< css::lang::XUnoTunnel > xTunnel(_rxIFace, css::uno::UNO_QUERY); - if (xTunnel.is()) - return reinterpret_cast< TYPE* >(xTunnel->getSomething(TYPE::getUnoTunnelId())); - - return nullptr; - } - /** get a css::awt::FontDescriptor that is fully initialized with the XXX_DONTKNOW enum values (which isn't the case if you instantiate it