include/linguistic/misc.hxx    |    1 -
 linguistic/source/dlistimp.cxx |    7 ++++---
 linguistic/source/misc.cxx     |    6 ------
 3 files changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 80b5d83f8ac858fddb32d2d72d1c2d4f3c64b32a
Author:     Eike Rathke <[email protected]>
AuthorDate: Mon Oct 18 22:42:11 2021 +0200
Commit:     Eike Rathke <[email protected]>
CommitDate: Tue Oct 19 11:35:40 2021 +0200

    Ditch that CharClass constructing ToLower() nonsense
    
    ... and use SvtSysLocale CharClass instead.
    
    Change-Id: I300c3e8ffb1502ef4303cba859dc0b8311be54ab
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123788
    Reviewed-by: Eike Rathke <[email protected]>
    Tested-by: Jenkins

diff --git a/include/linguistic/misc.hxx b/include/linguistic/misc.hxx
index 1ead38427fdc..a7addd9c3246 100644
--- a/include/linguistic/misc.hxx
+++ b/include/linguistic/misc.hxx
@@ -133,7 +133,6 @@ LNG_DLLPUBLIC bool        IsUpper( const OUString &rText, 
sal_Int32 nPos, sal_In
 inline bool        IsUpper( const OUString &rText, LanguageType nLanguage )    
 { return IsUpper( rText, 0, rText.getLength(), nLanguage ); }
 LNG_DLLPUBLIC CapType capitalType(const OUString&, CharClass const *);
 
-OUString      ToLower( const OUString &rText, LanguageType nLanguage );
 LNG_DLLPUBLIC bool      HasDigits( const OUString &rText );
 LNG_DLLPUBLIC bool      IsNumeric( const OUString &rText );
 
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 3fcb59f5d43c..90067e1d4da8 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -38,6 +38,7 @@
 #include <com/sun/star/ucb/SimpleFileAccess.hpp>
 #include <svtools/strings.hrc>
 #include <unotools/resmgr.hxx>
+#include <unotools/charclass.hxx>
 #include <sal/log.hxx>
 
 #include "dlistimp.hxx"
@@ -273,6 +274,7 @@ void DicList::SearchForDictionaries(
 
     const uno::Sequence< OUString > aDirCnt( utl::LocalFileHelper::
                                         GetFolderContents( rDicDirURL, false ) 
);
+    SvtSysLocale aSysLocale;
 
     for (const OUString& aURL : aDirCnt)
     {
@@ -296,8 +298,7 @@ void DicList::SearchForDictionaries(
 
         // Record in the list of Dictionaries
         // When it already exists don't record
-        LanguageType nSystemLanguage = MsLangId::getSystemLanguage();
-        OUString aTmp1 = ToLower( aURL, nSystemLanguage );
+        OUString aTmp1 = aSysLocale.GetCharClass().lowercase( aURL);
         sal_Int32 nPos = aTmp1.lastIndexOf( '/' );
         if (-1 != nPos)
             aTmp1 = aTmp1.copy( nPos + 1 );
@@ -307,7 +308,7 @@ void DicList::SearchForDictionaries(
         for(j = 0;  j < nCount;  j++)
         {
             aTmp2 = rDicList[j]->getName();
-            aTmp2 = ToLower( aTmp2, nSystemLanguage );
+            aTmp2 = aSysLocale.GetCharClass().lowercase( aTmp2);
             if(aTmp1 == aTmp2)
                 break;
         }
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index f541b97551e6..c2ff50b7f527 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -599,12 +599,6 @@ CapType capitalType(const OUString& aTerm, CharClass const 
* pCC)
         return CapType::UNKNOWN;
 }
 
-OUString ToLower( const OUString &rText, LanguageType nLanguage )
-{
-    CharClass aCC(( LanguageTag( nLanguage ) ));
-    return aCC.lowercase( rText );
-}
-
 // sorted(!) array of unicode ranges for code points that are exclusively(!) 
used as numbers
 // and thus may NOT not be part of names or words like the Chinese/Japanese 
number characters
 const sal_uInt32 the_aDigitZeroes [] =

Reply via email to