From 3f65724ec5fc92d5a0078a99932358ef7091435c Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 13 Sep 2021 11:29:37 +0300 Subject: Use implementing XUnoTunnel part 4 - Change implementations of getSomething to use getSomethingImpl Or where that's impossible, use getSomething_cast to unify this and reduce number of places where we reinterpret_cast. All static methods getting tunnel ids were renamed to getUnoTunnelId, to comply with the convention used in . TODO (in separate commits): - Revise uses of getSomething to use getFromUnoTunnel Change-Id: Ifde9e214b52e5df678de71fcc32d2199c82e85cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122100 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx | 5 +---- xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx | 5 +---- xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx | 8 +------- 3 files changed, 3 insertions(+), 15 deletions(-) (limited to 'xmlsecurity/source/xmlsec') diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index 17bc19ec33bd..f3f22330fb42 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -154,10 +154,7 @@ Sequence< OUString > SAL_CALL SecurityEnvironment_NssImpl::getSupportedServiceNa /* XUnoTunnel */ sal_Int64 SAL_CALL SecurityEnvironment_NssImpl::getSomething( const Sequence< sal_Int8 >& aIdentifier ) { - if( comphelper::isUnoTunnelId(aIdentifier) ) { - return sal::static_int_cast(reinterpret_cast(this)); - } - return 0 ; + return comphelper::getSomethingImpl(aIdentifier, this); } /* XUnoTunnel extension */ diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx index 8a0b3f719eef..9aa964fcc917 100644 --- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx @@ -344,10 +344,7 @@ SECKEYPrivateKey* X509Certificate_NssImpl::getPrivateKey() /* XUnoTunnel */ sal_Int64 SAL_CALL X509Certificate_NssImpl::getSomething( const Sequence< sal_Int8 >& aIdentifier ) { - if( comphelper::isUnoTunnelId(aIdentifier) ) { - return sal::static_int_cast(reinterpret_cast(this)); - } - return 0 ; + return comphelper::getSomethingImpl(aIdentifier, this); } /* XUnoTunnel extension */ diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx index e1000689bd46..9de3930731ab 100644 --- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx +++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx @@ -22,7 +22,6 @@ #include "xmlelementwrapper_xmlsecimpl.hxx" #include #include -#include namespace com::sun::star::uno { class XComponentContext; } @@ -42,12 +41,7 @@ uno::Sequence< sal_Int8 > XMLElementWrapper_XmlSecImpl::getUnoTunnelId() sal_Int64 SAL_CALL XMLElementWrapper_XmlSecImpl::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) { - if (comphelper::isUnoTunnelId(aIdentifier)) - { - return reinterpret_cast < sal_Int64 > ( this ); - } - - return 0; + return comphelper::getSomethingImpl(aIdentifier, this); } /* XServiceInfo */ -- cgit