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

2022-11-09 Thread insanetree (via logerrit)
 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 
AuthorDate: Mon Oct 17 23:55:33 2022 +0200
Commit: Hossein 
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 

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; igetDefaultProfile(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 SAL_CALL 
ONSSInitializer::getNS
 
 if (xMozillaBootstrap.is())
 {
-for (std::size_t i=0; i 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 <<


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

2022-10-29 Thread insanetree (via logerrit)
 embedserv/source/inprocserv/dllentry.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 07b6e34397037722d40b2013eef21085eca4f235
Author: insanetree 
AuthorDate: Mon Oct 17 01:41:58 2022 +0200
Commit: Hossein 
CommitDate: Sat Oct 29 20:14:06 2022 +0200

tdf#147021: SAL_N_ELEMENTS changed to std::size

Change-Id: I5633e4bb3658864abde49df1c65b93a2b4592631
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141437
Reviewed-by: Hossein 
Tested-by: Hossein 

diff --git a/embedserv/source/inprocserv/dllentry.cxx 
b/embedserv/source/inprocserv/dllentry.cxx
index 6c06fae47f59..12dee7b0cc85 100644
--- a/embedserv/source/inprocserv/dllentry.cxx
+++ b/embedserv/source/inprocserv/dllentry.cxx
@@ -95,8 +95,8 @@ namespace {
 for ( int nInd = 0; nInd < SUPPORTED_FACTORIES_NUM; nInd++ )
 {
 const wchar_t pSubKeyTemplate[] = 
L"Software\\Classes\\CLSID\\.\\InprocHandler32";
-wchar_t pSubKey[SAL_N_ELEMENTS(pSubKeyTemplate)];
-wcsncpy(pSubKey, pSubKeyTemplate, 
SAL_N_ELEMENTS(pSubKeyTemplate));
+wchar_t pSubKey[std::size(pSubKeyTemplate)];
+wcsncpy(pSubKey, pSubKeyTemplate, std::size(pSubKeyTemplate));
 
 int nGuidLen = GetStringFromClassID( *guidList[nInd], 
[23], 38 );