diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-10-15 10:07:32 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-10-25 23:34:23 +0200 |
commit | f9acea526b9aeb3cf450cd7ee43bd969385865db (patch) | |
tree | 2efe0ab4ecccaf36dd8f2a08073c0b9be71eec2b /xmlsecurity | |
parent | 40810c43c48b25385b487c0b79c4c466dbf36be7 (diff) |
use "range for" to iterate through certificates
Change-Id: Ife206ab29f2f8eaa2358f45e6bae2290d95fd4d6
Reviewed-on: https://gerrit.libreoffice.org/61779
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/helper/documentsignaturemanager.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx index 095abb543cb6..c247a40db917 100644 --- a/xmlsecurity/source/helper/documentsignaturemanager.cxx +++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx @@ -363,14 +363,13 @@ bool DocumentSignatureManager::add( uno::Sequence<uno::Reference<security::XCertificate>> aCertPath = xSecurityContext->getSecurityEnvironment()->buildCertificatePath(xCert); - const uno::Reference<security::XCertificate>* pCertPath = aCertPath.getConstArray(); - sal_Int32 nCnt = aCertPath.getLength(); OUStringBuffer aStrBuffer; - for (int i = 0; i < nCnt; i++) + for (uno::Reference<security::XCertificate> const& rxCertificate : aCertPath) { - comphelper::Base64::encode(aStrBuffer, pCertPath[i]->getEncoded()); - maSignatureHelper.AddEncapsulatedX509Certificate(aStrBuffer.makeStringAndClear()); + comphelper::Base64::encode(aStrBuffer, rxCertificate->getEncoded()); + OUString aString = aStrBuffer.makeStringAndClear(); + maSignatureHelper.AddEncapsulatedX509Certificate(aString); } std::vector<OUString> aElements = DocumentSignatureHelper::CreateElementList( |