summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-10-25 16:50:08 +0200
committerEike Rathke <erack@redhat.com>2016-10-25 16:50:08 +0200
commit4c13c4da1616317555ed3470603ff786db772d64 (patch)
treeaaa161bd60d11d22cb84c94cce859d38c16890af /stoc
parent45a646f2fa1c8161d9fbc4509a2f0b2e826dc63f (diff)
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".
Diffstat (limited to 'stoc')
-rw-r--r--stoc/Library_javavm.mk1
-rw-r--r--stoc/source/javavm/javavm.cxx30
2 files changed, 16 insertions, 15 deletions
diff --git a/stoc/Library_javavm.mk b/stoc/Library_javavm.mk
index fc4428deff3e..a45518c240b2 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 b27df6f2e19b..87196d5e9d63 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);
+ }
}
}