sc/source/ui/formdlg/dwfunctr.cxx |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

New commits:
commit 01e6e4303e5a9966f102e0357fe0354a2f74a1c4
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Wed Jul 31 21:03:28 2024 +0200
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Thu Aug 1 01:34:50 2024 +0200

    Use proper CharClass for uppercase, tdf#122718 follow-up
    
    Change-Id: I1109734136e5f7e6fca026228a293498858f82a0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171333
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins

diff --git a/sc/source/ui/formdlg/dwfunctr.cxx 
b/sc/source/ui/formdlg/dwfunctr.cxx
index f2665e017831..c4cf19cabf94 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -30,6 +30,7 @@
 #include <inputhdl.hxx>
 #include <tabvwsh.hxx>
 #include <funcdesc.hxx>
+#include <compiler.hxx>
 
 #include <dwfunctr.hxx>
 
@@ -258,18 +259,22 @@ void ScFunctionWin::UpdateFunctionList(const OUString& 
rSearchString)
     {
         ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr();
 
-        SvtSysLocale aSysLocale;
-        const CharClass& rCharClass = aSysLocale.GetCharClass();
-        const OUString aSearchStr(rCharClass.uppercase(rSearchString));
-        const ScFuncDesc* pDesc = pFuncMgr->First(nCategory);
+        // 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));
 
+        const ScFuncDesc* pDesc = pFuncMgr->First(nCategory);
         while (pDesc)
         {
             OUString aCategory = pDesc->getCategory()->getName();
             OUString aFunction = pDesc->getFunctionName();
             OUString aFuncDescId = weld::toId(pDesc);
 
-            if (!bFilter || 
(rCharClass.uppercase(aFunction).startsWith(aSearchStr)))
+            if (!bFilter || 
(pCharClass->uppercase(aFunction).startsWith(aSearchStr)))
             {
                 weld::TreeIter* pCategory = FillCategoriesMap(aCategory, 
bCollapse);
                 xFuncList->insert(pCategory, -1, &aFunction, &aFuncDescId, 
nullptr, nullptr,
@@ -289,7 +294,7 @@ void ScFunctionWin::UpdateFunctionList(const OUString& 
rSearchString)
                 OUString aFunction = pDesc->getFunctionName();
                 OUString aFuncDescId = weld::toId(pDesc);
 
-                if (rCharClass.uppercase(aFunction).indexOf(aSearchStr) > 0)
+                if (pCharClass->uppercase(aFunction).indexOf(aSearchStr) > 0)
                 {
                     weld::TreeIter* pCategory = FillCategoriesMap(aCategory, 
bCollapse);
                     xFuncList->insert(pCategory, -1, &aFunction, &aFuncDescId, 
nullptr, nullptr,

Reply via email to