Lines 137-142
int main( int argc, char * argv[])
Link Here
|
137 |
#include "jvmaccess/virtualmachine.hxx" |
137 |
#include "jvmaccess/virtualmachine.hxx" |
138 |
#include "osl/file.hxx" |
138 |
#include "osl/file.hxx" |
139 |
#include "osl/thread.h" |
139 |
#include "osl/thread.h" |
|
|
140 |
#include "osl/process.h" |
141 |
#include "rtl/locale.hxx" |
140 |
#include "rtl/bootstrap.hxx" |
142 |
#include "rtl/bootstrap.hxx" |
141 |
#include "rtl/process.h" |
143 |
#include "rtl/process.h" |
142 |
#include "rtl/string.h" |
144 |
#include "rtl/string.h" |
Lines 437-442
void getDefaultLocaleFromConfig(stoc_jav
Link Here
|
437 |
const css::uno::Reference<css::lang::XMultiComponentFactory> & xSMgr, |
439 |
const css::uno::Reference<css::lang::XMultiComponentFactory> & xSMgr, |
438 |
const css::uno::Reference<css::uno::XComponentContext> &xCtx ) throw(css::uno::Exception) |
440 |
const css::uno::Reference<css::uno::XComponentContext> &xCtx ) throw(css::uno::Exception) |
439 |
{ |
441 |
{ |
|
|
442 |
#ifdef UNX |
443 |
rtl::OUString aLocale = rtl::OLocale( osl_getSystemLocale( rtl_LocaleSystemMessages ) ).getRawName(); |
444 |
#else |
440 |
css::uno::Reference<css::uno::XInterface> xConfRegistry = xSMgr->createInstanceWithContext( |
445 |
css::uno::Reference<css::uno::XInterface> xConfRegistry = xSMgr->createInstanceWithContext( |
441 |
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationRegistry")), |
446 |
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationRegistry")), |
442 |
xCtx ); |
447 |
xCtx ); |
Lines 450-464
void getDefaultLocaleFromConfig(stoc_jav
Link Here
|
450 |
|
455 |
|
451 |
// read locale |
456 |
// read locale |
452 |
css::uno::Reference<css::registry::XRegistryKey> locale = xRegistryRootKey->openKey(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L10N/ooLocale"))); |
457 |
css::uno::Reference<css::registry::XRegistryKey> locale = xRegistryRootKey->openKey(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L10N/ooLocale"))); |
453 |
if(locale.is() && locale->getStringValue().getLength()) { |
458 |
rtl::OUString aLocale; |
|
|
459 |
|
460 |
if(locale.is() && locale->getStringValue().getLength()) |
461 |
aLocale = locale->getStringValue(); |
462 |
|
463 |
xConfRegistry_simple->close(); |
464 |
#endif |
465 |
if (aLocale.getLength()) { |
454 |
rtl::OUString language; |
466 |
rtl::OUString language; |
455 |
rtl::OUString country; |
467 |
rtl::OUString country; |
456 |
|
468 |
|
457 |
sal_Int32 index = locale->getStringValue().indexOf((sal_Unicode) '-'); |
469 |
sal_Int32 index = aLocale.indexOf((sal_Unicode) '-'); |
458 |
|
470 |
|
459 |
if(index >= 0) { |
471 |
if(index >= 0) { |
460 |
language = locale->getStringValue().copy(0, index); |
472 |
language = aLocale.copy(0, index); |
461 |
country = locale->getStringValue().copy(index + 1); |
473 |
country = aLocale.copy(index + 1); |
462 |
|
474 |
|
463 |
if(language.getLength()) { |
475 |
if(language.getLength()) { |
464 |
rtl::OUString prop(RTL_CONSTASCII_USTRINGPARAM("user.language=")); |
476 |
rtl::OUString prop(RTL_CONSTASCII_USTRINGPARAM("user.language=")); |
Lines 475-482
void getDefaultLocaleFromConfig(stoc_jav
Link Here
|
475 |
} |
487 |
} |
476 |
} |
488 |
} |
477 |
} |
489 |
} |
478 |
|
|
|
479 |
xConfRegistry_simple->close(); |
480 |
} |
490 |
} |
481 |
|
491 |
|
482 |
void getJavaPropsFromConfig(stoc_javavm::JVM * pjvm, |
492 |
void getJavaPropsFromConfig(stoc_javavm::JVM * pjvm, |