[Libreoffice-commits] core.git: vcl/source
Eike Rathke
erack at redhat.com
Thu Apr 25 05:23:41 PDT 2013
vcl/source/gdi/impimagetree.cxx | 23 ++++++-----------------
1 file changed, 6 insertions(+), 17 deletions(-)
New commits:
commit 53b8d25caa1e000eeca27f3ca4f92d9cda83c652
Author: Eike Rathke <erack at redhat.com>
Date: Thu Apr 25 14:22:45 2013 +0200
use LanguageTag fallback
Change-Id: I34c532dc7d1c71724a5c0e29c113f2d6510cc2d7
diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx
index 29f3e7a..d7c50d9 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));
}
}
}
More information about the Libreoffice-commits
mailing list