summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-10-15 10:07:32 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-11-08 11:36:48 +0100
commit1ed7d2fef309a8a71b837d355099732c49cde887 (patch)
tree3205bac6493b8c4468bec7652021bb90fcaaf426 /xmlsecurity
parentcc145029e896b8e65443898f65807a8c5414e0d2 (diff)
use "range for" to iterate through certificates
Reviewed-on: https://gerrit.libreoffice.org/61779 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit f9acea526b9aeb3cf450cd7ee43bd969385865db) Conflicts: xmlsecurity/source/helper/documentsignaturemanager.cxx Change-Id: Ife206ab29f2f8eaa2358f45e6bae2290d95fd4d6
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/helper/documentsignaturemanager.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx
index fd88d0a52e7e..45787b190311 100644
--- a/xmlsecurity/source/helper/documentsignaturemanager.cxx
+++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx
@@ -341,14 +341,13 @@ bool DocumentSignatureManager::add(const uno::Reference<security::XCertificate>&
}
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)
{
- sax::Converter::encodeBase64(aStrBuffer, pCertPath[i]->getEncoded());
- maSignatureHelper.AddEncapsulatedX509Certificate(aStrBuffer.makeStringAndClear());
+ sax::Converter::encodeBase64(aStrBuffer, rxCertificate->getEncoded());
+ OUString aString = aStrBuffer.makeStringAndClear();
+ maSignatureHelper.AddEncapsulatedX509Certificate(aString);
}