diff --git a/gfx/src/thebes/nsThebesFontEnumerator.cpp b/gfx/src/thebes/nsThebesFontEnumerator.cpp index 2b4c4083e52..d1e5f817d97 100644 --- a/gfx/src/thebes/nsThebesFontEnumerator.cpp +++ b/gfx/src/thebes/nsThebesFontEnumerator.cpp @@ -74,7 +74,14 @@ nsThebesFontEnumerator::EnumerateFonts(const char *aLangGroup, else generic.SetIsVoid(PR_TRUE); - nsCOMPtr langGroupAtom = do_GetAtom(aLangGroup); + nsCOMPtr 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)) { diff --git a/gfx/thebes/src/gfxFontconfigUtils.cpp b/gfx/thebes/src/gfxFontconfigUtils.cpp index d7635fbb371..1428ece4fb7 100644 --- a/gfx/thebes/src/gfxFontconfigUtils.cpp +++ b/gfx/thebes/src/gfxFontconfigUtils.cpp @@ -282,8 +282,10 @@ gfxFontconfigUtils::GetFontList(nsIAtom *aLangGroup, aListOfFonts.Clear(); nsTArray fonts; - nsCString langGroupStr; - aLangGroup->ToUTF8String(langGroupStr); + nsCAutoString langGroupStr; + if (aLangGroup) { + aLangGroup->ToUTF8String(langGroupStr); + } nsresult rv = GetFontListInternal(fonts, langGroupStr); if (NS_FAILED(rv)) return rv; diff --git a/gfx/thebes/src/gfxOS2Platform.cpp b/gfx/thebes/src/gfxOS2Platform.cpp index b027de78915..982c03d5a36 100644 --- a/gfx/thebes/src/gfxOS2Platform.cpp +++ b/gfx/thebes/src/gfxOS2Platform.cpp @@ -115,8 +115,10 @@ gfxOS2Platform::GetFontList(nsIAtom *aLangGroup, nsTArray& aListOfFonts) { #ifdef DEBUG_thebes - const char *langgroup; - aLangGroup->GetUTF8String(&langgroup); + const char *langgroup = "(null)"; + if (aLangGroup) { + aLangGroup->GetUTF8String(&langgroup); + } char *family = ToNewCString(aGenericFamily); printf("gfxOS2Platform::GetFontList(%s, %s, ..)\n", langgroup, family);