summaryrefslogtreecommitdiff
path: root/i18npool/source/nativenumber/nativenumbersupplier.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-14 11:31:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-15 08:24:33 +0200
commitec8c98f59869bee0e327d32f39480a0e4b1330bc (patch)
treeee68d29cd51c60a8a939fd454955410e66e3b66c /i18npool/source/nativenumber/nativenumbersupplier.cxx
parent11503e99be09b4e8faa465559fbdacb06e8896cc (diff)
use more SAL_N_ELEMENTS part 3
Change-Id: I82e366fefd2e31928b99840fe76649cc3521e623 Reviewed-on: https://gerrit.libreoffice.org/38789 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool/source/nativenumber/nativenumbersupplier.cxx')
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx18
1 files changed, 7 insertions, 11 deletions
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 43c81b5123a6..4418fc287c45 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -841,13 +841,11 @@ struct HebrewNumberChar {
{ 0x05d0, 1 }
};
-static sal_Int16 nbOfHebrewNumberChar = sizeof(HebrewNumberCharArray)/sizeof(HebrewNumberChar);
-
-static sal_Unicode thousand[] = {0x05d0, 0x05dc, 0x05e3, 0x0};
-static sal_Unicode thousands[] = {0x05d0, 0x05dc, 0x05e4, 0x05d9, 0x0};
-static sal_Unicode thousands_last[] = {0x05d0, 0x05dc, 0x05e4, 0x05d9, 0x05dd, 0x0};
-static sal_Unicode geresh = 0x05f3;
-static sal_Unicode gershayim = 0x05f4;
+static const sal_Unicode thousand[] = {0x05d0, 0x05dc, 0x05e3, 0x0};
+static const sal_Unicode thousands[] = {0x05d0, 0x05dc, 0x05e4, 0x05d9, 0x0};
+static const sal_Unicode thousands_last[] = {0x05d0, 0x05dc, 0x05e4, 0x05d9, 0x05dd, 0x0};
+static const sal_Unicode geresh = 0x05f3;
+static const sal_Unicode gershayim = 0x05f4;
void makeHebrewNumber(sal_Int64 value, OUStringBuffer& output, bool isLast, bool useGeresh)
{
@@ -861,7 +859,7 @@ void makeHebrewNumber(sal_Int64 value, OUStringBuffer& output, bool isLast, bool
output.append(value == 1000 ? thousand : isLast ? thousands_last : thousands);
} else {
sal_Int16 nbOfChar = 0;
- for (sal_Int32 j = 0; num > 0 && j < nbOfHebrewNumberChar; j++) {
+ for (sal_Int32 j = 0; num > 0 && j < sal_Int32(SAL_N_ELEMENTS(HebrewNumberCharArray)); j++) {
if (num - HebrewNumberCharArray[j].value >= 0) {
nbOfChar++;
if (num == 15 || num == 16) // substitution for 15 and 16
@@ -952,8 +950,6 @@ struct CyrillicNumberChar {
{ 0x0430, 1 }
};
-static sal_Int16 nbOfCyrillicNumberChar = sizeof(CyrillicNumberCharArray)/sizeof(CyrillicNumberChar);
-
void makeCyrillicNumber(sal_Int64 value, OUStringBuffer& output, bool addTitlo)
{
sal_Int16 num = sal::static_int_cast<sal_Int16>(value % 1000);
@@ -967,7 +963,7 @@ void makeCyrillicNumber(sal_Int64 value, OUStringBuffer& output, bool addTitlo)
addTitlo = false;
}
- for (sal_Int32 j = 0; num > 0 && j < nbOfCyrillicNumberChar; j++) {
+ for (sal_Int32 j = 0; num > 0 && j < sal_Int32(SAL_N_ELEMENTS(CyrillicNumberCharArray)); j++) {
if (num < 20 && num > 10) {
num -= 10;
makeCyrillicNumber(num, output, false);