summaryrefslogtreecommitdiff
path: root/formula
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 /formula
parent1aa4df615fa5599d05e9dd5e925b5852676185fa (diff)
use SAL_N_ELEMENTS more widely
found using git grep -n 'sizeof.*/.*sizeof.*[0]' Change-Id: Icd4a6cc1ca8ec8ebd68e1701a02789c74cf0eb2a
Diffstat (limited to 'formula')
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index ba0e03e194ff..2560e39ca3aa 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -365,7 +365,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
{ FormulaMapGroupSpecialOffset::MACRO , ocMacro } ,
{ FormulaMapGroupSpecialOffset::COL_ROW_NAME , ocColRowName }
};
- const size_t nCount = sizeof(aMap)/sizeof(aMap[0]);
+ const size_t nCount = SAL_N_ELEMENTS(aMap);
// Preallocate vector elements.
if (aVec.size() < nCount)
{
@@ -405,7 +405,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
SC_OPCODE_CLOSE,
SC_OPCODE_SEP,
};
- lclPushOpCodeMapEntries( aVec, mpTable, aOpCodes, sizeof(aOpCodes)/sizeof(aOpCodes[0]) );
+ lclPushOpCodeMapEntries( aVec, mpTable, aOpCodes, SAL_N_ELEMENTS(aOpCodes) );
}
if ((nGroups & FormulaMapGroup::ARRAY_SEPARATORS) != 0)
{
@@ -415,7 +415,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
SC_OPCODE_ARRAY_ROW_SEP,
SC_OPCODE_ARRAY_COL_SEP
};
- lclPushOpCodeMapEntries( aVec, mpTable, aOpCodes, sizeof(aOpCodes)/sizeof(aOpCodes[0]) );
+ lclPushOpCodeMapEntries( aVec, mpTable, aOpCodes, SAL_N_ELEMENTS(aOpCodes) );
}
if ((nGroups & FormulaMapGroup::UNARY_OPERATORS) != 0)
{
@@ -475,7 +475,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
SC_OPCODE_NOT,
SC_OPCODE_NEG
};
- lclPushOpCodeMapEntries( aVec, mpTable, aOpCodes, sizeof(aOpCodes)/sizeof(aOpCodes[0]) );
+ lclPushOpCodeMapEntries( aVec, mpTable, aOpCodes, SAL_N_ELEMENTS(aOpCodes) );
// functions with 2 or more parameters.
for (sal_uInt16 nOp = SC_OPCODE_START_2_PAR; nOp < SC_OPCODE_STOP_2_PAR && nOp < mnSymbols; ++nOp)
{