Fix for BeOS and other platforms that don't use the NEW_FONT_HEIGHT_APIS.

git-svn-id: svn://10.0.0.236/trunk@70296 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cls%seawood.org
2000-05-17 05:07:26 +00:00
parent 5e26030164
commit 079260ab04
2 changed files with 8 additions and 0 deletions

View File

@@ -2130,10 +2130,12 @@ ComputeLineHeight(nsIRenderingContext* aRenderingContext,
aRenderingContext->SetFont(font->mFont);
nsCOMPtr<nsIFontMetrics> fm;
aRenderingContext->GetFontMetrics(*getter_AddRefs(fm));
#ifdef NEW_FONT_HEIGHT_APIS
if (fm) {
fm->GetEmHeight(emHeight);
fm->GetNormalLineHeight(normalLineHeight);
}
#endif
float factor;
if (eStyleUnit_Factor == unit) {
factor = text->mLineHeight.GetFactorValue();
@@ -2183,9 +2185,11 @@ nsHTMLReflowState::CalcLineHeight(nsIPresContext* aPresContext,
aRenderingContext->SetFont(font->mFont);
nsCOMPtr<nsIFontMetrics> fm;
aRenderingContext->GetFontMetrics(*getter_AddRefs(fm));
#ifdef NEW_FONT_HEIGHT_APIS
if (fm) {
fm->GetNormalLineHeight(lineHeight);
}
#endif
}
}
return lineHeight;

View File

@@ -2130,10 +2130,12 @@ ComputeLineHeight(nsIRenderingContext* aRenderingContext,
aRenderingContext->SetFont(font->mFont);
nsCOMPtr<nsIFontMetrics> fm;
aRenderingContext->GetFontMetrics(*getter_AddRefs(fm));
#ifdef NEW_FONT_HEIGHT_APIS
if (fm) {
fm->GetEmHeight(emHeight);
fm->GetNormalLineHeight(normalLineHeight);
}
#endif
float factor;
if (eStyleUnit_Factor == unit) {
factor = text->mLineHeight.GetFactorValue();
@@ -2183,9 +2185,11 @@ nsHTMLReflowState::CalcLineHeight(nsIPresContext* aPresContext,
aRenderingContext->SetFont(font->mFont);
nsCOMPtr<nsIFontMetrics> fm;
aRenderingContext->GetFontMetrics(*getter_AddRefs(fm));
#ifdef NEW_FONT_HEIGHT_APIS
if (fm) {
fm->GetNormalLineHeight(lineHeight);
}
#endif
}
}
return lineHeight;