xmlsecurity/source/helper/documentsignaturemanager.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
New commits: commit f9acea526b9aeb3cf450cd7ee43bd969385865db Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Mon Oct 15 10:07:32 2018 +0200 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Thu Oct 25 23:34:23 2018 +0200 use "range for" to iterate through certificates Change-Id: Ife206ab29f2f8eaa2358f45e6bae2290d95fd4d6 Reviewed-on: https://gerrit.libreoffice.org/61779 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> 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( _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits