Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


On 03/28/2013 01:39 AM, Eike Rathke wrote:
commit 4f79c03ba8ca14c3b9798565272a82e4e14ac3d0
Author: Eike Rathke<erack@redhat.com>
Date:   Wed Mar 27 22:49:35 2013 +0100

     use LanguageTag instead of comphelper::Locale

     Change-Id: I98cac783ff1db94d1d7135dd0db8ee0d809b3457

diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx
index 84f9456..bd84e8c 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?!? */

A configuration provider can operate in one of two modes with regards to localized properties. It can either be set up to use a specific locale, and return the best matching localized value for a given localized property. Or it can be set up (via "*") to treat localized properties like sets, where each individual localized value is accessible under the locale's name.

Stephan

          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;
  }


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.