зеркало из https://github.com/mozilla/pjs.git
Bug 548545 - don't try to get an atom for a NULL string. r=roc
This commit is contained in:
Родитель
ff873a3e39
Коммит
90f31b1c0b
|
@ -74,7 +74,14 @@ nsThebesFontEnumerator::EnumerateFonts(const char *aLangGroup,
|
|||
else
|
||||
generic.SetIsVoid(PR_TRUE);
|
||||
|
||||
nsCOMPtr<nsIAtom> langGroupAtom = do_GetAtom(aLangGroup);
|
||||
nsCOMPtr<nsIAtom> langGroupAtom;
|
||||
if (aLangGroup) {
|
||||
nsCAutoString lowered;
|
||||
lowered.Assign(aLangGroup);
|
||||
ToLowerCase(lowered);
|
||||
langGroupAtom = do_GetAtom(lowered);
|
||||
}
|
||||
|
||||
nsresult rv = gfxPlatform::GetPlatform()->GetFontList(langGroupAtom, generic, fontList);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
|
|
|
@ -282,8 +282,10 @@ gfxFontconfigUtils::GetFontList(nsIAtom *aLangGroup,
|
|||
aListOfFonts.Clear();
|
||||
|
||||
nsTArray<nsCString> fonts;
|
||||
nsCString langGroupStr;
|
||||
nsCAutoString langGroupStr;
|
||||
if (aLangGroup) {
|
||||
aLangGroup->ToUTF8String(langGroupStr);
|
||||
}
|
||||
nsresult rv = GetFontListInternal(fonts, langGroupStr);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
|
|
@ -115,8 +115,10 @@ gfxOS2Platform::GetFontList(nsIAtom *aLangGroup,
|
|||
nsTArray<nsString>& aListOfFonts)
|
||||
{
|
||||
#ifdef DEBUG_thebes
|
||||
const char *langgroup;
|
||||
const char *langgroup = "(null)";
|
||||
if (aLangGroup) {
|
||||
aLangGroup->GetUTF8String(&langgroup);
|
||||
}
|
||||
char *family = ToNewCString(aGenericFamily);
|
||||
printf("gfxOS2Platform::GetFontList(%s, %s, ..)\n",
|
||||
langgroup, family);
|
||||
|
|
Загрузка…
Ссылка в новой задаче