From a2c9b446243c153653537227da4731ebc945fb73 Mon Sep 17 00:00:00 2001 From: Canberk TURAN Date: Mon, 27 Jan 2020 11:01:25 +0300 Subject: tdf#54938: Adapt supportsService implementations to cppu::supportsService Change-Id: I82fa5528c879f288822fe9795d7d7da19f0abbee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87485 Tested-by: Jenkins Reviewed-by: Muhammet Kara --- xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx | 4 ++-- .../source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'xmlsecurity/source') diff --git a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx index 586a8f70c7a1..de6cf54cd206 100644 --- a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx +++ b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx @@ -21,6 +21,7 @@ #include #include #include +#include using namespace ::com::sun::star::uno ; using ::com::sun::star::lang::XMultiServiceFactory ; @@ -97,8 +98,7 @@ OUString SAL_CALL XMLSignatureTemplateImpl::getImplementationName() { /* XServiceInfo */ sal_Bool SAL_CALL XMLSignatureTemplateImpl::supportsService( const OUString& serviceName) { - Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; - return comphelper::findValue(seqServiceNames, serviceName) != -1; + return cppu::supportsService(this, serviceName); } /* XServiceInfo */ diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx index e1e7b8d12760..d296d885e0f3 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx @@ -34,7 +34,7 @@ #include "x509certificate_mscryptimpl.hxx" #include #include - +#include #include #include "akmngr.hxx" @@ -164,15 +164,8 @@ OUString SAL_CALL SecurityEnvironment_MSCryptImpl::getImplementationName() { /* XServiceInfo */ sal_Bool SAL_CALL SecurityEnvironment_MSCryptImpl::supportsService( const OUString& serviceName) { - uno::Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; - const OUString* pArray = seqServiceNames.getConstArray() ; - for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { - if( *( pArray + i ) == serviceName ) - return true ; - } - return false ; + return cppu::supportsService(this, serviceName); } - /* XServiceInfo */ uno::Sequence< OUString > SAL_CALL SecurityEnvironment_MSCryptImpl::getSupportedServiceNames() { uno::Sequence seqServiceNames { "com.sun.star.xml.crypto.SecurityEnvironment" }; -- cgit