diff options
author | Henry Castro <hcastro@collabora.com> | 2017-12-07 08:49:12 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2017-12-07 18:14:19 +0100 |
commit | 45a27e55d418422cf61ea3d4eed8eb5a6e309c90 (patch) | |
tree | 104f965f18af7b7bc3186fb0cd62c1e7df7f2e7e /desktop | |
parent | 51cdf6248dbdf7a5dcddd2128bbb8f889cec25d6 (diff) |
lok: discard name languages not registered
there is a STR_ARR_SVT_LANGUAGE_TABLE table that all language names are registered
But not all, like locale "es"
{ LANGUAGE_SPANISH_LATIN_AMERICA, "es", "" , k0 }
Avoid that names until get registered appropriately
Change-Id: I148f2c30f72c82c978f5e9a1e977bf4b5e923a9c
Reviewed-on: https://gerrit.libreoffice.org/46027
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 94afb956ebc7..2ea79a076e9a 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2582,10 +2582,15 @@ static char* getLanguages(const char* pCommand) boost::property_tree::ptree aTree; aTree.put("commandName", pCommand); boost::property_tree::ptree aValues; + boost::property_tree::ptree aChild; + OUString sLanguage; for ( sal_Int32 itLocale = 0; itLocale < aLocales.getLength(); itLocale++ ) { - boost::property_tree::ptree aChild; - aChild.put("", SvtLanguageTable::GetLanguageString(LanguageTag::convertToLanguageType(aLocales[itLocale])).toUtf8()); + sLanguage = SvtLanguageTable::GetLanguageString(LanguageTag::convertToLanguageType(aLocales[itLocale])); + if (sLanguage.startsWith("{") && sLanguage.endsWith("}")) + continue; + + aChild.put("", sLanguage.toUtf8()); aValues.push_back(std::make_pair("", aChild)); } aTree.add_child("commandValues", aValues); |