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 /svtools | |
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 'svtools')
-rw-r--r-- | svtools/source/control/valueacc.cxx | 12 | ||||
-rw-r--r-- | svtools/source/uno/unoimap.cxx | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx index 2f47f2616ae0..8915c319497d 100644 --- a/svtools/source/control/valueacc.cxx +++ b/svtools/source/control/valueacc.cxx @@ -79,7 +79,7 @@ void ValueItemAcc::ParentDestroyed() const uno::Sequence< sal_Int8 >& ValueItemAcc::getUnoTunnelId() { - static const UnoTunnelIdInit theValueItemAccUnoTunnelId; + static const comphelper::UnoIdInit theValueItemAccUnoTunnelId; return theValueItemAccUnoTunnelId.getSeq(); } @@ -89,7 +89,7 @@ ValueItemAcc* ValueItemAcc::getImplementation( const uno::Reference< uno::XInter { try { - return comphelper::getUnoTunnelImplementation<ValueItemAcc>(rxData); + return comphelper::getFromUnoTunnel<ValueItemAcc>(rxData); } catch(const css::uno::Exception&) { @@ -397,7 +397,7 @@ sal_Int64 SAL_CALL ValueItemAcc::getSomething( const uno::Sequence< sal_Int8 >& { sal_Int64 nRet; - if( isUnoTunnelId<ValueItemAcc>(rId) ) + if( comphelper::isUnoTunnelId<ValueItemAcc>(rId) ) nRet = reinterpret_cast< sal_Int64 >( this ); else nRet = 0; @@ -464,7 +464,7 @@ void ValueSetAcc::FireAccessibleEvent( short nEventId, const uno::Any& rOldValue const uno::Sequence< sal_Int8 >& ValueSetAcc::getUnoTunnelId() { - static const UnoTunnelIdInit theValueSetAccUnoTunnelId; + static const comphelper::UnoIdInit theValueSetAccUnoTunnelId; return theValueSetAccUnoTunnelId.getSeq(); } @@ -474,7 +474,7 @@ ValueSetAcc* ValueSetAcc::getImplementation( const uno::Reference< uno::XInterfa { try { - return comphelper::getUnoTunnelImplementation<ValueSetAcc>(rxData); + return comphelper::getFromUnoTunnel<ValueSetAcc>(rxData); } catch(const css::uno::Exception&) { @@ -916,7 +916,7 @@ sal_Int64 SAL_CALL ValueSetAcc::getSomething( const uno::Sequence< sal_Int8 >& r { sal_Int64 nRet; - if( isUnoTunnelId<ValueSetAcc>(rId) ) + if( comphelper::isUnoTunnelId<ValueSetAcc>(rId) ) nRet = reinterpret_cast< sal_Int64 >( this ); else nRet = 0; diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx index 9ac7eb8e03d5..d2645a188c7f 100644 --- a/svtools/source/uno/unoimap.cxx +++ b/svtools/source/uno/unoimap.cxx @@ -566,7 +566,7 @@ SvUnoImageMapObject* SvUnoImageMap::getObject( const Any& aElement ) Reference< XInterface > xObject; aElement >>= xObject; - SvUnoImageMapObject* pObject = comphelper::getUnoTunnelImplementation<SvUnoImageMapObject>( xObject ); + SvUnoImageMapObject* pObject = comphelper::getFromUnoTunnel<SvUnoImageMapObject>( xObject ); if( nullptr == pObject ) throw IllegalArgumentException(); @@ -712,7 +712,7 @@ Reference< XInterface > SvUnoImageMap_createInstance( const ImageMap& rMap, cons bool SvUnoImageMap_fillImageMap( const Reference< XInterface >& xImageMap, ImageMap& rMap ) { - SvUnoImageMap* pUnoImageMap = comphelper::getUnoTunnelImplementation<SvUnoImageMap>( xImageMap ); + SvUnoImageMap* pUnoImageMap = comphelper::getFromUnoTunnel<SvUnoImageMap>( xImageMap ); if( nullptr == pUnoImageMap ) return false; |