Kaydet (Commit) d75dd80a authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#54493 autoenable CJK/CTL ui based on installed keyboards

Change-Id: I66d3c57c88ff64fc3e3a7fa50fb5a173e709e3bf
üst a865cec5
...@@ -197,15 +197,35 @@ void SvtCJKOptions_Impl::Load() ...@@ -197,15 +197,35 @@ void SvtCJKOptions_Impl::Load()
} }
} }
SvtSystemLanguageOptions aSystemLocaleSettings; if (!bCJKFont)
LanguageType eSystemLanguage = aSystemLocaleSettings.GetWin16SystemLanguage();
sal_uInt16 nWinScript = SvtLanguageOptions::GetScriptTypeOfLanguage( eSystemLanguage );
sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage(LANGUAGE_SYSTEM);
if ( !bCJKFont && (( nScriptType & SCRIPTTYPE_ASIAN )||
((eSystemLanguage != LANGUAGE_SYSTEM) && ( nWinScript & SCRIPTTYPE_ASIAN ))))
{ {
SetAll(sal_True); bool bAutoEnableCJK = false;
sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage(LANGUAGE_SYSTEM);
//system locale is CJK
bAutoEnableCJK = (nScriptType & SCRIPTTYPE_ASIAN);
if (!bAutoEnableCJK)
{
SvtSystemLanguageOptions aSystemLocaleSettings;
//windows secondary system locale is CJK
LanguageType eSystemLanguage = aSystemLocaleSettings.GetWin16SystemLanguage();
if (eSystemLanguage != LANGUAGE_SYSTEM)
{
sal_uInt16 nWinScript = SvtLanguageOptions::GetScriptTypeOfLanguage( eSystemLanguage );
bAutoEnableCJK = (nWinScript & SCRIPTTYPE_ASIAN);
}
//CJK keyboard is installed
if (!bAutoEnableCJK)
bAutoEnableCJK = aSystemLocaleSettings.isCJKKeyboardLayoutInstalled();
}
if (bAutoEnableCJK)
{
SetAll(sal_True);
}
} }
bIsLoaded = sal_True; bIsLoaded = sal_True;
} }
......
...@@ -287,21 +287,46 @@ void SvtCTLOptions_Impl::Load() ...@@ -287,21 +287,46 @@ void SvtCTLOptions_Impl::Load()
} }
} }
} }
sal_uInt16 nType = SvtLanguageOptions::GetScriptTypeOfLanguage(LANGUAGE_SYSTEM);
SvtSystemLanguageOptions aSystemLocaleSettings; if (!m_bCTLFontEnabled)
LanguageType eSystemLanguage = aSystemLocaleSettings.GetWin16SystemLanguage();
sal_uInt16 nWinScript = SvtLanguageOptions::GetScriptTypeOfLanguage( eSystemLanguage );
if( !m_bCTLFontEnabled && (( nType & SCRIPTTYPE_COMPLEX ) ||
((eSystemLanguage != LANGUAGE_SYSTEM) && ( nWinScript & SCRIPTTYPE_COMPLEX ))) )
{ {
m_bCTLFontEnabled = sal_True; bool bAutoEnableCTL = false;
sal_uInt16 nLanguage = SvtSysLocale().GetLanguageTag().getLanguageType();
//enable sequence checking for the appropriate languages sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage(LANGUAGE_SYSTEM);
m_bCTLSequenceChecking = m_bCTLRestricted = m_bCTLTypeAndReplace = //system locale is CTL
(MsLangId::needsSequenceChecking( nLanguage) || bAutoEnableCTL = (nScriptType & SCRIPTTYPE_COMPLEX);
MsLangId::needsSequenceChecking( eSystemLanguage));
Commit(); LanguageType eSystemLanguage = LANGUAGE_SYSTEM;
if (!bAutoEnableCTL)
{
SvtSystemLanguageOptions aSystemLocaleSettings;
//windows secondary system locale is CTL
eSystemLanguage = aSystemLocaleSettings.GetWin16SystemLanguage();
if (eSystemLanguage != LANGUAGE_SYSTEM)
{
sal_uInt16 nWinScript = SvtLanguageOptions::GetScriptTypeOfLanguage( eSystemLanguage );
bAutoEnableCTL = (nWinScript & SCRIPTTYPE_COMPLEX);
}
//CTL keyboard is installed
if (!bAutoEnableCTL)
bAutoEnableCTL = aSystemLocaleSettings.isCTLKeyboardLayoutInstalled();
}
if (bAutoEnableCTL)
{
m_bCTLFontEnabled = sal_True;
sal_uInt16 nLanguage = SvtSysLocale().GetLanguageTag().getLanguageType();
//enable sequence checking for the appropriate languages
m_bCTLSequenceChecking = m_bCTLRestricted = m_bCTLTypeAndReplace =
(MsLangId::needsSequenceChecking( nLanguage) ||
MsLangId::needsSequenceChecking( eSystemLanguage));
Commit();
}
} }
m_bIsLoaded = sal_True; m_bIsLoaded = sal_True;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment