diff options
author | Eike Rathke <erack@redhat.com> | 2013-04-25 14:22:45 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-04-25 14:23:20 +0200 |
commit | 53b8d25caa1e000eeca27f3ca4f92d9cda83c652 (patch) | |
tree | 8c46607d466fc8c0b536bb323073d30cadb1d9c7 /vcl/source | |
parent | 8c51484a973c9448530f76771b19bed858a3b240 (diff) |
use LanguageTag fallback
Change-Id: I34c532dc7d1c71724a5c0e29c113f2d6510cc2d7
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/impimagetree.cxx | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx index 29f3e7a1e2a9..d7c50d980e06 100644 --- a/vcl/source/gdi/impimagetree.cxx +++ b/vcl/source/gdi/impimagetree.cxx @@ -235,23 +235,12 @@ bool ImplImageTree::doLoadImage( if (localized) { sal_Int32 pos = name.lastIndexOf('/'); if (pos != -1) { - /* FIXME-BCP47: this needs to be changed for language tags! */ - css::lang::Locale const & loc = - Application::GetSettings().GetUILanguageTag().getLocale(); - paths.push_back(createPath(name, pos, loc.Language)); - if (!loc.Country.isEmpty()) { - OUStringBuffer b(loc.Language); - b.append(sal_Unicode('-')); - b.append(loc.Country); - OUString p(createPath(name, pos, b.makeStringAndClear())); - paths.push_back(p); - if (!loc.Variant.isEmpty()) { - b.append(p); - b.append(sal_Unicode('-')); - b.append(loc.Variant); - paths.push_back( - createPath(name, pos, b.makeStringAndClear())); - } + // find() uses a reverse iterator, so push in reverse order. + std::vector< OUString > aFallbacks( Application::GetSettings().GetUILanguageTag().getFallbackStrings()); + for (std::vector< OUString >::const_reverse_iterator it( aFallbacks.rbegin()); + it != aFallbacks.rend(); ++it) + { + paths.push_back(createPath(name, pos, *it)); } } } |