diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-11-29 22:06:02 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-12-01 09:07:49 +0100 |
commit | 40d52cfe3b64e6bac035caed825486546bba5280 (patch) | |
tree | f487e857026a90593db9e09a12744edb3393e5b6 | |
parent | c2ee336288dcee103f297a55287fbca596a6c7a1 (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>
-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* |