summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorPragat Pandya <pragat.pandya@gmail.com>2022-05-08 23:56:45 +0530
committerBartosz Kosiorek <gang65@poczta.onet.pl>2022-05-09 20:42:03 +0200
commit6abc09926c9b55a445b906303f56c6ec7fdeabf9 (patch)
tree0dda52e9d57325cc510acfa4d8951e60c84e7409 /cppuhelper
parent0c3950c4954848fde1515a932cc16b38ab961a7d (diff)
tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro
Change-Id: I54257e87da0cd66da59d820c7960c3e4b020fda3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134027 Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> Tested-by: Jenkins
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/qa/unourl/cppu_unourl.cxx18
-rw-r--r--cppuhelper/source/bootstrap.cxx4
2 files changed, 11 insertions, 11 deletions
diff --git a/cppuhelper/qa/unourl/cppu_unourl.cxx b/cppuhelper/qa/unourl/cppu_unourl.cxx
index 1a9ba70f7231..01261724828b 100644
--- a/cppuhelper/qa/unourl/cppu_unourl.cxx
+++ b/cppuhelper/qa/unourl/cppu_unourl.cxx
@@ -67,7 +67,7 @@ namespace cppu_unourl
{ "abc,def=%22", true },
{ "abc,def=\"", true },
{ "abc,def=%ed%a0%80", true } };
- for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
+ for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
try
@@ -117,7 +117,7 @@ namespace cppu_unourl
{ "abc,def=%22", "abc,def=%22" },
{ "abc,def=\"", "abc,def=\"" },
{ "abc,def=%ed%a0%80", "abc,def=%ed%a0%80" } };
- for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
+ for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
OUString aDescriptor;
@@ -165,7 +165,7 @@ namespace cppu_unourl
{ "abc,def=%22", "abc" },
{ "abc,def=\"", "abc" },
{ "abc,def=%ed%a0%80", "abc" } };
- for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
+ for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
OUString aName;
@@ -210,7 +210,7 @@ namespace cppu_unourl
{ "abc,def=xxx,ghi=xxx", "def", true },
{ "abc,def=xxx,ghi=xxx", "ghi", true },
{ "abc,def=xxx,ghi=xxx", "jkl", false } };
- for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
+ for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
bool bPresent = false;
@@ -280,7 +280,7 @@ namespace cppu_unourl
{ "abc,abc=,def=Abc", "def", "Abc" },
{ "abc,abc=,def=aBC", "def", "aBC" },
{ "abc,abc=,def=ABC", "def", "ABC" } };
- for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
+ for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
OUString aValue;
@@ -323,7 +323,7 @@ namespace cppu_unourl
{ "uno:abc;def;1", true },
{ "uno:abc;def;$&+,/:=?@", true },
{ "uno:abc;def;%24&+,/:=?@", false } };
- for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
+ for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
try
@@ -361,7 +361,7 @@ namespace cppu_unourl
{ "uno:ABC;def;ghi", "ABC" },
{ "uno:abc,def=xxx,ghi=xxx;def,ghi=xxx,jkl=xxx;ghi",
"abc,def=xxx,ghi=xxx" } };
- for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
+ for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
OUString aConnection;
@@ -395,7 +395,7 @@ namespace cppu_unourl
{ "uno:abc;DEF;ghi", "DEF" },
{ "uno:abc,def=xxx,ghi=xxx;def,ghi=xxx,jkl=xxx;ghi",
"def,ghi=xxx,jkl=xxx" } };
- for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
+ for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
OUString aProtocol;
@@ -432,7 +432,7 @@ namespace cppu_unourl
{ "uno:abc;def;A", "A" },
{ "uno:abc;def;1", "1" },
{ "uno:abc;def;$&+,/:=?@", "$&+,/:=?@" } };
- for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
+ for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
OUString aObjectName;
diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx
index 34ae38823bec..f468518ba456 100644
--- a/cppuhelper/source/bootstrap.cxx
+++ b/cppuhelper/source/bootstrap.cxx
@@ -142,7 +142,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
if ( hPool == nullptr )
throw BootstrapException( "cannot create random pool!" );
sal_uInt8 bytes[ 16 ];
- if ( rtl_random_getBytes( hPool, bytes, SAL_N_ELEMENTS( bytes ) )
+ if ( rtl_random_getBytes( hPool, bytes, std::size( bytes ) )
!= rtl_Random_E_None )
throw BootstrapException( "random pool error!" );
rtl_random_destroyPool( hPool );
@@ -171,7 +171,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
// start office process
oslProcess hProcess = nullptr;
oslProcessError rc = osl_executeProcess(
- OUString(path + "soffice").pData, ar_args, SAL_N_ELEMENTS( ar_args ),
+ OUString(path + "soffice").pData, ar_args, std::size( ar_args ),
osl_Process_DETACHED,
sec.getHandle(),
nullptr, // => current working dir