summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-11-22 17:51:11 +0100
committerEike Rathke <erack@redhat.com>2012-11-22 17:52:47 +0100
commita4471c3321105d062f7e3f894065eace5574ff9a (patch)
tree3ebac902e981323277ad6cbdc936b0a12bf07bb8 /i18npool
parent5124b6d83ec6e7755fa96315fb522b9e8f05e652 (diff)
exclude language(-Script) only tags from pRegionT==NULL check
Change-Id: Ie5423578e34a295aad3a03d2b29f3a6b1a6572ce
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/languagetag/languagetag.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/i18npool/source/languagetag/languagetag.cxx b/i18npool/source/languagetag/languagetag.cxx
index cc9fc557ab0d..7f3c15e77d3a 100644
--- a/i18npool/source/languagetag/languagetag.cxx
+++ b/i18npool/source/languagetag/languagetag.cxx
@@ -584,7 +584,14 @@ rtl::OUString LanguageTag::getRegionFromLangtag() const
if (maBcp47.isEmpty())
return aRegion;
const lt_region_t* pRegionT = lt_tag_get_region( MPLANGTAG);
- SAL_WARN_IF( !pRegionT, "i18npool.langtag", "LanguageTag::getRegionFromLangtag: pRegionT==NULL");
+ // pRegionT==NULL is valid for language only tags, rough check here that
+ // does not take sophisticated tags into account that actually should have
+ // a region, check for ll, lll, ll-Ssss and lll-Ssss so that ll-CC and
+ // lll-CC actually fail.
+ SAL_WARN_IF( !pRegionT &&
+ maBcp47.getLength() != 2 && maBcp47.getLength() != 3 &&
+ maBcp47.getLength() != 7 && maBcp47.getLength() != 8,
+ "i18npool.langtag", "LanguageTag::getRegionFromLangtag: pRegionT==NULL");
if (!pRegionT)
return aRegion;
const char* pRegion = lt_region_get_tag( pRegionT);