diff options
-rw-r--r-- | sc/source/core/tool/addincol.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 131b493be0e3..b36f1cd07743 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -170,7 +170,19 @@ bool ScUnoAddInFuncData::GetExcelName( const LanguageTag& rDestLang, OUString& r return true; } - // Second, try match of fallback search with fallback locales, + // For "en-US" try the most likely fallback of "en". + if (aSearch == "en-US") + { + itNames = std::find_if(rCompNames.begin(), rCompNames.end(), + [](const LocalizedName& rName) { return rName.maLocale == "en"; }); + if (itNames != rCompNames.end()) + { + rRetExcelName = (*itNames).maName; + return true; + } + } + + // Try match of fallback search with fallback locales, // appending also 'en-US' and 'en' to search if not queried. ::std::vector< OUString > aFallbackSearch( rDestLang.getFallbackStrings( true)); if (aSearch != "en-US") @@ -196,7 +208,7 @@ bool ScUnoAddInFuncData::GetExcelName( const LanguageTag& rDestLang, OUString& r if (bFallbackToAny) { - // Third, last resort, use first (default) entry. + // Last resort, use first (default) entry. rRetExcelName = rCompNames[0].maName; return true; } |