Port to revised pres-context API

This commit is contained in:
kipp%netscape.com 1998-11-26 18:14:41 +00:00
parent 1ed8e1edae
commit 1b3c96e6a4
9 changed files with 18 additions and 9 deletions

View File

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

View File

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

View File

@ -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) &&

View File

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

View File

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

View File

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

View File

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

View File

@ -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) &&

View File

@ -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) &&