Bug 409342. Handle pref lang array correctly. r+sr=pavlov

This commit is contained in:
jdaggett@mozilla.com 2008-01-31 00:41:09 -08:00
Родитель 12b558376a
Коммит ca2c197665
2 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -702,16 +702,17 @@ gfxAtsuiFontGroup::WhichPrefFontSupportsChar(PRUint32 aCh)
for (i = 0; i < numLangs; i++) { for (i = 0; i < numLangs; i++) {
nsAutoTArray<nsRefPtr<MacOSFamilyEntry>, 5> families; nsAutoTArray<nsRefPtr<MacOSFamilyEntry>, 5> families;
eFontPrefLang currentLang = prefLangs[i];
gfxQuartzFontCache *fc = gfxQuartzFontCache::SharedFontCache(); gfxQuartzFontCache *fc = gfxQuartzFontCache::SharedFontCache();
// get the pref families for a single pref lang // get the pref families for a single pref lang
if (!fc->GetPrefFontFamilyEntries(charLang, &families)) { if (!fc->GetPrefFontFamilyEntries(currentLang, &families)) {
eFontPrefLang prefLangs[1] = { charLang }; eFontPrefLang prefLangsToSearch[1] = { currentLang };
PrefFontCallbackData prefFontData(families); PrefFontCallbackData prefFontData(families);
gfxPlatform::ForEachPrefFont(prefLangs, 1, PrefFontCallbackData::AddFontFamilyEntry, gfxPlatform::ForEachPrefFont(prefLangsToSearch, 1, PrefFontCallbackData::AddFontFamilyEntry,
&prefFontData); &prefFontData);
fc->SetPrefFontFamilyEntries(charLang, families); fc->SetPrefFontFamilyEntries(currentLang, families);
} }
// find the first pref font that includes the character // find the first pref font that includes the character

Просмотреть файл

@ -391,7 +391,7 @@ gfxPlatform::GetPrefLangName(eFontPrefLang aLang)
const PRUint32 kFontPrefLangCJKMask = (1 << (PRUint32) eFontPrefLang_Japanese) | (1 << (PRUint32) eFontPrefLang_ChineseTW) const PRUint32 kFontPrefLangCJKMask = (1 << (PRUint32) eFontPrefLang_Japanese) | (1 << (PRUint32) eFontPrefLang_ChineseTW)
| (1 << (PRUint32) eFontPrefLang_ChineseCN) | (1 << (PRUint32) eFontPrefLang_ChineseHK) | (1 << (PRUint32) eFontPrefLang_ChineseCN) | (1 << (PRUint32) eFontPrefLang_ChineseHK)
| (1 << (PRUint32) eFontPrefLang_Korean); | (1 << (PRUint32) eFontPrefLang_Korean) | (1 << (PRUint32) eFontPrefLang_CJKSet);
PRBool PRBool
gfxPlatform::IsLangCJK(eFontPrefLang aLang) gfxPlatform::IsLangCJK(eFontPrefLang aLang)
{ {