From e13fd395939ff037a38172a87366a84293df7e30 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Thu, 5 Sep 2013 15:54:14 +0200 Subject: getFallbackStrings() with bIncludeFullBcp47 parameter so the various places that check the full tag first do not have to get it just to delete it again. Change-Id: Ib4e3cf1b16988464db875f1b6ac5cf4a0ab60fe5 --- sc/source/core/tool/addincol.cxx | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'sc') diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 80497c1bf8ee..719b9c1fbad9 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -156,7 +156,7 @@ bool ScUnoAddInFuncData::GetExcelName( LanguageType eDestLang, OUString& rRetExc // Second, try match of fallback search with fallback locales, // appending also 'en-US' and 'en' to search if not queried. - ::std::vector< OUString > aFallbackSearch( aLanguageTag.getFallbackStrings()); + ::std::vector< OUString > aFallbackSearch( aLanguageTag.getFallbackStrings( true)); if (aSearch != "en-US") { aFallbackSearch.push_back( "en-US"); @@ -165,22 +165,16 @@ bool ScUnoAddInFuncData::GetExcelName( LanguageType eDestLang, OUString& rRetExc aFallbackSearch.push_back( "en"); } } - bool bFirst = true; ::std::vector< OUString >::const_iterator itSearch( aFallbackSearch.begin()); for ( ; itSearch != aFallbackSearch.end(); ++itSearch) { itNames = rCompNames.begin(); for ( ; itNames != rCompNames.end(); ++itNames) { - ::std::vector< OUString > aFallbackLocales( LanguageTag( (*itNames).maLocale).getFallbackStrings()); - ::std::vector< OUString >::const_iterator itLocales( aFallbackLocales.begin()); - if (bFirst) - { - // We checked already the full tag, start with second. - if (itLocales != aFallbackLocales.end()) - ++itLocales; - } - for ( ; itLocales != aFallbackLocales.end(); ++itLocales) + // We checked already the full tag, start with second. + ::std::vector< OUString > aFallbackLocales( LanguageTag( (*itNames).maLocale).getFallbackStrings( false)); + for (::std::vector< OUString >::const_iterator itLocales( aFallbackLocales.begin()); + itLocales != aFallbackLocales.end(); ++itLocales) { if (*itLocales == *itSearch) { @@ -189,7 +183,6 @@ bool ScUnoAddInFuncData::GetExcelName( LanguageType eDestLang, OUString& rRetExc } } } - bFirst = false; } // Third, last resort, use first (default) entry. -- cgit