Bug 1077371 - Remove unnecessary null-checks on the result of gfxFontGroup::GetFirstValidFont. r=jdaggett

This commit is contained in:
Jonathan Kew 2014-10-06 15:14:49 +01:00
parent 04b446ed4d
commit 244c38ec06
2 changed files with 2 additions and 10 deletions

View File

@ -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();

View File

@ -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;