diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-11-29 22:06:02 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2019-09-22 18:57:40 +0200 |
commit | 9835ac90d002e28249bcac9c951b54cca1901599 (patch) | |
tree | feea4bca909919e9290b82cde5c6f5b05368ba91 | |
parent | 6d4e1c3a3f9903ae3f74fe4caa52e14f46ebd206 (diff) |
xmlsecurity: clean-up code a bit
Change-Id: I4a43f1f33f73919f56150310e7d05244d81b7510
Reviewed-on: https://gerrit.libreoffice.org/64294
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 40d52cfe3b64e6bac035caed825486546bba5280)
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx index 1dc7b735c94e..311ce6aeb69f 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx @@ -135,7 +135,7 @@ SAL_CALL XMLSignature_NssImpl::generate( if( pSecEnv == nullptr ) throw RuntimeException() ; - setErrorRecorder(); + setErrorRecorder(); std::unique_ptr<xmlSecKeysMngr> pMngr(pSecEnv->createKeysManager()); if( !pMngr ) { @@ -283,25 +283,27 @@ SAL_CALL XMLSignature_NssImpl::validate( } /* XServiceInfo */ -OUString SAL_CALL XMLSignature_NssImpl::getImplementationName() { +OUString SAL_CALL XMLSignature_NssImpl::getImplementationName() +{ return OUString("com.sun.star.xml.crypto.XMLSignature"); } /* XServiceInfo */ -sal_Bool SAL_CALL XMLSignature_NssImpl::supportsService( const OUString& serviceName) { - Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; - const OUString* pArray = seqServiceNames.getConstArray() ; - for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { - if( *( pArray + i ) == serviceName ) - return true ; +sal_Bool SAL_CALL XMLSignature_NssImpl::supportsService(const OUString& rServiceName) +{ + for (OUString const & rCurrentServiceName : getSupportedServiceNames()) + { + if (rCurrentServiceName == rServiceName) + return true; } - return false ; + return false; } /* XServiceInfo */ -Sequence< OUString > SAL_CALL XMLSignature_NssImpl::getSupportedServiceNames() { +Sequence<OUString> SAL_CALL XMLSignature_NssImpl::getSupportedServiceNames() +{ Sequence<OUString> seqServiceNames { "com.sun.star.xml.crypto.XMLSignature" }; - return seqServiceNames ; + return seqServiceNames; } extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* |