summaryrefslogtreecommitdiff
path: root/xmlsecurity/source
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-09-06 00:50:24 +0300
committerStephan Bergmann <sbergman@redhat.com>2019-09-06 11:55:50 +0200
commitf599c31fe68882f510cf3d101102e71f9bf795c8 (patch)
treeced0a58620c5aea8420638847192f298d139297b /xmlsecurity/source
parent8811516e2e9e71dd45198081d26c748cdf4d831a (diff)
tdf#39593 use isUnoTunnelId
Adapt getUnoTunnelId methods where required: rename or make public. Change-Id: I0fd2120bf9f0ff1aa690329a65ff64a154c89315 Reviewed-on: https://gerrit.libreoffice.org/78680 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx4
-rw-r--r--xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx4
-rw-r--r--xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx2
-rw-r--r--xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx15
-rw-r--r--xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx2
5 files changed, 11 insertions, 16 deletions
diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx
index bf18360abc16..485c7701be6d 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx
@@ -107,7 +107,7 @@ SAL_CALL XMLSignature_MSCryptImpl::generate(
}
Reference< XUnoTunnel > xNodTunnel( xElement , UNO_QUERY_THROW ) ;
- XMLElementWrapper_XmlSecImpl* pElement = reinterpret_cast<XMLElementWrapper_XmlSecImpl*>(xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ));
+ XMLElementWrapper_XmlSecImpl* pElement = reinterpret_cast<XMLElementWrapper_XmlSecImpl*>(xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelId() ));
if( pElement == nullptr ) {
throw RuntimeException() ;
}
@@ -195,7 +195,7 @@ SAL_CALL XMLSignature_MSCryptImpl::validate(
throw RuntimeException() ;
Reference< XUnoTunnel > xNodTunnel( xElement , UNO_QUERY_THROW ) ;
- XMLElementWrapper_XmlSecImpl* pElement = reinterpret_cast<XMLElementWrapper_XmlSecImpl*>(xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ));
+ XMLElementWrapper_XmlSecImpl* pElement = reinterpret_cast<XMLElementWrapper_XmlSecImpl*>(xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelId() ));
if( pElement == nullptr )
throw RuntimeException() ;
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
index f3a76c76e099..c39f6cc72f76 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
@@ -105,7 +105,7 @@ SAL_CALL XMLSignature_NssImpl::generate(
XMLElementWrapper_XmlSecImpl* pElement =
reinterpret_cast<XMLElementWrapper_XmlSecImpl*>(
sal::static_int_cast<sal_uIntPtr>(
- xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() )));
+ xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelId() )));
if( pElement == nullptr ) {
throw RuntimeException() ;
}
@@ -193,7 +193,7 @@ SAL_CALL XMLSignature_NssImpl::validate(
XMLElementWrapper_XmlSecImpl* pElement =
reinterpret_cast<XMLElementWrapper_XmlSecImpl*>(
sal::static_int_cast<sal_uIntPtr>(
- xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() )));
+ xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelId() )));
if( pElement == nullptr )
throw RuntimeException() ;
diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
index a2ebb134d1e5..5d57ff0709e6 100644
--- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
@@ -380,7 +380,7 @@ xmlNodePtr XMLDocumentWrapper_XmlSecImpl::checkElement( const uno::Reference< cs
= reinterpret_cast<XMLElementWrapper_XmlSecImpl*>(
sal::static_int_cast<sal_uIntPtr>(
xNodTunnel->getSomething(
- XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ))) ;
+ XMLElementWrapper_XmlSecImpl::getUnoTunnelId() ))) ;
if( pElement == nullptr ) {
throw uno::RuntimeException() ;
diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
index 31085431b453..01f8df70230c 100644
--- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
@@ -20,6 +20,7 @@
#include <string.h>
#include "xmlelementwrapper_xmlsecimpl.hxx"
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
@@ -33,7 +34,7 @@ XMLElementWrapper_XmlSecImpl::XMLElementWrapper_XmlSecImpl(const xmlNodePtr pNod
}
/* XUnoTunnel */
-uno::Sequence< sal_Int8 > XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId()
+uno::Sequence< sal_Int8 > XMLElementWrapper_XmlSecImpl::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
@@ -42,18 +43,12 @@ uno::Sequence< sal_Int8 > XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementati
sal_Int64 SAL_CALL XMLElementWrapper_XmlSecImpl::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier )
{
- if (aIdentifier.getLength() == 16 &&
- 0 == memcmp(
- getUnoTunnelImplementationId().getConstArray(),
- aIdentifier.getConstArray(),
- 16 ))
+ if (isUnoTunnelId<XMLElementWrapper_XmlSecImpl>(aIdentifier))
{
return reinterpret_cast < sal_Int64 > ( this );
}
- else
- {
- return 0;
- }
+
+ return 0;
}
/* XServiceInfo */
diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx
index 35c584203b63..43815a224ff8 100644
--- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx
+++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx
@@ -56,7 +56,7 @@ public:
/* css::lang::XUnoTunnel */
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
/// @throws css::uno::RuntimeException
- static css::uno::Sequence < sal_Int8 > getUnoTunnelImplementationId();
+ static css::uno::Sequence < sal_Int8 > getUnoTunnelId();
/* css::lang::XServiceInfo */
virtual OUString SAL_CALL getImplementationName( ) override;