diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-06-21 23:21:17 +0300 |
---|---|---|
committer | Arkadiy Illarionov <qarkai@gmail.com> | 2019-06-23 10:12:15 +0200 |
commit | 6d4039c130896c57363bb60982c0b5601c4f0c3e (patch) | |
tree | f8e891e66448882bfed48c312e46d3fa98d22911 /dbaccess | |
parent | 8567d3d2567e83d1a8769651295384cfe5d68ce1 (diff) |
tdf#39593 Remove dbaccess::OContentHelper::getImplementation
Replace with comphelper::getUnoTunnelImplementation.
Change-Id: I533bfcd3959037a2621eb3fd42bf7172b5396c5f
Reviewed-on: https://gerrit.libreoffice.org/74539
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'dbaccess')
4 files changed, 9 insertions, 20 deletions
diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx index 479bcddaa38c..b8e7502247f6 100644 --- a/dbaccess/source/core/dataaccess/ContentHelper.cxx +++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx @@ -83,7 +83,7 @@ void SAL_CALL OContentHelper::disposing() IMPLEMENT_SERVICE_INFO1(OContentHelper,"com.sun.star.comp.sdb.Content","com.sun.star.ucb.Content"); -css::uno::Sequence<sal_Int8> OContentHelper::getUnoTunnelImplementationId() +css::uno::Sequence<sal_Int8> OContentHelper::getUnoTunnelId() { static cppu::OImplementationId aId; return aId.getImplementationId(); @@ -541,23 +541,12 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent // css::lang::XUnoTunnel sal_Int64 OContentHelper::getSomething( const Sequence< sal_Int8 > & rId ) { - if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) + if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) return reinterpret_cast<sal_Int64>(this); return 0; } -OContentHelper* OContentHelper::getImplementation( const Reference< XInterface >& _rxComponent ) -{ - OContentHelper* pContent( nullptr ); - - Reference< XUnoTunnel > xUnoTunnel( _rxComponent, UNO_QUERY ); - if ( xUnoTunnel.is() ) - pContent = reinterpret_cast< OContentHelper* >( xUnoTunnel->getSomething( getUnoTunnelImplementationId() ) ); - - return pContent; -} - Reference< XInterface > SAL_CALL OContentHelper::getParent( ) { ::osl::MutexGuard aGuard(m_aMutex); diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx index c099c0fe8e84..1e0249f32c3b 100644 --- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx +++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/ucb/CommandInfo.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/sdb/ErrorCondition.hpp> +#include <comphelper/servicehelper.hxx> #include <comphelper/types.hxx> #include <ucbhelper/contentidentifier.hxx> @@ -530,7 +531,7 @@ void ODefinitionContainer::implAppend(const OUString& _rName, const Reference< X // #i44786# lcl_ensureName( _rxNewObject, _rName ); - ::rtl::Reference< OContentHelper > pContent = OContentHelper::getImplementation( _rxNewObject ); + ::rtl::Reference< OContentHelper > pContent = comphelper::getUnoTunnelImplementation<OContentHelper>( _rxNewObject ); if ( pContent.is() ) { TContentPtr pImpl = pContent->getImpl(); @@ -589,7 +590,7 @@ void ODefinitionContainer::approveNewObject(const OUString& _sName,const Referen DBA_RES( RID_STR_NAME_ALREADY_USED ), *this ); - ::rtl::Reference< OContentHelper > pContent( OContentHelper::getImplementation( _rxObject ) ); + ::rtl::Reference< OContentHelper > pContent( comphelper::getUnoTunnelImplementation<OContentHelper>( _rxObject ) ); if ( !pContent.is() ) throw IllegalArgumentException( DBA_RES( RID_STR_OBJECT_CONTAINER_MISMATCH ), diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index 9e9a1f8918ea..54e338bcbd00 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -37,6 +37,7 @@ #include <strings.hrc> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/propertysequence.hxx> +#include <comphelper/servicehelper.hxx> #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <vcl/svapp.hxx> @@ -633,9 +634,7 @@ OUString SAL_CALL ODocumentContainer::composeHierarchicalName( const OUString& i ::rtl::Reference<OContentHelper> pContent; try { - Reference<XUnoTunnel> xUnoTunnel(const_cast<ODocumentContainer*>(this)->implGetByName( _sName, true ), UNO_QUERY ); - if ( xUnoTunnel.is() ) - pContent = reinterpret_cast<OContentHelper*>(xUnoTunnel->getSomething(OContentHelper::getUnoTunnelImplementationId())); + pContent = comphelper::getUnoTunnelImplementation<OContentHelper>(const_cast<ODocumentContainer*>(this)->implGetByName( _sName, true )); } catch(const Exception&) { diff --git a/dbaccess/source/core/inc/ContentHelper.hxx b/dbaccess/source/core/inc/ContentHelper.hxx index a1cd45ca094d..93290fda2d52 100644 --- a/dbaccess/source/core/inc/ContentHelper.hxx +++ b/dbaccess/source/core/inc/ContentHelper.hxx @@ -133,7 +133,7 @@ namespace dbaccess // css::lang::XTypeProvider virtual css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId(); + // css::lang::XServiceInfo virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; @@ -163,7 +163,7 @@ namespace dbaccess // css::lang::XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static OContentHelper* getImplementation( const css::uno::Reference< css::uno::XInterface >& _rxComponent ); + static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); // css::container::XChild virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override; |