summaryrefslogtreecommitdiff
path: root/i18npool/source
diff options
context:
space:
mode:
authorKenneth Venken <kenneth.venken@gmail.com>2010-10-18 12:28:33 +0200
committerDavid Tardon <dtardon@redhat.com>2010-10-18 12:28:33 +0200
commitbbe30ed8144fbfee7500b98a67224731c581663e (patch)
tree69c3c4238eb51d2be523c9eb9e1e2a498c36b9cf /i18npool/source
parent309b89b93489c785a7ed2460ad5064ff0422dfd3 (diff)
replace sizeof(foo)/sizeof(foo[0]) by SAL_N_ELEMENTS
Diffstat (limited to 'i18npool/source')
-rw-r--r--i18npool/source/localedata/LocaleNode.cxx3
-rw-r--r--i18npool/source/localedata/localedata.cxx3
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx7
-rw-r--r--i18npool/source/paper/paper.cxx5
4 files changed, 11 insertions, 7 deletions
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 3a269618c6aa..73dbc6674cab 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -35,6 +35,7 @@
#include <set>
#include <rtl/ustrbuf.hxx>
+#include <sal/macros.h>
#include "LocaleNode.hxx"
#include <com/sun/star/i18n/NumberFormatIndex.hpp>
@@ -1487,7 +1488,7 @@ void LCMiscNode::generateCode (const OFileWriter &of) const
::rtl::OUString str;
sal_Int16 i;
- for ( i = 0; i < sal_Int16(sizeof(ReserveWord)/sizeof(ReserveWord[0])); i++,nbOfWords++) {
+ for ( i = 0; i < sal_Int16(SAL_N_ELEMENTS(ReserveWord)); i++,nbOfWords++) {
const LocaleNode * curNode = (reserveNode ? reserveNode->findNode(
ReserveWord[i].name) : 0);
if (!curNode)
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index 967dd0b88e4e..1d974d1d701a 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -35,6 +35,7 @@
#include <string.h>
#include <stdio.h>
#include "rtl/instance.hxx"
+#include <sal/macros.h>
using namespace com::sun::star::i18n;
using namespace com::sun::star::uno;
@@ -256,7 +257,7 @@ static const struct {
static const sal_Unicode under = sal_Unicode('_');
-static const sal_Int16 nbOfLocales = sizeof(aLibTable) / sizeof(aLibTable[0]);
+static const sal_Int16 nbOfLocales = SAL_N_ELEMENTS(aLibTable);
struct LocaleDataLookupTableItem
{
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 29d2f6c41adf..5044b6cc1e2f 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -30,6 +30,7 @@
#include "precompiled_i18npool.hxx"
#include <rtl/ustrbuf.hxx>
+#include <sal/macros.h>
#include <nativenumbersupplier.hxx>
#include <localedata.hxx>
#include <data/numberchar.h>
@@ -466,7 +467,7 @@ static const sal_Char *natnum1Locales[] = {
"dz",
"fa"
};
-static sal_Int16 nbOfLocale = sizeof(natnum1Locales)/sizeof(natnum1Locales[0]);
+static sal_Int16 nbOfLocale = SAL_N_ELEMENTS(natnum1Locales);
//! ATTENTION: Do not change order of elements!
//! Number and order must match elements of natnum1Locales!
@@ -497,7 +498,7 @@ static sal_Int16 natnum1[] = {
NumberChar_dz,
NumberChar_EastIndic_ar
};
-static sal_Int16 sizeof_natnum1 = sizeof(natnum1)/sizeof(natnum1[0]);
+static sal_Int16 sizeof_natnum1 = SAL_N_ELEMENTS(natnum1);
//! ATTENTION: Do not change order of elements!
//! Order must match first elements of natnum1Locales!
@@ -508,7 +509,7 @@ static sal_Int16 natnum2[] = {
NumberChar_Upper_ko,
NumberChar_he
};
-static sal_Int16 sizeof_natnum2 = sizeof(natnum2)/sizeof(natnum2[0]);
+static sal_Int16 sizeof_natnum2 = SAL_N_ELEMENTS(natnum2);
#define isLang(lang) rLocale.Language.equalsAsciiL(lang, 2)
#define isCtry(ctry) rLocale.Country.equalsAsciiL(ctry, 2)
diff --git a/i18npool/source/paper/paper.cxx b/i18npool/source/paper/paper.cxx
index 7ab94ef72ec0..9c8911985c14 100644
--- a/i18npool/source/paper/paper.cxx
+++ b/i18npool/source/paper/paper.cxx
@@ -29,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_i18npool.hxx"
#include <sal/config.h>
+#include <sal/macros.h>
#include <rtl/ustring.hxx>
#include <rtl/string.hxx>
#include <comphelper/processfactory.hxx>
@@ -157,7 +158,7 @@ static PageDesc aDinTab[] =
{ IN2MM100( 36 ), IN2MM100( 48 ), "ARCHE", NULL }
};
-static const size_t nTabSize = sizeof(aDinTab) / sizeof(aDinTab[0]);
+static const size_t nTabSize = SAL_N_ELEMENTS(aDinTab);
#define MAXSLOPPY 11
@@ -288,7 +289,7 @@ PaperInfo PaperInfo::getSystemDefaultPaper()
bool bHalve = false;
- size_t nExtraTabSize = sizeof(aCustoms) / sizeof(aCustoms[0]);
+ size_t nExtraTabSize = SAL_N_ELEMENTS(aCustoms);
for (size_t i = 0; i < nExtraTabSize; ++i)
{
if (rtl_str_compareIgnoreAsciiCase(aCustoms[i].pName, aPaper.getStr()) == 0)