diff options
author | Eike Rathke <erack@redhat.com> | 2024-09-02 11:35:21 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2024-09-02 13:26:18 +0200 |
commit | 79ed97b93be2711bab5530d8ddc18e318be644d9 (patch) | |
tree | 3a2ca04ff8630ce9804d78273994922a84961367 /sc | |
parent | 4b9be7cb9486f0566a7dec973867e1fe7c5ebc5d (diff) |
Add-In CompatibilityName: for "en-US" try the most likely fallback of "en"
As this needs to be resolved for every occurrence of the function
name during export to OOXML and .xls and Add-In authors tend to be
lax with en-US vs en-GB, also because function names usually don't
differ, and use "en" at least in DisplayName.
Change-Id: If0b1b60c4806028c76296e5feaa74e7ddb307bb6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172735
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-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; } |