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 /framework/source/fwi/uielement | |
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 'framework/source/fwi/uielement')
-rw-r--r-- | framework/source/fwi/uielement/constitemcontainer.cxx | 6 | ||||
-rw-r--r-- | framework/source/fwi/uielement/itemcontainer.cxx | 4 | ||||
-rw-r--r-- | framework/source/fwi/uielement/rootitemcontainer.cxx | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx b/framework/source/fwi/uielement/constitemcontainer.cxx index a137a5f8c6b1..8c39d7ee763d 100644 --- a/framework/source/fwi/uielement/constitemcontainer.cxx +++ b/framework/source/fwi/uielement/constitemcontainer.cxx @@ -147,7 +147,7 @@ Reference< XIndexAccess > ConstItemContainer::deepCopyContainer( const Reference Reference< XIndexAccess > xReturn; if ( rSubContainer.is() ) { - ItemContainer* pSource = comphelper::getUnoTunnelImplementation<ItemContainer>( rSubContainer ); + ItemContainer* pSource = comphelper::getFromUnoTunnel<ItemContainer>( rSubContainer ); rtl::Reference<ConstItemContainer> pSubContainer; if ( pSource ) pSubContainer = new ConstItemContainer( *pSource ); @@ -162,7 +162,7 @@ Reference< XIndexAccess > ConstItemContainer::deepCopyContainer( const Reference // XUnoTunnel sal_Int64 ConstItemContainer::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) { - if( isUnoTunnelId<ConstItemContainer>(rIdentifier) ) + if( comphelper::isUnoTunnelId<ConstItemContainer>(rIdentifier) ) { return reinterpret_cast< sal_Int64 >( this ); } @@ -171,7 +171,7 @@ sal_Int64 ConstItemContainer::getSomething( const css::uno::Sequence< sal_Int8 > const Sequence< sal_Int8 >& ConstItemContainer::getUnoTunnelId() noexcept { - static const UnoTunnelIdInit theConstItemContainerUnoTunnelId; + static const comphelper::UnoIdInit theConstItemContainerUnoTunnelId; return theConstItemContainerUnoTunnelId.getSeq(); } diff --git a/framework/source/fwi/uielement/itemcontainer.cxx b/framework/source/fwi/uielement/itemcontainer.cxx index b30791b3067f..1f690452aee2 100644 --- a/framework/source/fwi/uielement/itemcontainer.cxx +++ b/framework/source/fwi/uielement/itemcontainer.cxx @@ -122,7 +122,7 @@ Reference< XIndexAccess > ItemContainer::deepCopyContainer( const Reference< XIn Reference< XIndexAccess > xReturn; if ( rSubContainer.is() ) { - ConstItemContainer* pSource = comphelper::getUnoTunnelImplementation<ConstItemContainer>( rSubContainer ); + ConstItemContainer* pSource = comphelper::getFromUnoTunnel<ConstItemContainer>( rSubContainer ); rtl::Reference<ItemContainer> pSubContainer; if ( pSource ) pSubContainer = new ItemContainer( *pSource, rMutex ); @@ -136,7 +136,7 @@ Reference< XIndexAccess > ItemContainer::deepCopyContainer( const Reference< XIn const Sequence< sal_Int8 >& ItemContainer::getUnoTunnelId() noexcept { - static const UnoTunnelIdInit theItemContainerUnoTunnelId; + static const comphelper::UnoIdInit theItemContainerUnoTunnelId; return theItemContainerUnoTunnelId.getSeq(); } diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx index af754788de8a..2dacda65fe3b 100644 --- a/framework/source/fwi/uielement/rootitemcontainer.cxx +++ b/framework/source/fwi/uielement/rootitemcontainer.cxx @@ -126,7 +126,7 @@ Reference< XIndexAccess > RootItemContainer::deepCopyContainer( const Reference< Reference< XIndexAccess > xReturn; if ( rSubContainer.is() ) { - ConstItemContainer* pSource = comphelper::getUnoTunnelImplementation<ConstItemContainer>( rSubContainer ); + ConstItemContainer* pSource = comphelper::getFromUnoTunnel<ConstItemContainer>( rSubContainer ); rtl::Reference<ItemContainer> pSubContainer; if ( pSource ) pSubContainer = new ItemContainer( *pSource, m_aShareMutex ); @@ -141,14 +141,14 @@ Reference< XIndexAccess > RootItemContainer::deepCopyContainer( const Reference< // XUnoTunnel sal_Int64 RootItemContainer::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) { - if( isUnoTunnelId<RootItemContainer>(rIdentifier) ) + if( comphelper::isUnoTunnelId<RootItemContainer>(rIdentifier) ) return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this )); return 0; } const Sequence< sal_Int8 >& RootItemContainer::getUnoTunnelId() noexcept { - static const UnoTunnelIdInit theRootItemContainerUnoTunnelId; + static const comphelper::UnoIdInit theRootItemContainerUnoTunnelId; return theRootItemContainerUnoTunnelId.getSeq(); } |