[Libreoffice-commits] core.git: Branch 'aoo/trunk' - stoc/source

Damjan Jovanovic damjan at apache.org
Thu Oct 20 20:23:34 UTC 2016


 stoc/source/javavm/javavm.cxx |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit d61ab2b5a0e35d55cb001e139be791420245bf35
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Thu Oct 20 18:19:18 2016 +0000

    #i86470# Wrong Java locale when using the languagepacks "nl" and "fr"
    
    Languages don't always have a country; if there is no "-" separating
    language and country in the ooLocale registry value, use the entire
    value as the language.
    
    Patch by: me

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index bfb62b6..efebe5c 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -424,14 +424,17 @@ void getDefaultLocaleFromConfig(
     css::uno::Reference<css::registry::XRegistryKey> ooLocale = xRegistryRootKey->openKey(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L10N/ooLocale")));
     css::uno::Reference<css::registry::XRegistryKey> ooSetupSystemLocale = xRegistryRootKey->openKey(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L10N/ooSetupSystemLocale")));
     if(ooLocale.is() && ooLocale->getStringValue().getLength()) {
+        rtl::OUString language;
         sal_Int32 index = ooLocale->getStringValue().indexOf((sal_Unicode) '-');
         if(index >= 0) {
-            rtl::OUString language = ooLocale->getStringValue().copy(0, index);
-            if(language.getLength()) {
-                rtl::OUString prop(RTL_CONSTASCII_USTRINGPARAM("user.language="));
-                prop += language;
-                pjvm->pushProp(prop);
-            }
+            language = ooLocale->getStringValue().copy(0, index);
+        } else {
+            language = ooLocale->getStringValue();
+        }
+        if(language.getLength()) {
+            rtl::OUString prop(RTL_CONSTASCII_USTRINGPARAM("user.language="));
+            prop += language;
+            pjvm->pushProp(prop);
         }
     }
     if(ooSetupSystemLocale.is() && ooSetupSystemLocale->getStringValue().getLength()) {


More information about the Libreoffice-commits mailing list