diff options
author | Eike Rathke <erack@redhat.com> | 2021-11-07 19:00:41 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2021-11-07 20:11:57 +0100 |
commit | 0f3c19ee61ec371aa32d9f51c3555d3ea8ae9eeb (patch) | |
tree | 2f7acabb3e003e8215cbf1adb2ad64d3d7dfbab7 /svtools/source | |
parent | 4f6f70d9f418593fd64788bb204e6f6f36674fce (diff) |
Resolves: tdf#145386 Use "Default" for LANGUAGE_PROCESS_OR_USER_DEFAULT
There's no, specifically not in Writer, handling of the LCID
0x0400 LANGUAGE_PROCESS_OR_USER_DEFAULT language/locale concept
other than the number formatter mapping it to LANGUAGE_SYSTEM.
Use the LANGUAGE_SYSTEM "Default" string in UI (status bar, status
menu, language list) but keep the LCID, and don't append the
resolved locale string as it is also displayed both in the Font
Western and CJK listboxes.
This ends up as two list entries, like
* Default - English (UK) first entry
* Default last entry
of which the second would be selected.
Change-Id: I8d9e4171bee6bbe9d1c9dcfb7a5fa8fc92ea1a2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124449
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/misc/langtab.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx index 9981cf6862b3..00e676d149ef 100644 --- a/svtools/source/misc/langtab.cxx +++ b/svtools/source/misc/langtab.cxx @@ -225,23 +225,24 @@ bool SvtLanguageTable::HasLanguageType( const LanguageType eType ) OUString SvtLanguageTableImpl::GetString( const LanguageType eType ) const { - LanguageType eLang = MsLangId::getReplacementForObsoleteLanguage( eType ); - sal_uInt32 nPos = FindIndex(eLang); + const LanguageType nLang = MsLangId::getReplacementForObsoleteLanguage( eType); + const sal_uInt32 nPos = (eType == LANGUAGE_PROCESS_OR_USER_DEFAULT ? + FindIndex(LANGUAGE_SYSTEM) : FindIndex( nLang)); if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < GetEntryCount() ) return m_aStrings[nPos].first; // Obtain from ICU, or a geeky but usable-in-a-pinch lang-tag. - OUString sLangTag( lcl_getDescription( LanguageTag(eType))); + OUString sLangTag( lcl_getDescription( LanguageTag(nLang))); SAL_WARN("svtools.misc", "Language: 0x" - << std::hex << eType + << std::hex << nLang << " with unknown name, so returning lang-tag of: " << sLangTag); // And add it to the table if it is an on-the-fly-id, which it usually is, // so it is available in all subsequent language boxes. - if (LanguageTag::isOnTheFlyID( eType)) - const_cast<SvtLanguageTableImpl*>(this)->AddItem( sLangTag, eType); + if (LanguageTag::isOnTheFlyID( nLang)) + const_cast<SvtLanguageTableImpl*>(this)->AddItem( sLangTag, nLang); return sLangTag; } |