From 1b3c96e6a4ceccd85f128aff934c6148b208ed1c Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Thu, 26 Nov 1998 18:14:41 +0000 Subject: [PATCH] Port to revised pres-context API --- content/html/content/src/nsHTMLBodyElement.cpp | 3 ++- content/html/content/src/nsHTMLFontElement.cpp | 3 ++- content/html/style/src/nsCSSStyleRule.cpp | 3 ++- layout/forms/nsFormControlFrame.cpp | 3 ++- layout/html/content/src/nsHTMLBodyElement.cpp | 3 ++- layout/html/content/src/nsHTMLFontElement.cpp | 3 ++- layout/html/forms/src/nsFormControlFrame.cpp | 3 ++- layout/html/style/src/nsCSSStyleRule.cpp | 3 ++- layout/style/nsCSSStyleRule.cpp | 3 ++- 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/content/html/content/src/nsHTMLBodyElement.cpp b/content/html/content/src/nsHTMLBodyElement.cpp index ac2ea44ac49e..6d2f43e3a58a 100644 --- a/content/html/content/src/nsHTMLBodyElement.cpp +++ b/content/html/content/src/nsHTMLBodyElement.cpp @@ -477,7 +477,8 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes, nsStyleFont* font = (nsStyleFont*)aContext->GetMutableStyleData(eStyleStruct_Font); const nsFont& defaultFont = aPresContext->GetDefaultFont(); const nsFont& defaultFixedFont = aPresContext->GetDefaultFixedFont(); - PRInt32 scaler = aPresContext->GetFontScaler(); + PRInt32 scaler; + aPresContext->GetFontScaler(scaler); float scaleFactor = nsStyleUtil::GetScalingFactor(scaler); font->mFont.size = nsStyleUtil::CalcFontPointSize(3, (PRInt32)defaultFont.size, scaleFactor); font->mFixedFont.size = nsStyleUtil::CalcFontPointSize(3, (PRInt32)defaultFixedFont.size, scaleFactor); diff --git a/content/html/content/src/nsHTMLFontElement.cpp b/content/html/content/src/nsHTMLFontElement.cpp index fe667511cba1..f2b491ec48d3 100644 --- a/content/html/content/src/nsHTMLFontElement.cpp +++ b/content/html/content/src/nsHTMLFontElement.cpp @@ -261,7 +261,8 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes, size = 3 + size; // XXX should be BASEFONT, not three } size = ((0 < size) ? ((size < 8) ? size : 7) : 1); - PRInt32 scaler = aPresContext->GetFontScaler(); + PRInt32 scaler; + aPresContext->GetFontScaler(scaler); float scaleFactor = nsStyleUtil::GetScalingFactor(scaler); font->mFont.size = nsStyleUtil::CalcFontPointSize(size, (PRInt32)defaultFont.size, diff --git a/content/html/style/src/nsCSSStyleRule.cpp b/content/html/style/src/nsCSSStyleRule.cpp index 0638978d2efa..6cd336d1f7d6 100644 --- a/content/html/style/src/nsCSSStyleRule.cpp +++ b/content/html/style/src/nsCSSStyleRule.cpp @@ -976,7 +976,8 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration, // font-size: enum, length, percent, inherit if (eCSSUnit_Enumerated == ourFont->mSize.GetUnit()) { PRInt32 value = ourFont->mSize.GetIntValue(); - PRInt32 scaler = aPresContext->GetFontScaler(); + PRInt32 scaler; + aPresContext->GetFontScaler(scaler); float scaleFactor = nsStyleUtil::GetScalingFactor(scaler); if ((NS_STYLE_FONT_SIZE_XXSMALL <= value) && diff --git a/layout/forms/nsFormControlFrame.cpp b/layout/forms/nsFormControlFrame.cpp index 75cdb58d20cd..0343fc0587f4 100644 --- a/layout/forms/nsFormControlFrame.cpp +++ b/layout/forms/nsFormControlFrame.cpp @@ -926,7 +926,8 @@ nsFormControlFrame::GetFont(nsIPresContext* aPresContext, nsFont& aFont) aFont.name = "Arial"; // XXX windows specific font aFont.weight = NS_FONT_WEIGHT_NORMAL; const nsFont& normal = aPresContext->GetDefaultFont(); - PRInt32 scaler = aPresContext->GetFontScaler(); + PRInt32 scaler; + aPresContext->GetFontScaler(scaler); float scaleFactor = nsStyleUtil::GetScalingFactor(scaler); PRInt32 fontIndex = nsStyleUtil::FindNextSmallerFontSize(aFont.size, (PRInt32)normal.size, scaleFactor); aFont.size = nsStyleUtil::CalcFontPointSize(fontIndex, (PRInt32)normal.size, scaleFactor); diff --git a/layout/html/content/src/nsHTMLBodyElement.cpp b/layout/html/content/src/nsHTMLBodyElement.cpp index ac2ea44ac49e..6d2f43e3a58a 100644 --- a/layout/html/content/src/nsHTMLBodyElement.cpp +++ b/layout/html/content/src/nsHTMLBodyElement.cpp @@ -477,7 +477,8 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes, nsStyleFont* font = (nsStyleFont*)aContext->GetMutableStyleData(eStyleStruct_Font); const nsFont& defaultFont = aPresContext->GetDefaultFont(); const nsFont& defaultFixedFont = aPresContext->GetDefaultFixedFont(); - PRInt32 scaler = aPresContext->GetFontScaler(); + PRInt32 scaler; + aPresContext->GetFontScaler(scaler); float scaleFactor = nsStyleUtil::GetScalingFactor(scaler); font->mFont.size = nsStyleUtil::CalcFontPointSize(3, (PRInt32)defaultFont.size, scaleFactor); font->mFixedFont.size = nsStyleUtil::CalcFontPointSize(3, (PRInt32)defaultFixedFont.size, scaleFactor); diff --git a/layout/html/content/src/nsHTMLFontElement.cpp b/layout/html/content/src/nsHTMLFontElement.cpp index fe667511cba1..f2b491ec48d3 100644 --- a/layout/html/content/src/nsHTMLFontElement.cpp +++ b/layout/html/content/src/nsHTMLFontElement.cpp @@ -261,7 +261,8 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes, size = 3 + size; // XXX should be BASEFONT, not three } size = ((0 < size) ? ((size < 8) ? size : 7) : 1); - PRInt32 scaler = aPresContext->GetFontScaler(); + PRInt32 scaler; + aPresContext->GetFontScaler(scaler); float scaleFactor = nsStyleUtil::GetScalingFactor(scaler); font->mFont.size = nsStyleUtil::CalcFontPointSize(size, (PRInt32)defaultFont.size, diff --git a/layout/html/forms/src/nsFormControlFrame.cpp b/layout/html/forms/src/nsFormControlFrame.cpp index 75cdb58d20cd..0343fc0587f4 100644 --- a/layout/html/forms/src/nsFormControlFrame.cpp +++ b/layout/html/forms/src/nsFormControlFrame.cpp @@ -926,7 +926,8 @@ nsFormControlFrame::GetFont(nsIPresContext* aPresContext, nsFont& aFont) aFont.name = "Arial"; // XXX windows specific font aFont.weight = NS_FONT_WEIGHT_NORMAL; const nsFont& normal = aPresContext->GetDefaultFont(); - PRInt32 scaler = aPresContext->GetFontScaler(); + PRInt32 scaler; + aPresContext->GetFontScaler(scaler); float scaleFactor = nsStyleUtil::GetScalingFactor(scaler); PRInt32 fontIndex = nsStyleUtil::FindNextSmallerFontSize(aFont.size, (PRInt32)normal.size, scaleFactor); aFont.size = nsStyleUtil::CalcFontPointSize(fontIndex, (PRInt32)normal.size, scaleFactor); diff --git a/layout/html/style/src/nsCSSStyleRule.cpp b/layout/html/style/src/nsCSSStyleRule.cpp index 0638978d2efa..6cd336d1f7d6 100644 --- a/layout/html/style/src/nsCSSStyleRule.cpp +++ b/layout/html/style/src/nsCSSStyleRule.cpp @@ -976,7 +976,8 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration, // font-size: enum, length, percent, inherit if (eCSSUnit_Enumerated == ourFont->mSize.GetUnit()) { PRInt32 value = ourFont->mSize.GetIntValue(); - PRInt32 scaler = aPresContext->GetFontScaler(); + PRInt32 scaler; + aPresContext->GetFontScaler(scaler); float scaleFactor = nsStyleUtil::GetScalingFactor(scaler); if ((NS_STYLE_FONT_SIZE_XXSMALL <= value) && diff --git a/layout/style/nsCSSStyleRule.cpp b/layout/style/nsCSSStyleRule.cpp index 0638978d2efa..6cd336d1f7d6 100644 --- a/layout/style/nsCSSStyleRule.cpp +++ b/layout/style/nsCSSStyleRule.cpp @@ -976,7 +976,8 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration, // font-size: enum, length, percent, inherit if (eCSSUnit_Enumerated == ourFont->mSize.GetUnit()) { PRInt32 value = ourFont->mSize.GetIntValue(); - PRInt32 scaler = aPresContext->GetFontScaler(); + PRInt32 scaler; + aPresContext->GetFontScaler(scaler); float scaleFactor = nsStyleUtil::GetScalingFactor(scaler); if ((NS_STYLE_FONT_SIZE_XXSMALL <= value) &&