summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-03-29 10:25:17 +0200
committerNoel Grandin <noel@peralex.com>2016-03-31 11:30:36 +0200
commit6439005484bdf6754b910b1ce025b3fb33b6623f (patch)
tree1a00f48ae11d3da3d928f2d3d68b3e299216328c /linguistic
parent1aa4df615fa5599d05e9dd5e925b5852676185fa (diff)
use SAL_N_ELEMENTS more widely
found using git grep -n 'sizeof.*/.*sizeof.*[0]' Change-Id: Icd4a6cc1ca8ec8ebd68e1701a02789c74cf0eb2a
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/gciterator.cxx2
-rw-r--r--linguistic/source/lngopt.cxx2
-rw-r--r--linguistic/source/lngprophelp.cxx6
-rw-r--r--linguistic/source/misc.cxx2
-rw-r--r--linguistic/workben/sprophelp.cxx2
5 files changed, 7 insertions, 7 deletions
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index 92e27b2a36f3..22b475ec56b3 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -126,7 +126,7 @@ static const sal_Unicode aWhiteSpaces[] =
0xfffb /* INTERLINEAR ANNOTATION TERMINATOR */
};
-static const int nWhiteSpaces = sizeof( aWhiteSpaces ) / sizeof( aWhiteSpaces[0] );
+static const int nWhiteSpaces = SAL_N_ELEMENTS( aWhiteSpaces );
static bool lcl_IsWhiteSpace( sal_Unicode cChar )
{
diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx
index 4c5f832a4255..891164b5feaa 100644
--- a/linguistic/source/lngopt.cxx
+++ b/linguistic/source/lngopt.cxx
@@ -126,7 +126,7 @@ OUString LinguOptions::GetName( sal_Int32 nWID )
OUString aRes;
- sal_Int32 nLen = sizeof (aWID_Name) / sizeof (aWID_Name[0]);
+ sal_Int32 nLen = SAL_N_ELEMENTS(aWID_Name);
if (0 <= nWID && nWID < nLen && aWID_Name[ nWID ].nWID == nWID)
aRes = OUString::createFromAscii(aWID_Name[nWID].pPropertyName);
else
diff --git a/linguistic/source/lngprophelp.cxx b/linguistic/source/lngprophelp.cxx
index 68851a0e1b23..8dccc52a1627 100644
--- a/linguistic/source/lngprophelp.cxx
+++ b/linguistic/source/lngprophelp.cxx
@@ -51,7 +51,7 @@ static const char *aCH[] =
UPN_IS_USE_DICTIONARY_LIST,
};
-static const int nCHCount = sizeof(aCH) / sizeof(aCH[0]);
+static const int nCHCount = SAL_N_ELEMENTS(aCH);
PropertyChgHelper::PropertyChgHelper(
@@ -344,7 +344,7 @@ PropertyHelper_Spell::PropertyHelper_Spell(
Reference< XLinguProperties > &rxPropSet ) :
PropertyChgHelper ( rxSource, rxPropSet, AE_SPELLCHECKER )
{
- AddPropNames( aSP, sizeof(aSP) / sizeof(aSP[0]) );
+ AddPropNames( aSP, SAL_N_ELEMENTS(aSP) );
SetDefaultValues();
GetCurrentValues();
@@ -526,7 +526,7 @@ PropertyHelper_Hyphen::PropertyHelper_Hyphen(
Reference< XLinguProperties > &rxPropSet ) :
PropertyChgHelper ( rxSource, rxPropSet, AE_HYPHENATOR )
{
- AddPropNames( aHP, sizeof(aHP) / sizeof(aHP[0]) );
+ AddPropNames( aHP, SAL_N_ELEMENTS(aHP) );
SetDefaultValues();
GetCurrentValues();
}
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index ba7bf6230e38..a44fb0ed10ca 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -681,7 +681,7 @@ static const sal_uInt32 the_aDigitZeroes [] =
bool HasDigits( const OUString &rText )
{
- static const int nNumDigitZeroes = sizeof(the_aDigitZeroes) / sizeof(the_aDigitZeroes[0]);
+ static const int nNumDigitZeroes = SAL_N_ELEMENTS(the_aDigitZeroes);
const sal_Int32 nLen = rText.getLength();
sal_Int32 i = 0;
diff --git a/linguistic/workben/sprophelp.cxx b/linguistic/workben/sprophelp.cxx
index 8ff57ef41601..e957a06742fe 100644
--- a/linguistic/workben/sprophelp.cxx
+++ b/linguistic/workben/sprophelp.cxx
@@ -174,7 +174,7 @@ static const char *aSP[] =
PropertyHelper_Spell::PropertyHelper_Spell(
const Reference< XInterface > & rxSource,
Reference< XPropertySet > &rxPropSet ) :
- PropertyChgHelper ( rxSource, rxPropSet, aSP, sizeof(aSP) / sizeof(aSP[0]) )
+ PropertyChgHelper ( rxSource, rxPropSet, aSP, SAL_N_ELEMENTS(aSP) )
{
SetDefault();
sal_Int32 nLen = GetPropNames().getLength();