[Libreoffice-commits] core.git: xmlsecurity/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Oct 25 21:34:53 UTC 2018


 xmlsecurity/source/helper/documentsignaturemanager.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit f9acea526b9aeb3cf450cd7ee43bd969385865db
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Oct 15 10:07:32 2018 +0200
Commit:     Tomaž Vajngerl <quikee at 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 <quikee at 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(


More information about the Libreoffice-commits mailing list