diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-26 12:04:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-26 20:51:02 +0200 |
commit | f2b3256297241da458a471d591e582c14d6ab73c (patch) | |
tree | baeafe50b0508e557468f97c82cbd6a2b42ead01 /svl/source/config/cjkoptions.cxx | |
parent | 78adf246d5e99d0f5d91d2e03c1379b154289d8d (diff) |
use officecfg for SvtSystemLanguageOptions
Change-Id: Icf5cf974e4235d9a961e08bfc5689ec58930236e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119515
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl/source/config/cjkoptions.cxx')
-rw-r--r-- | svl/source/config/cjkoptions.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/svl/source/config/cjkoptions.cxx b/svl/source/config/cjkoptions.cxx index 71054f564de4..84c972875f3a 100644 --- a/svl/source/config/cjkoptions.cxx +++ b/svl/source/config/cjkoptions.cxx @@ -22,11 +22,13 @@ #include <o3tl/any.hxx> #include <svl/languageoptions.hxx> #include <i18nlangtag/lang.h> +#include <i18nlangtag/languagetag.hxx> #include <unotools/configitem.hxx> #include <com/sun/star/uno/Any.h> #include <com/sun/star/uno/Sequence.hxx> #include <osl/mutex.hxx> #include <rtl/instance.hxx> +#include <officecfg/System.hxx> #include "itemholder2.hxx" @@ -199,10 +201,11 @@ void SvtCJKOptions_Impl::Load() if (!bAutoEnableCJK) { - SvtSystemLanguageOptions aSystemLocaleSettings; - //windows secondary system locale is CJK - LanguageType eSystemLanguage = aSystemLocaleSettings.GetWin16SystemLanguage(); + OUString sWin16SystemLocale = officecfg::System::L10N::SystemLocale::get(); + LanguageType eSystemLanguage = LANGUAGE_NONE; + if( !sWin16SystemLocale.isEmpty() ) + eSystemLanguage = LanguageTag::convertToLanguageTypeWithFallback( sWin16SystemLocale ); if (eSystemLanguage != LANGUAGE_SYSTEM) { SvtScriptType nWinScript = SvtLanguageOptions::GetScriptTypeOfLanguage( eSystemLanguage ); @@ -211,7 +214,7 @@ void SvtCJKOptions_Impl::Load() //CJK keyboard is installed if (!bAutoEnableCJK) - bAutoEnableCJK = aSystemLocaleSettings.isCJKKeyboardLayoutInstalled(); + bAutoEnableCJK = SvtSystemLanguageOptions::isCJKKeyboardLayoutInstalled(); } if (bAutoEnableCJK) |