diff options
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/Library_configmgr.mk | 1 | ||||
-rw-r--r-- | configmgr/source/configurationprovider.cxx | 16 |
2 files changed, 5 insertions, 12 deletions
diff --git a/configmgr/Library_configmgr.mk b/configmgr/Library_configmgr.mk index 3cd2ff1cdd0c..3cc6bee38604 100644 --- a/configmgr/Library_configmgr.mk +++ b/configmgr/Library_configmgr.mk @@ -74,6 +74,7 @@ $(eval $(call gb_Library_use_libraries,configmgr, \ sal \ salhelper \ xmlreader \ + i18nisolang1 \ $(gb_UWINAPI) \ )) diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx index 84f9456b3b7e..bd84e8cb6f98 100644 --- a/configmgr/source/configurationprovider.cxx +++ b/configmgr/source/configurationprovider.cxx @@ -57,6 +57,8 @@ #include "rtl/ustring.h" #include "rtl/ustring.hxx" +#include <i18npool/languagetag.hxx> + #include "components.hxx" #include "configurationprovider.hxx" #include "lock.hxx" @@ -337,20 +339,10 @@ void Service::setLocale(css::lang::Locale const & eLocale) css::lang::Locale Service::getLocale() throw (css::uno::RuntimeException) { osl::MutexGuard guard(*lock_); css::lang::Locale loc; - if ( locale_ == "*" ) { + if ( locale_ == "*" ) { /* FIXME-BCP47: WTF is this?!? */ loc.Language = locale_; } else if (! locale_.isEmpty()) { - try { - comphelper::Locale l(locale_); - loc.Language = l.getLanguage(); - loc.Country = l.getCountry(); - loc.Variant = l.getVariant(); - } catch (comphelper::Locale::MalFormedLocaleException & e) { - throw css::uno::RuntimeException( - (OUString("MalformedLocaleException: ") + - e.Message), - static_cast< cppu::OWeakObject * >(this)); - } + loc = LanguageTag( locale_).getLocale( false); } return loc; } |