diff options
author | Ashwani5009 <ashwani1235kumar@gmail.com> | 2024-04-11 23:53:25 +0530 |
---|---|---|
committer | Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> | 2024-04-12 19:54:13 +0200 |
commit | ea462462db187d87d978cb659df8ca81309fd2e7 (patch) | |
tree | fb91430485d642b8b0a9da2dda9e318a2abe1cae | |
parent | f017fe99f7e7a1beb2c7809b04e069831e706afb (diff) |
tdf#147021 Replace SAL_N_ELEMENTS with std::size
As part of the efforts in #145538 to replace the SAL_N_ELEMENTS()
macro with std::size() and std::ssize(), this commit performs the
necessary changes for a few files in the i18npool module.
Change-Id: Ic64be31b74cd74faf17497a47d6a15158b85184c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166013
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
-rw-r--r-- | i18npool/qa/cppunit/test_breakiterator.cxx | 2 | ||||
-rw-r--r-- | i18npool/source/nativenumber/nativenumbersupplier.cxx | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx index 4463f46270e1..0f2629fe05ec 100644 --- a/i18npool/qa/cppunit/test_breakiterator.cxx +++ b/i18npool/qa/cppunit/test_breakiterator.cxx @@ -368,7 +368,7 @@ void TestBreakIterator::testWordBoundaries() } const sal_Int32 aSinglePositions[] = {0, 1, 3, 4, 6, 7, 9, 10}; - for (size_t j = 1; j < SAL_N_ELEMENTS(aTests); ++j) + for (size_t j = 1; j < std::size(aTests); ++j) { OUString aTest = aBase.replaceAll("xx", OUStringChar(aTests[j])); sal_Int32 nPos = -1; diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx index f57cc2022e2e..57e2355e15c0 100644 --- a/i18npool/source/nativenumber/nativenumbersupplier.cxx +++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx @@ -668,7 +668,7 @@ OUString NativeNumberSupplierService::getNativeNumberString(const OUString& aNum std::size_t nStripCase = 0; size_t nCasing; - for (nCasing = 0; nCasing < SAL_N_ELEMENTS(Casings); ++nCasing) + for (nCasing = 0; nCasing < std::size(Casings); ++nCasing) { if (o3tl::starts_with(rNativeNumberParams, Casings[nCasing].aLiteral)) { @@ -1064,7 +1064,7 @@ static void makeHebrewNumber(sal_Int64 value, OUStringBuffer& output, bool isLas output.append(value == 1000 ? thousand : isLast ? thousands_last : thousands); } else { sal_Int16 nbOfChar = 0; - for (sal_Int32 j = 0; num > 0 && j < sal_Int32(SAL_N_ELEMENTS(HebrewNumberCharArray)); j++) { + for (sal_Int32 j = 0; num > 0 && j < sal_Int32(std::size(HebrewNumberCharArray)); j++) { if (num - HebrewNumberCharArray[j].value >= 0) { nbOfChar++; // https://en.wikipedia.org/wiki/Hebrew_numerals#Key_exceptions @@ -1177,7 +1177,7 @@ static void makeCyrillicNumber(sal_Int64 value, OUStringBuffer& output, bool add addTitlo = false; } - for (sal_Int32 j = 0; num > 0 && j < sal_Int32(SAL_N_ELEMENTS(CyrillicNumberCharArray)); j++) { + for (sal_Int32 j = 0; num > 0 && j < sal_Int32(std::size(CyrillicNumberCharArray)); j++) { if (num < 20 && num > 10) { num -= 10; makeCyrillicNumber(num, output, false); |