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 <qarkai@gmail.com>
diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx
index ef010cf..e9dc772 100644
--- a/connectivity/source/drivers/ado/AColumns.cxx
+++ b/connectivity/source/drivers/ado/AColumns.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <comphelper/property.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
#include <algorithm>
@@ -59,7 +60,7 @@
// XAppend
sdbcx::ObjectType OColumns::appendObject( const OUString&, const Reference< XPropertySet >& descriptor )
{
OAdoColumn* pColumn = getImplementation<OAdoColumn>( descriptor );
OAdoColumn* pColumn = getUnoTunnelImplementation<OAdoColumn>( descriptor );
Reference< XPropertySet > xColumn;
if ( pColumn == nullptr )
{
diff --git a/connectivity/source/drivers/ado/AGroups.cxx b/connectivity/source/drivers/ado/AGroups.cxx
index 506aead..211f34f 100644
--- a/connectivity/source/drivers/ado/AGroups.cxx
+++ b/connectivity/source/drivers/ado/AGroups.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <connectivity/sdbcx/IRefreshable.hxx>
#include <TConnection.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
#include <strings.hrc>
@@ -57,7 +58,7 @@
// XAppend
sdbcx::ObjectType OGroups::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
{
OAdoGroup* pGroup = getImplementation<OAdoGroup>(descriptor);
OAdoGroup* pGroup = getUnoTunnelImplementation<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/AIndexes.cxx b/connectivity/source/drivers/ado/AIndexes.cxx
index 46cd1c1..616cd86 100644
--- a/connectivity/source/drivers/ado/AIndexes.cxx
+++ b/connectivity/source/drivers/ado/AIndexes.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/IndexType.hpp>
#include <TConnection.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
#include <strings.hrc>
@@ -57,7 +58,7 @@
// XAppend
sdbcx::ObjectType OIndexes::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
{
OAdoIndex* pIndex = getImplementation<OAdoIndex>(descriptor);
OAdoIndex* pIndex = getUnoTunnelImplementation<OAdoIndex>(descriptor);
if ( pIndex == nullptr )
m_pConnection->throwGenericSQLException( STR_INVALID_INDEX_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
diff --git a/connectivity/source/drivers/ado/AKeys.cxx b/connectivity/source/drivers/ado/AKeys.cxx
index e306f91..19027e7 100644
--- a/connectivity/source/drivers/ado/AKeys.cxx
+++ b/connectivity/source/drivers/ado/AKeys.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/sdbcx/KeyType.hpp>
#include <com/sun/star/sdbc/KeyRule.hpp>
#include <ado/AConnection.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <ado/Awrapado.hxx>
#include <connectivity/dbexception.hxx>
@@ -57,7 +58,7 @@
// XAppend
sdbcx::ObjectType OKeys::appendObject( const OUString&, const Reference< XPropertySet >& descriptor )
{
OAdoKey* pKey = getImplementation<OAdoKey>( descriptor );
OAdoKey* pKey = getUnoTunnelImplementation<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 807dbb1..2092555 100644
--- a/connectivity/source/drivers/ado/ATable.cxx
+++ b/connectivity/source/drivers/ado/ATable.cxx
@@ -164,7 +164,7 @@
checkDisposed(OTableDescriptor_BASE_TYPEDEF::rBHelper.bDisposed);
bool bError = true;
OAdoColumn* pColumn = ::comphelper::getImplementation<OAdoColumn>(descriptor);
OAdoColumn* pColumn = comphelper::getUnoTunnelImplementation<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 75fbaba..9ce8763 100644
--- a/connectivity/source/drivers/ado/ATables.cxx
+++ b/connectivity/source/drivers/ado/ATables.cxx
@@ -28,6 +28,7 @@
#include <ado/AConnection.hxx>
#include <ado/Awrapado.hxx>
#include <TConnection.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <connectivity/dbexception.hxx>
@@ -64,7 +65,7 @@
// XAppend
sdbcx::ObjectType OTables::appendObject( const OUString&, const Reference< XPropertySet >& descriptor )
{
OAdoTable* pTable = getImplementation<OAdoTable>( descriptor );
OAdoTable* pTable = getUnoTunnelImplementation<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/AUsers.cxx b/connectivity/source/drivers/ado/AUsers.cxx
index c7e3d66..9c39ade 100644
--- a/connectivity/source/drivers/ado/AUsers.cxx
+++ b/connectivity/source/drivers/ado/AUsers.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <connectivity/sdbcx/IRefreshable.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
#include <strings.hrc>
@@ -55,7 +56,7 @@
// XAppend
sdbcx::ObjectType OUsers::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
{
OUserExtend* pUser = getImplementation<OUserExtend>( descriptor );
OUserExtend* pUser = getUnoTunnelImplementation<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/AViews.cxx b/connectivity/source/drivers/ado/AViews.cxx
index 01744952..a778f6c 100644
--- a/connectivity/source/drivers/ado/AViews.cxx
+++ b/connectivity/source/drivers/ado/AViews.cxx
@@ -24,6 +24,7 @@
#include <ado/AConnection.hxx>
#include <ado/Awrapado.hxx>
#include <TConnection.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
#include <strings.hrc>
@@ -59,7 +60,7 @@
// XAppend
sdbcx::ObjectType OViews::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
{
OAdoView* pView = getImplementation<OAdoView>( descriptor );
OAdoView* pView = getUnoTunnelImplementation<OAdoView>( descriptor );
if ( pView == nullptr )
m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_VIEW_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
diff --git a/include/comphelper/types.hxx b/include/comphelper/types.hxx
index e25c38d..b35fbef 100644
--- a/include/comphelper/types.hxx
+++ b/include/comphelper/types.hxx
@@ -51,16 +51,6 @@
}
}
template <class TYPE>
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