[Libreoffice-commits] core.git: svl/source

Eike Rathke erack at redhat.com
Wed Jul 10 10:24:58 PDT 2013


 svl/source/config/asiancfg.cxx |   24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

New commits:
commit 02a48793c078ca363e38b3846fb68ee3ebd5ce38
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jul 10 19:24:15 2013 +0200

    use LanguageTag to convert
    
    Change-Id: I45fe02ca4cc3c171cc7f230093ca9623d7e69980

diff --git a/svl/source/config/asiancfg.cxx b/svl/source/config/asiancfg.cxx
index 57d903c..99e36eb 100644
--- a/svl/source/config/asiancfg.cxx
+++ b/svl/source/config/asiancfg.cxx
@@ -40,31 +40,17 @@
 #include "rtl/ustring.hxx"
 #include "sal/log.hxx"
 #include "sal/types.h"
+#include "i18nlangtag/languagetag.hxx"
 #include "svl/asiancfg.hxx"
 
 namespace {
 
 OUString toString(css::lang::Locale const & locale) {
-    SAL_WARN_IF(
-        locale.Language.indexOf('-') != -1, "svl",
-        "Locale language \"" << locale.Language << "\" contains \"-\"");
-    OUStringBuffer buf(locale.Language);
-    SAL_WARN_IF(
-        locale.Country.isEmpty() && !locale.Variant.isEmpty(), "svl",
-        "Locale has empty country but non-empty variant \"" << locale.Variant
-            << '"');
-    if (!locale.Country.isEmpty()) {
-        buf.append('-');
-        SAL_WARN_IF(
-            locale.Country.indexOf('-') != -1, "svl",
+    SAL_WARN_IF( locale.Language.indexOf('-') != -1, "svl",
+            "Locale language \"" << locale.Language << "\" contains \"-\"");
+    SAL_WARN_IF( locale.Country.indexOf('-') != -1, "svl",
             "Locale country \"" << locale.Country << "\" contains \"-\"");
-        buf.append(locale.Country);
-        if (!locale.Variant.isEmpty()) {
-            buf.append('-');
-            buf.append(locale.Variant);
-        }
-    }
-    return buf.makeStringAndClear();
+    return LanguageTag( locale).getBcp47( false);
 }
 
 }


More information about the Libreoffice-commits mailing list