summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-07-10 19:24:15 +0200
committerEike Rathke <erack@redhat.com>2013-07-10 19:24:30 +0200
commit02a48793c078ca363e38b3846fb68ee3ebd5ce38 (patch)
tree61afb943bc9f4c4b191086f26098219927a5c192 /svl
parent166c0724acc28ef121ea75d10ee3f7f95942f27f (diff)
use LanguageTag to convert
Change-Id: I45fe02ca4cc3c171cc7f230093ca9623d7e69980
Diffstat (limited to 'svl')
-rw-r--r--svl/source/config/asiancfg.cxx24
1 files changed, 5 insertions, 19 deletions
diff --git a/svl/source/config/asiancfg.cxx b/svl/source/config/asiancfg.cxx
index 57d903c91e1f..99e36eb439eb 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);
}
}