diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2016-03-29 10:25:17 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-03-31 11:30:36 +0200 |
commit | 6439005484bdf6754b910b1ce025b3fb33b6623f (patch) | |
tree | 1a00f48ae11d3da3d928f2d3d68b3e299216328c /dbaccess/source/ui | |
parent | 1aa4df615fa5599d05e9dd5e925b5852676185fa (diff) |
use SAL_N_ELEMENTS more widely
found using
git grep -n 'sizeof.*/.*sizeof.*[0]'
Change-Id: Icd4a6cc1ca8ec8ebd68e1701a02789c74cf0eb2a
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r-- | dbaccess/source/ui/browser/genericcontroller.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbadmin.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/LimitBox.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 4 |
4 files changed, 6 insertions, 7 deletions
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 6439cd797ff8..19d51528df6a 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -1153,11 +1153,11 @@ namespace "com.sun.star.formula.FormularProperties", "smath", "com.sun.star.chart.ChartDocument", "schart" }; - OSL_ENSURE( ( sizeof( pTransTable ) / sizeof( pTransTable[0] ) ) % 2 == 0, + OSL_ENSURE( SAL_N_ELEMENTS( pTransTable ) % 2 == 0, "lcl_getModuleHelpModuleName: odd size of translation table!" ); // loop through the table - sal_Int32 nTableEntries = ( sizeof( pTransTable ) / sizeof( pTransTable[0] ) ) / 2; + sal_Int32 nTableEntries = SAL_N_ELEMENTS( pTransTable ) / 2; const sal_Char** pDocumentService = pTransTable; const sal_Char** pHelpModuleName = pTransTable + 1; for ( sal_Int32 j=0; j<nTableEntries; ++j ) diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index ac87241dad9b..6ba1e0799d9b 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -434,7 +434,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp {0,false} }; - OSL_ENSURE(sizeof(aItemInfos)/sizeof(aItemInfos[0]) == DSID_LAST_ITEM_ID,"Invalid Ids!"); + OSL_ENSURE(SAL_N_ELEMENTS(aItemInfos) == DSID_LAST_ITEM_ID,"Invalid Ids!"); _rpPool = new SfxItemPool(OUString("DSAItemPool"), DSID_FIRST_ITEM_ID, DSID_LAST_ITEM_ID, aItemInfos, _rppDefaults); _rpPool->FreezeIdRanges(); diff --git a/dbaccess/source/ui/querydesign/LimitBox.cxx b/dbaccess/source/ui/querydesign/LimitBox.cxx index 445d0380a91f..a5047cf6abcd 100644 --- a/dbaccess/source/ui/querydesign/LimitBox.cxx +++ b/dbaccess/source/ui/querydesign/LimitBox.cxx @@ -100,8 +100,7 @@ void LimitBox::LoadDefaultLimits() { InsertValue( ALL_INT ); - const unsigned nSize = - sizeof(global::aDefLimitAry)/sizeof(global::aDefLimitAry[0]); + const unsigned nSize = SAL_N_ELEMENTS(global::aDefLimitAry); for( unsigned nIndex = 0; nIndex< nSize; ++nIndex) { InsertValue( global::aDefLimitAry[nIndex] ); diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 255792cd56f3..234838971c0a 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -2090,7 +2090,7 @@ sal_Int32 OSelectionBrowseBox::GetNoneVisibleRows() const { sal_Int32 nErg(0); // only the first 11 row are interesting - sal_Int32 nSize = sizeof(nVisibleRowMask) / sizeof(nVisibleRowMask[0]); + sal_Int32 nSize = SAL_N_ELEMENTS(nVisibleRowMask); for(sal_Int32 i=0;i<nSize;i++) { if(!m_bVisibleRow[i]) @@ -2102,7 +2102,7 @@ sal_Int32 OSelectionBrowseBox::GetNoneVisibleRows() const void OSelectionBrowseBox::SetNoneVisbleRow(long nRows) { // only the first 11 row are interesting - sal_Int32 nSize = sizeof(nVisibleRowMask) / sizeof(nVisibleRowMask[0]); + sal_Int32 nSize = SAL_N_ELEMENTS(nVisibleRowMask); for(sal_Int32 i=0;i< nSize;i++) m_bVisibleRow[i] = !(nRows & nVisibleRowMask[i]); } |