[PATCH] use LanguageTag fallback
Eike Rathke (via Code Review)
gerrit at gerrit.libreoffice.org
Mon Apr 29 06:17:20 PDT 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3675
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/75/3675/1
use LanguageTag fallback
Change-Id: I34c532dc7d1c71724a5c0e29c113f2d6510cc2d7
---
M vcl/source/gdi/impimagetree.cxx
1 file changed, 6 insertions(+), 17 deletions(-)
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 @@
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));
}
}
}
--
To view, visit https://gerrit.libreoffice.org/3675
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I34c532dc7d1c71724a5c0e29c113f2d6510cc2d7
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Eike Rathke <erack at redhat.com>
More information about the LibreOffice
mailing list