sc/source/ui/formdlg/dwfunctr.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
New commits: commit 1b66e16bcf8630836ef25a831a29212e9ef6be67 Author: Eike Rathke <[email protected]> AuthorDate: Wed Jul 31 21:07:10 2024 +0200 Commit: Adolfo Jayme Barrientos <[email protected]> CommitDate: Tue Aug 13 13:01:04 2024 +0200 Use proper CharClass for uppercase, tdf#122718 follow-up Change-Id: I1109734136e5f7e6fca026228a293498858f82a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171334 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <[email protected]> diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index 96df2105bfbe..4e661f3b510c 100644 --- a/sc/source/ui/formdlg/dwfunctr.cxx +++ b/sc/source/ui/formdlg/dwfunctr.cxx @@ -28,6 +28,7 @@ #include <inputhdl.hxx> #include <tabvwsh.hxx> #include <funcdesc.hxx> +#include <compiler.hxx> #include <dwfunctr.hxx> @@ -220,16 +221,20 @@ void ScFunctionWin::UpdateFunctionList(const OUString& rSearchString) { ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr(); - SvtSysLocale aSysLocale; - const CharClass& rCharClass = aSysLocale.GetCharClass(); - const OUString aSearchStr(rCharClass.uppercase(rSearchString)); + // Use the corresponding CharClass for uppercase() depending on whether + // English function names are used, or localized names. + const CharClass* pCharClass = (ScGlobal::GetStarCalcFunctionList()->IsEnglishFunctionNames() + ? ScCompiler::GetCharClassEnglish() + : ScCompiler::GetCharClassLocalized()); + + const OUString aSearchStr(pCharClass->uppercase(rSearchString)); // First add the functions that start with the search string const ScFuncDesc* pDesc = pFuncMgr->First( nCategory ); while ( pDesc ) { if (rSearchString.isEmpty() - || (rCharClass.uppercase(pDesc->getFunctionName()).startsWith(aSearchStr))) + || (pCharClass->uppercase(pDesc->getFunctionName()).startsWith(aSearchStr))) xFuncList->append(weld::toId(pDesc), *(pDesc->mxFuncName)); pDesc = pFuncMgr->Next(); } @@ -241,7 +246,7 @@ void ScFunctionWin::UpdateFunctionList(const OUString& rSearchString) pDesc = pFuncMgr->First( nCategory ); while ( pDesc ) { - if (rCharClass.uppercase(pDesc->getFunctionName()).indexOf(aSearchStr) > 0) + if (pCharClass->uppercase(pDesc->getFunctionName()).indexOf(aSearchStr) > 0) xFuncList->append(weld::toId(pDesc), *(pDesc->mxFuncName)); pDesc = pFuncMgr->Next(); }
