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 /xmlsecurity | |
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 'xmlsecurity')
5 files changed, 9 insertions, 9 deletions
diff --git a/xmlsecurity/source/gpg/CertificateImpl.cxx b/xmlsecurity/source/gpg/CertificateImpl.cxx index 96557f02b96b..5a6d8d0bc921 100644 --- a/xmlsecurity/source/gpg/CertificateImpl.cxx +++ b/xmlsecurity/source/gpg/CertificateImpl.cxx @@ -196,7 +196,7 @@ sal_Int32 SAL_CALL CertificateImpl::getCertificateUsage() /* XUnoTunnel */ sal_Int64 SAL_CALL CertificateImpl::getSomething(const Sequence< sal_Int8 >& aIdentifier) { - if( isUnoTunnelId<CertificateImpl>(aIdentifier) ) { + if( comphelper::isUnoTunnelId<CertificateImpl>(aIdentifier) ) { return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this)); } return 0 ; @@ -205,7 +205,7 @@ sal_Int64 SAL_CALL CertificateImpl::getSomething(const Sequence< sal_Int8 >& aId /* XUnoTunnel extension */ const Sequence< sal_Int8>& CertificateImpl::getUnoTunnelId() { - static const UnoTunnelIdInit theCertificateImplUnoTunnelId; + static const comphelper::UnoIdInit theCertificateImplUnoTunnelId; return theCertificateImplUnoTunnelId.getSeq(); } diff --git a/xmlsecurity/source/gpg/SecurityEnvironment.cxx b/xmlsecurity/source/gpg/SecurityEnvironment.cxx index 6660e64f28bb..792b55763e1f 100644 --- a/xmlsecurity/source/gpg/SecurityEnvironment.cxx +++ b/xmlsecurity/source/gpg/SecurityEnvironment.cxx @@ -93,7 +93,7 @@ SecurityEnvironmentGpg::~SecurityEnvironmentGpg() /* XUnoTunnel */ sal_Int64 SAL_CALL SecurityEnvironmentGpg::getSomething( const Sequence< sal_Int8 >& aIdentifier ) { - if( isUnoTunnelId<SecurityEnvironmentGpg>(aIdentifier) ) { + if( comphelper::isUnoTunnelId<SecurityEnvironmentGpg>(aIdentifier) ) { return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this)); } return 0 ; @@ -106,7 +106,7 @@ namespace } const Sequence< sal_Int8>& SecurityEnvironmentGpg::getUnoTunnelId() { - static const UnoTunnelIdInit theSecurityEnvironmentUnoTunnelId; + static const comphelper::UnoIdInit theSecurityEnvironmentUnoTunnelId; return theSecurityEnvironmentUnoTunnelId.getSeq(); } diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index daf70987ef21..17bc19ec33bd 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -154,7 +154,7 @@ Sequence< OUString > SAL_CALL SecurityEnvironment_NssImpl::getSupportedServiceNa /* XUnoTunnel */ sal_Int64 SAL_CALL SecurityEnvironment_NssImpl::getSomething( const Sequence< sal_Int8 >& aIdentifier ) { - if( isUnoTunnelId<SecurityEnvironment_NssImpl>(aIdentifier) ) { + if( comphelper::isUnoTunnelId<SecurityEnvironment_NssImpl>(aIdentifier) ) { return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this)); } return 0 ; @@ -163,7 +163,7 @@ sal_Int64 SAL_CALL SecurityEnvironment_NssImpl::getSomething( const Sequence< sa /* XUnoTunnel extension */ const Sequence< sal_Int8>& SecurityEnvironment_NssImpl::getUnoTunnelId() { - static const UnoTunnelIdInit theSecurityEnvironment_NssImplUnoTunnelId; + static const comphelper::UnoIdInit theSecurityEnvironment_NssImplUnoTunnelId; return theSecurityEnvironment_NssImplUnoTunnelId.getSeq(); } diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx index bd3ad0174273..8a0b3f719eef 100644 --- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx @@ -344,7 +344,7 @@ SECKEYPrivateKey* X509Certificate_NssImpl::getPrivateKey() /* XUnoTunnel */ sal_Int64 SAL_CALL X509Certificate_NssImpl::getSomething( const Sequence< sal_Int8 >& aIdentifier ) { - if( isUnoTunnelId<X509Certificate_NssImpl>(aIdentifier) ) { + if( comphelper::isUnoTunnelId<X509Certificate_NssImpl>(aIdentifier) ) { return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this)); } return 0 ; @@ -353,7 +353,7 @@ sal_Int64 SAL_CALL X509Certificate_NssImpl::getSomething( const Sequence< sal_In /* XUnoTunnel extension */ const Sequence< sal_Int8>& X509Certificate_NssImpl::getUnoTunnelId() { - static const UnoTunnelIdInit theX509Certificate_NssImplUnoTunnelId; + static const comphelper::UnoIdInit theX509Certificate_NssImplUnoTunnelId; return theX509Certificate_NssImplUnoTunnelId.getSeq(); } diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx index d29151b3cfc8..3473171e2961 100644 --- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx +++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx @@ -43,7 +43,7 @@ uno::Sequence< sal_Int8 > XMLElementWrapper_XmlSecImpl::getUnoTunnelId() sal_Int64 SAL_CALL XMLElementWrapper_XmlSecImpl::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) { - if (isUnoTunnelId<XMLElementWrapper_XmlSecImpl>(aIdentifier)) + if (comphelper::isUnoTunnelId<XMLElementWrapper_XmlSecImpl>(aIdentifier)) { return reinterpret_cast < sal_Int64 > ( this ); } |