diff options
author | Eike Rathke <erack@redhat.com> | 2012-08-10 14:07:15 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-08-10 15:04:10 +0200 |
commit | 1166c01b84b5206feacc3af078eeb525bbb1eb86 (patch) | |
tree | ce2618fa24665983f542eb01c92a5b4718585f6c /i18npool | |
parent | Missing mutex lock (diff) | |
download | core-1166c01b84b5206feacc3af078eeb525bbb1eb86.tar.gz core-1166c01b84b5206feacc3af078eeb525bbb1eb86.zip |
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.cxx | 3 |
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"); |