[Libreoffice-commits] core.git: i18nlangtag/source
Eike Rathke
erack at redhat.com
Wed Sep 11 16:49:01 PDT 2013
i18nlangtag/source/languagetag/languagetag.cxx | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
New commits:
commit a451dbf0972908b85921d60b313c50b63923db88
Author: Eike Rathke <erack at redhat.com>
Date: Thu Sep 12 01:47:34 2013 +0200
actually check against maBcp47 instead of aVec[0]
Change-Id: I5ba1649cfdc639a71a0c2343793a9f16bde91fa1
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx
index 89f74f2..46579e2 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -1267,8 +1267,9 @@ LanguageTag & LanguageTag::makeFallback()
return aVec;
}
+ getBcp47(); // have maBcp47 now
if (bIncludeFullBcp47)
- aVec.push_back( getBcp47());
+ aVec.push_back( maBcp47);
OUString aVariants( getVariants());
OUString aTmp;
if (hasScript())
@@ -1280,27 +1281,27 @@ LanguageTag & LanguageTag::makeFallback()
if (!aVariants.isEmpty())
{
aTmp = aLanguage + "-" + aScript + "-" + aCountry + "-" + aVariants;
- if (aVec.empty() || aTmp != aVec[0])
+ if (aTmp != maBcp47)
aVec.push_back( aTmp);
// Language with variant but without country before language
// without variant but with country.
aTmp = aLanguage + "-" + aScript + "-" + aVariants;
- if (aVec.empty() || aTmp != aVec[0])
+ if (aTmp != maBcp47)
aVec.push_back( aTmp);
bHaveLanguageScriptVariant = true;
}
aTmp = aLanguage + "-" + aScript + "-" + aCountry;
- if (aVec.empty() || aTmp != aVec[0])
+ if (aTmp != maBcp47)
aVec.push_back( aTmp);
}
if (!aVariants.isEmpty() && !bHaveLanguageScriptVariant)
{
aTmp = aLanguage + "-" + aScript + "-" + aVariants;
- if (aVec.empty() || aTmp != aVec[0])
+ if (aTmp != maBcp47)
aVec.push_back( aTmp);
}
aTmp = aLanguage + "-" + aScript;
- if (aVec.empty() || aTmp != aVec[0])
+ if (aTmp != maBcp47)
aVec.push_back( aTmp);
}
bool bHaveLanguageVariant = false;
@@ -1309,27 +1310,27 @@ LanguageTag & LanguageTag::makeFallback()
if (!aVariants.isEmpty())
{
aTmp = aLanguage + "-" + aCountry + "-" + aVariants;
- if (aVec.empty() || aTmp != aVec[0])
+ if (aTmp != maBcp47)
aVec.push_back( aTmp);
// Language with variant but without country before language
// without variant but with country.
aTmp = aLanguage + "-" + aVariants;
- if (aVec.empty() || aTmp != aVec[0])
+ if (aTmp != maBcp47)
aVec.push_back( aTmp);
bHaveLanguageVariant = true;
}
aTmp = aLanguage + "-" + aCountry;
- if (aVec.empty() || aTmp != aVec[0])
+ if (aTmp != maBcp47)
aVec.push_back( aTmp);
}
if (!aVariants.isEmpty() && !bHaveLanguageVariant)
{
aTmp = aLanguage + "-" + aVariants;
- if (aVec.empty() || aTmp != aVec[0])
+ if (aTmp != maBcp47)
aVec.push_back( aTmp);
}
aTmp = aLanguage;
- if (aVec.empty() || aTmp != aVec[0])
+ if (aTmp != maBcp47)
aVec.push_back( aTmp);
return aVec;
}
More information about the Libreoffice-commits
mailing list