summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-08-10 14:07:15 +0200
committerEike Rathke <erack@redhat.com>2012-08-10 15:04:10 +0200
commit1166c01b84b5206feacc3af078eeb525bbb1eb86 (patch)
treece2618fa24665983f542eb01c92a5b4718585f6c /i18npool
parent8caf1164ee7cb8e27059d329fbffa3883731c0ae (diff)
region may be empty and then is a valid ISO country for our purposes
Change-Id: I157ea5b5b32ca0664c8eec775de01958f7b55f06
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/languagetag/languagetag.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/i18npool/source/languagetag/languagetag.cxx b/i18npool/source/languagetag/languagetag.cxx
index caaf0cc9418f..112090763cd5 100644
--- a/i18npool/source/languagetag/languagetag.cxx
+++ b/i18npool/source/languagetag/languagetag.cxx
@@ -567,7 +567,8 @@ bool LanguageTag::isIsoLanguage( const rtl::OUString& rLanguage )
bool LanguageTag::isIsoCountry( const rtl::OUString& rRegion )
{
/* TODO: ignore case? For now let's see where rubbish is used. */
- if (rRegion.getLength() == 2 && isUpperAscii( rRegion[0]) && isUpperAscii( rRegion[1]))
+ if (rRegion.isEmpty() ||
+ (rRegion.getLength() == 2 && isUpperAscii( rRegion[0]) && isUpperAscii( rRegion[1])))
return true;
SAL_WARN_IF( rRegion.getLength() == 2 && (isLowerAscii( rRegion[0]) || isLowerAscii( rRegion[1])),
"i18npool.langtag", "LanguageTag::isIsoCountry: rejecting lower case");