summaryrefslogtreecommitdiff
path: root/xmlsecurity/source
diff options
context:
space:
mode:
authorinsanetree <treebian@tutanota.com>2022-10-17 23:55:33 +0200
committerHossein <hossein@libreoffice.org>2022-11-10 02:27:45 +0100
commit0cf5141b2233611286a27930d8030c562eb0d84b (patch)
tree0e0efe5cbdbe3dd71253093d8bb3ff7cb98f065a /xmlsecurity/source
parent3c0be5564afe1b9cc843a49aba88b72af74c43ab (diff)
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 <hossein@libreoffice.org>
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx6
-rw-r--r--xmlsecurity/source/xmlsec/nss/nssinitializer.cxx12
-rw-r--r--xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx2
3 files changed, 10 insertions, 10 deletions
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 <<