summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2021-10-18 20:02:55 +0200
committerEike Rathke <erack@redhat.com>2021-10-18 21:14:24 +0200
commitaec5312ffab24236876693d7a8b55843847f2a48 (patch)
tree9bb5f00e190bb45fa5751ffca936a1bff4a1cb24 /svx
parent3abbb1486f09b377084c3232a921772302ab34ec (diff)
Related: tdf#145173 Ensure known supported system and default document locale
For an unsupported locale like {en-IL} that could had ended up as language-only {en} if the aImplIsoLangEntries map contains such entry as obtained through MsLangId::convertUnxByteStringToLanguage() and Conversion::convertIsoNamesToLanguage(). For the system locale in SvtSysLocale a proper fallback is used but the default document language was propagated as is Other places evaluating MsLangId::getSystemLanguage() are affected as well, those probably will have to be replaced by a call to MsLangId::getRealLanguage(LANGUAGE_SYSTEM) or a newly to be introduced MsLangId::getConfiguredSystemLanguage() and MsLangId::getSystemLanguage() be made private or accessible only by LanguageTag. Change-Id: I87eb9456d5b4ea8d64b0c41fec6bd2739256fb56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123756 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/langbox.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index fcd9c54e3774..ca9344f32bc7 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -356,6 +356,8 @@ weld::ComboBoxEntry SvxLanguageBox::BuildEntry(const LanguageType nLangType, sal
else if (nRealLang == LANGUAGE_USER_SYSTEM_CONFIG)
{
nRealLang = MsLangId::getSystemLanguage();
+ // Whatever we obtained, ensure a known supported locale.
+ nRealLang = LanguageTag(nRealLang).makeFallback().getLanguageType();
aStrEntry += " - " + SvtLanguageTable::GetLanguageString( nRealLang );
}