stoc/Library_javavm.mk | 1 - stoc/source/javavm/javavm.cxx | 30 ++++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-)
New commits: commit 4c13c4da1616317555ed3470603ff786db772d64 Author: Eike Rathke <er...@redhat.com> Date: Tue Oct 25 16:50:08 2016 +0200 Revert "Resolves: #i86470# Wrong Java locale when using "nl" and "fr"" This reverts commit 9b09a217c79e8a35fc4de54c89ef49fbf8f72752. Breaks MacOS build because "a URE lib cannot link against an OOO lib; breaks on macOS". diff --git a/stoc/Library_javavm.mk b/stoc/Library_javavm.mk index fc4428d..a45518c 100644 --- a/stoc/Library_javavm.mk +++ b/stoc/Library_javavm.mk @@ -16,7 +16,6 @@ $(eval $(call gb_Library_use_udk_api,javavm)) $(eval $(call gb_Library_use_libraries,javavm,\ cppu \ cppuhelper \ - i18nlangtag \ jvmaccess \ jvmfwk \ sal \ diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index b27df6f..87196d5 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -71,7 +71,6 @@ #include <uno/current_context.hxx> #include <uno/environment.h> #include <jvmfwk/framework.hxx> -#include <i18nlangtag/languagetag.hxx> #include "jni.h" #include <stack> @@ -369,25 +368,28 @@ void getDefaultLocaleFromConfig( // read locale css::uno::Reference<css::registry::XRegistryKey> locale = xRegistryRootKey->openKey("L10N/ooLocale"); if(locale.is() && !locale->getStringValue().isEmpty()) { - LanguageTag aLanguageTag( locale->getStringValue()); OUString language; - OUString script; OUString country; - // Java knows nothing but plain old ISO language and country codes. - aLanguageTag.getIsoLanguageScriptCountry( language, script, country); - if(!language.isEmpty()) { - OUString prop = "user.language=" - + language; + sal_Int32 index = locale->getStringValue().indexOf((sal_Unicode) '-'); - pjvm->pushProp(prop); - } + if(index >= 0) { + language = locale->getStringValue().copy(0, index); + country = locale->getStringValue().copy(index + 1); + + if(!language.isEmpty()) { + OUString prop = "user.language=" + + language; - if(!country.isEmpty()) { - OUString prop = "user.country=" - + country; + pjvm->pushProp(prop); + } - pjvm->pushProp(prop); + if(!country.isEmpty()) { + OUString prop = "user.country=" + + country; + + pjvm->pushProp(prop); + } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits