From a4a35386a0567c22b397a4d283f00ba7d1e51f27 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Sun, 29 Nov 2015 23:15:01 -0800 Subject: [PATCH] Bug 1228501 patch 1 - Remove decorations parameter to nsFont constructors. r=jdaggett The removed parameter is always 0. --- gfx/src/nsFont.cpp | 9 +++------ gfx/src/nsFont.h | 6 ++---- layout/base/nsPresContext.h | 14 +++++++------- layout/base/nsPresShell.cpp | 2 +- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/gfx/src/nsFont.cpp b/gfx/src/nsFont.cpp index a91eae59254..bd3c905fa90 100644 --- a/gfx/src/nsFont.cpp +++ b/gfx/src/nsFont.cpp @@ -19,28 +19,24 @@ using namespace mozilla; nsFont::nsFont(const FontFamilyList& aFontlist, uint8_t aStyle, - uint16_t aWeight, int16_t aStretch, - uint8_t aDecoration, nscoord aSize) + uint16_t aWeight, int16_t aStretch, nscoord aSize) : fontlist(aFontlist) { Init(); style = aStyle; weight = aWeight; stretch = aStretch; - decorations = aDecoration; size = aSize; } nsFont::nsFont(FontFamilyType aGenericType, uint8_t aStyle, - uint16_t aWeight, int16_t aStretch, uint8_t aDecoration, - nscoord aSize) + uint16_t aWeight, int16_t aStretch, nscoord aSize) : fontlist(aGenericType) { Init(); style = aStyle; weight = aWeight; stretch = aStretch; - decorations = aDecoration; size = aSize; } @@ -52,6 +48,7 @@ nsFont::Init() sizeAdjust = -1.0f; kerning = NS_FONT_KERNING_AUTO; synthesis = NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE; + decorations = 0; variantAlternates = 0; variantCaps = NS_FONT_VARIANT_CAPS_NORMAL; diff --git a/gfx/src/nsFont.h b/gfx/src/nsFont.h index dce9b124014..7b413754398 100644 --- a/gfx/src/nsFont.h +++ b/gfx/src/nsFont.h @@ -111,13 +111,11 @@ struct nsFont { // initialize the font with a fontlist nsFont(const mozilla::FontFamilyList& aFontlist, uint8_t aStyle, - uint16_t aWeight, int16_t aStretch, - uint8_t aDecoration, nscoord aSize); + uint16_t aWeight, int16_t aStretch, nscoord aSize); // initialize the font with a single generic nsFont(mozilla::FontFamilyType aGenericType, uint8_t aStyle, - uint16_t aWeight, int16_t aStretch, uint8_t aDecoration, - nscoord aSize); + uint16_t aWeight, int16_t aStretch, nscoord aSize); // Make a copy of the given font nsFont(const nsFont& aFont); diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index 9be8f6ee396..4e8f1cc3e79 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -1106,26 +1106,26 @@ protected: , mMinimumFontSize(0) , mDefaultVariableFont(mozilla::eFamily_serif, NS_FONT_STYLE_NORMAL, NS_FONT_WEIGHT_NORMAL, - NS_FONT_STRETCH_NORMAL, 0, 0) + NS_FONT_STRETCH_NORMAL, 0) , mDefaultFixedFont(mozilla::eFamily_monospace, NS_FONT_STYLE_NORMAL, NS_FONT_WEIGHT_NORMAL, - NS_FONT_STRETCH_NORMAL, 0, 0) + NS_FONT_STRETCH_NORMAL, 0) , mDefaultSerifFont(mozilla::eFamily_serif, NS_FONT_STYLE_NORMAL, NS_FONT_WEIGHT_NORMAL, - NS_FONT_STRETCH_NORMAL, 0, 0) + NS_FONT_STRETCH_NORMAL, 0) , mDefaultSansSerifFont(mozilla::eFamily_sans_serif, NS_FONT_STYLE_NORMAL, NS_FONT_WEIGHT_NORMAL, - NS_FONT_STRETCH_NORMAL, 0, 0) + NS_FONT_STRETCH_NORMAL, 0) , mDefaultMonospaceFont(mozilla::eFamily_monospace, NS_FONT_STYLE_NORMAL, NS_FONT_WEIGHT_NORMAL, - NS_FONT_STRETCH_NORMAL, 0, 0) + NS_FONT_STRETCH_NORMAL, 0) , mDefaultCursiveFont(mozilla::eFamily_cursive, NS_FONT_STYLE_NORMAL, NS_FONT_WEIGHT_NORMAL, - NS_FONT_STRETCH_NORMAL, 0, 0) + NS_FONT_STRETCH_NORMAL, 0) , mDefaultFantasyFont(mozilla::eFamily_fantasy, NS_FONT_STYLE_NORMAL, NS_FONT_WEIGHT_NORMAL, - NS_FONT_STRETCH_NORMAL, 0, 0) + NS_FONT_STRETCH_NORMAL, 0) {} size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 8aa73e87b5f..3b2bd336a0d 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -10191,7 +10191,7 @@ void ReflowCountMgr::PaintCount(const char* aName, // We don't care about the document language or user fonts here; // just get a default Latin font. nsFont font(eFamily_serif, NS_FONT_STYLE_NORMAL, - NS_FONT_WEIGHT_NORMAL, NS_FONT_STRETCH_NORMAL, 0, + NS_FONT_WEIGHT_NORMAL, NS_FONT_STRETCH_NORMAL, nsPresContext::CSSPixelsToAppUnits(11)); RefPtr fm; aPresContext->DeviceContext()->GetMetricsFor(font,