diff options
author | Eike Rathke <erack@redhat.com> | 2022-08-02 19:09:03 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2022-08-02 20:22:47 +0200 |
commit | dac843c4dc0407430d5a7441fd80940a99a4d8f8 (patch) | |
tree | dbdd1ecef0175536d06367e171bdb7cd4f76cdac /scaddins | |
parent | 562b67b78783e578dea91669dbb7770d3249d1d8 (diff) |
Use nNumOfLoc instead of sizeof(pLang)
... which is count*sizeof(char*), but luckily this private
function was never used with out-of-bounds values.
Change-Id: Ief3b3de614ca0df00c424f7caabf70e029ea7266
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137703
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'scaddins')
-rw-r--r-- | scaddins/source/analysis/analysis.cxx | 2 | ||||
-rw-r--r-- | scaddins/source/datefunc/datefunc.cxx | 2 | ||||
-rw-r--r-- | scaddins/source/pricing/pricing.cxx | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index 9ad63bc15efa..9c9fc9718c59 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -298,7 +298,7 @@ inline const lang::Locale& AnalysisAddIn::GetLocale( sal_uInt32 nInd ) if( !pDefLocales ) InitDefLocales(); - if( nInd < sizeof( pLang ) ) + if( nInd < nNumOfLoc ) return pDefLocales[ nInd ]; else return aFuncLoc; diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx index 3ca23c5f0571..92492b29d150 100644 --- a/scaddins/source/datefunc/datefunc.cxx +++ b/scaddins/source/datefunc/datefunc.cxx @@ -120,7 +120,7 @@ const lang::Locale& ScaDateAddIn::GetLocale( sal_uInt32 nIndex ) if( !pDefLocales ) InitDefLocales(); - return (nIndex < sizeof( pLang )) ? pDefLocales[ nIndex ] : aFuncLoc; + return (nIndex < nNumOfLoc) ? pDefLocales[ nIndex ] : aFuncLoc; } void ScaDateAddIn::InitData() diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx index 3961603bc04b..8652defb3ac0 100644 --- a/scaddins/source/pricing/pricing.cxx +++ b/scaddins/source/pricing/pricing.cxx @@ -125,7 +125,7 @@ const lang::Locale& ScaPricingAddIn::GetLocale( sal_uInt32 nIndex ) if( !pDefLocales ) InitDefLocales(); - return (nIndex < sizeof( pLang )) ? pDefLocales[ nIndex ] : aFuncLoc; + return (nIndex < nNumOfLoc) ? pDefLocales[ nIndex ] : aFuncLoc; } void ScaPricingAddIn::InitData() |