diff options
author | Eike Rathke <erack@redhat.com> | 2024-09-02 11:35:21 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-09-11 17:23:41 +0200 |
commit | beda01bf3a7f805aa3f90c51cad5732b0cb1cce0 (patch) | |
tree | 4764a279b300eaa314ddcaec2ef18480f0db7b39 /sc | |
parent | 26fa1ac0d738d2c6de780545848abf10f823a9c0 (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>
(cherry picked from commit 79ed97b93be2711bab5530d8ddc18e318be644d9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172757
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
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 e84a02802c01..ec1c53b22bf2 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; } |