mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1077371 - Remove unnecessary null-checks on the result of gfxFontGroup::GetFirstValidFont. r=jdaggett
This commit is contained in:
parent
04b446ed4d
commit
244c38ec06
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user