xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |    6 
++---
 xmlsecurity/source/xmlsec/nss/nssinitializer.cxx                      |   12 
+++++-----
 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx         |    2 -
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 0cf5141b2233611286a27930d8030c562eb0d84b
Author:     insanetree <[email protected]>
AuthorDate: Mon Oct 17 23:55:33 2022 +0200
Commit:     Hossein <[email protected]>
CommitDate: Thu Nov 10 02:27:45 2022 +0100

    tdf#147201 Use std::size() instead of SAL_N_ELEMENTS() macro
    
    Change-Id: I38fa927d9964b7212b84d42d5b1bc5f60386139c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141484
    Tested-by: Jenkins
    Reviewed-by: Hossein <[email protected]>

diff --git 
a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx 
b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index e51b84c40d73..a9e58a33c746 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -104,10 +104,10 @@ static void traceTrustStatus(DWORD err)
 {
     if (err == 0)
         SAL_INFO("xmlsecurity.xmlsec", "  " << arErrStrings[0].name);
-    for (std::size_t i = 1; i < SAL_N_ELEMENTS(arErrStrings); i++)
+    for (auto const & arErrStringIter : arErrStrings)
     {
-        if (arErrStrings[i].error & err)
-            SAL_INFO("xmlsecurity.xmlsec", "  " << arErrStrings[i].name);
+        if (arErrStringIter.error & err)
+            SAL_INFO("xmlsecurity.xmlsec", "  " << arErrStringIter.name);
     }
 }
 
diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx 
b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
index e26f72cd0e6a..71bff4dc5c0d 100644
--- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
+++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
@@ -224,13 +224,13 @@ const OUString & 
ONSSInitializer::getMozillaCurrentProfile(const css::uno::Refer
 
     if (xMozillaBootstrap.is())
     {
-        for (std::size_t i=0; i<SAL_N_ELEMENTS(productTypes); ++i)
+        for (auto const productTypeIter : productTypes)
         {
-            OUString profile = 
xMozillaBootstrap->getDefaultProfile(productTypes[i]);
+            OUString profile = 
xMozillaBootstrap->getDefaultProfile(productTypeIter);
 
             if (!profile.isEmpty())
             {
-                OUString sProfilePath = 
xMozillaBootstrap->getProfilePath(productTypes[i], profile);
+                OUString sProfilePath = 
xMozillaBootstrap->getProfilePath(productTypeIter, profile);
                 if (m_sNSSPath.isEmpty())
                 {
                     SAL_INFO("xmlsecurity.xmlsec", "Using Mozilla profile " << 
sProfilePath);
@@ -264,12 +264,12 @@ css::uno::Sequence<css::xml::crypto::NSSProfile> SAL_CALL 
ONSSInitializer::getNS
 
     if (xMozillaBootstrap.is())
     {
-        for (std::size_t i=0; i<SAL_N_ELEMENTS(productTypes); ++i)
+        for (auto const productTypeIter : productTypes)
         {
             uno::Sequence<OUString> aProductProfileList;
-            xMozillaBootstrap->getProfileList(productTypes[i], 
aProductProfileList);
+            xMozillaBootstrap->getProfileList(productTypeIter, 
aProductProfileList);
             for (const auto& sProfile : std::as_const(aProductProfileList))
-                aProfileList.push_back({sProfile, 
xMozillaBootstrap->getProfilePath(productTypes[i], sProfile), productTypes[i]});
+                aProfileList.push_back({sProfile, 
xMozillaBootstrap->getProfilePath(productTypeIter, sProfile), productTypeIter});
         }
     }
 
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx 
b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index 990ea86a9bbb..8872dd96b05a 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -641,7 +641,7 @@ verifyCertificate( const Reference< csss::XCertificate >& 
aCert,
     arUsages[3] = UsageDescription( certificateUsageEmailSigner, 
"certificateUsageEmailSigner" );
     arUsages[4] = UsageDescription( certificateUsageEmailRecipient, 
"certificateUsageEmailRecipient" );
 
-    int numUsages = SAL_N_ELEMENTS(arUsages);
+    int numUsages = std::size(arUsages);
     for (int i = 0; i < numUsages; i++)
     {
         SAL_INFO("xmlsecurity.xmlsec", "Testing usage " << i+1 <<

Reply via email to