diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 88953bf3e47c..50f5667fcf50 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -1796,8 +1796,6 @@ GetFirstFontMetrics(gfxFontGroup* aFontGroup) if (!aFontGroup) return gfxFont::Metrics(); gfxFont* font = aFontGroup->GetFirstValidFont(); - if (!font) - return gfxFont::Metrics(); return font->GetMetrics(gfxFont::eHorizontal); // XXX vertical } @@ -5682,8 +5680,6 @@ nsTextFrame::PaintTextSelectionDecorations(gfxContext* aCtx, } gfxFont* firstFont = aProvider.GetFontGroup()->GetFirstValidFont(); - if (!firstFont) - return; // OOM gfxFont::Metrics decorationMetrics(firstFont->GetMetrics(gfxFont::eHorizontal)); // XXX vertical? decorationMetrics.underlineOffset = @@ -6377,8 +6373,6 @@ nsTextFrame::CombineSelectionUnderlineRect(nsPresContext* aPresContext, GetFontSizeInflation()); gfxFontGroup* fontGroup = fm->GetThebesFontGroup(); gfxFont* firstFont = fontGroup->GetFirstValidFont(); - if (!firstFont) - return false; // OOM const gfxFont::Metrics& metrics = firstFont->GetMetrics(gfxFont::eHorizontal); // XXX vertical? gfxFloat underlineOffset = fontGroup->GetUnderlineOffset(); diff --git a/layout/mathml/nsMathMLChar.cpp b/layout/mathml/nsMathMLChar.cpp index 828f101230bc..942bad730f49 100644 --- a/layout/mathml/nsMathMLChar.cpp +++ b/layout/mathml/nsMathMLChar.cpp @@ -997,10 +997,8 @@ nsMathMLChar::SetFontFamily(nsPresContext* aPresContext, // or if the same family name has been found gfxFont *firstFont = fm->GetThebesFontGroup()->GetFirstValidFont(); FontFamilyList firstFontList; - if (firstFont) { - firstFontList.Append( - FontFamilyName(firstFont->GetFontEntry()->FamilyName(), eUnquotedName)); - } + firstFontList.Append( + FontFamilyName(firstFont->GetFontEntry()->FamilyName(), eUnquotedName)); if (aGlyphTable == &gGlyphTableList->mUnicodeTable || firstFontList == familyList) { aFont.fontlist = familyList;