diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-06-19 00:10:12 +0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-06-19 07:53:35 +0200 |
commit | 60271c4433372097ef5ecc74e522532ebf5af8e0 (patch) | |
tree | 323259509796f2c88366f31cd5f55bafe2ff8038 /framework | |
parent | 11a1bdc5fa0312111ddf9c1b7779a114b97e361c (diff) |
tdf#39593 Remove GetImplementation from ConstItemContainer and ItemContainer
Replace with comphelper::getUnoTunnelImplementation.
Change-Id: I87e1d3afd3a742926c7054179092d3b58b6b4563
Reviewed-on: https://gerrit.libreoffice.org/74310
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/uielement/constitemcontainer.hxx | 3 | ||||
-rw-r--r-- | framework/inc/uielement/itemcontainer.hxx | 3 | ||||
-rw-r--r-- | framework/source/fwi/uielement/constitemcontainer.cxx | 13 | ||||
-rw-r--r-- | framework/source/fwi/uielement/itemcontainer.cxx | 11 | ||||
-rw-r--r-- | framework/source/fwi/uielement/rootitemcontainer.cxx | 2 |
5 files changed, 8 insertions, 24 deletions
diff --git a/framework/inc/uielement/constitemcontainer.hxx b/framework/inc/uielement/constitemcontainer.hxx index 5efc22b30fdb..9ed27693829d 100644 --- a/framework/inc/uielement/constitemcontainer.hxx +++ b/framework/inc/uielement/constitemcontainer.hxx @@ -56,8 +56,7 @@ class FWI_DLLPUBLIC ConstItemContainer : public ::cppu::WeakImplHelper< virtual ~ConstItemContainer() override; // XUnoTunnel - static const css::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); - static ConstItemContainer* GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) throw(); + static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() throw(); sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) override; // XIndexAccess diff --git a/framework/inc/uielement/itemcontainer.hxx b/framework/inc/uielement/itemcontainer.hxx index d3fb00b56952..156d7ffd4904 100644 --- a/framework/inc/uielement/itemcontainer.hxx +++ b/framework/inc/uielement/itemcontainer.hxx @@ -48,8 +48,7 @@ class FWI_DLLPUBLIC ItemContainer : public ::cppu::WeakImplHelper< css::contai // XInterface, XTypeProvider // XUnoTunnel - static const css::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); - static ItemContainer* GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) throw(); + static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() throw(); // XIndexContainer virtual void SAL_CALL insertByIndex( sal_Int32 Index, const css::uno::Any& Element ) override; diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx b/framework/source/fwi/uielement/constitemcontainer.cxx index d1e45af96492..03d638f10ae6 100644 --- a/framework/source/fwi/uielement/constitemcontainer.cxx +++ b/framework/source/fwi/uielement/constitemcontainer.cxx @@ -151,7 +151,7 @@ Reference< XIndexAccess > ConstItemContainer::deepCopyContainer( const Reference Reference< XIndexAccess > xReturn; if ( rSubContainer.is() ) { - ItemContainer* pSource = ItemContainer::GetImplementation( rSubContainer ); + ItemContainer* pSource = comphelper::getUnoTunnelImplementation<ItemContainer>( rSubContainer ); ConstItemContainer* pSubContainer( nullptr ); if ( pSource ) pSubContainer = new ConstItemContainer( *pSource ); @@ -166,7 +166,7 @@ Reference< XIndexAccess > ConstItemContainer::deepCopyContainer( const Reference // XUnoTunnel sal_Int64 ConstItemContainer::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) { - if( ( rIdentifier.getLength() == 16 ) && ( 0 == memcmp( ConstItemContainer::GetUnoTunnelId().getConstArray(), rIdentifier.getConstArray(), 16 ) ) ) + if( ( rIdentifier.getLength() == 16 ) && ( 0 == memcmp( ConstItemContainer::getUnoTunnelId().getConstArray(), rIdentifier.getConstArray(), 16 ) ) ) { return reinterpret_cast< sal_Int64 >( this ); } @@ -178,18 +178,11 @@ namespace class theConstItemContainerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theConstItemContainerUnoTunnelId > {}; } -const Sequence< sal_Int8 >& ConstItemContainer::GetUnoTunnelId() throw() +const Sequence< sal_Int8 >& ConstItemContainer::getUnoTunnelId() throw() { return theConstItemContainerUnoTunnelId::get().getSeq(); } -ConstItemContainer* ConstItemContainer::GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) throw() -{ - css::uno::Reference< css::lang::XUnoTunnel > xUT( rxIFace, css::uno::UNO_QUERY ); - return xUT.is() ? reinterpret_cast< ConstItemContainer* >(sal::static_int_cast< sal_IntPtr >( - xUT->getSomething( ConstItemContainer::GetUnoTunnelId() ))) : nullptr; -} - // XElementAccess sal_Bool SAL_CALL ConstItemContainer::hasElements() { diff --git a/framework/source/fwi/uielement/itemcontainer.cxx b/framework/source/fwi/uielement/itemcontainer.cxx index 50f8b5a8bd25..8401274534af 100644 --- a/framework/source/fwi/uielement/itemcontainer.cxx +++ b/framework/source/fwi/uielement/itemcontainer.cxx @@ -120,7 +120,7 @@ Reference< XIndexAccess > ItemContainer::deepCopyContainer( const Reference< XIn Reference< XIndexAccess > xReturn; if ( rSubContainer.is() ) { - ConstItemContainer* pSource = ConstItemContainer::GetImplementation( rSubContainer ); + ConstItemContainer* pSource = comphelper::getUnoTunnelImplementation<ConstItemContainer>( rSubContainer ); ItemContainer* pSubContainer( nullptr ); if ( pSource ) pSubContainer = new ItemContainer( *pSource, rMutex ); @@ -137,18 +137,11 @@ namespace class theItemContainerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theItemContainerUnoTunnelId > {}; } -const Sequence< sal_Int8 >& ItemContainer::GetUnoTunnelId() throw() +const Sequence< sal_Int8 >& ItemContainer::getUnoTunnelId() throw() { return theItemContainerUnoTunnelId::get().getSeq(); } -ItemContainer* ItemContainer::GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) throw() -{ - css::uno::Reference< css::lang::XUnoTunnel > xUT( rxIFace, css::uno::UNO_QUERY ); - return xUT.is() ? reinterpret_cast< ItemContainer* >(sal::static_int_cast< sal_IntPtr >( - xUT->getSomething( ItemContainer::GetUnoTunnelId() ))) : nullptr; -} - // XElementAccess sal_Bool SAL_CALL ItemContainer::hasElements() { diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx index 94672302cbda..5b330229cb0b 100644 --- a/framework/source/fwi/uielement/rootitemcontainer.cxx +++ b/framework/source/fwi/uielement/rootitemcontainer.cxx @@ -128,7 +128,7 @@ Reference< XIndexAccess > RootItemContainer::deepCopyContainer( const Reference< Reference< XIndexAccess > xReturn; if ( rSubContainer.is() ) { - ConstItemContainer* pSource = ConstItemContainer::GetImplementation( rSubContainer ); + ConstItemContainer* pSource = comphelper::getUnoTunnelImplementation<ConstItemContainer>( rSubContainer ); ItemContainer* pSubContainer( nullptr ); if ( pSource ) pSubContainer = new ItemContainer( *pSource, m_aShareMutex ); |