Replaced reference with pointer for accessing plainFont in nsTextFrame::Reflow.
git-svn-id: svn://10.0.0.236/trunk@34211 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
bfd3a64713
commit
1395c98675
@ -304,29 +304,29 @@ public:
|
||||
|
||||
// Cache the original decorations and reuse the current font
|
||||
// to query metrics, rather than creating a new font which is expensive.
|
||||
nsFont& plainFont = (nsFont)mFont->mFont; //XXX: Change to use a CONST_CAST macro.
|
||||
PRUint8 originalDecorations = plainFont.decorations;
|
||||
plainFont.decorations = NS_FONT_DECORATION_NONE;
|
||||
aPresContext->GetMetricsFor(plainFont, &mNormalFont);
|
||||
nsFont* plainFont = (nsFont *)&mFont->mFont; //XXX: Change to use a CONST_CAST macro.
|
||||
PRUint8 originalDecorations = plainFont->decorations;
|
||||
plainFont->decorations = NS_FONT_DECORATION_NONE;
|
||||
aPresContext->GetMetricsFor(*plainFont, &mNormalFont);
|
||||
aRenderingContext.SetFont(mNormalFont);
|
||||
aRenderingContext.GetWidth(' ', mSpaceWidth);
|
||||
mLastFont = mNormalFont;
|
||||
|
||||
// Get the small-caps font if needed
|
||||
mSmallCaps = NS_STYLE_FONT_VARIANT_SMALL_CAPS == plainFont.variant;
|
||||
mSmallCaps = NS_STYLE_FONT_VARIANT_SMALL_CAPS == plainFont->variant;
|
||||
if (mSmallCaps) {
|
||||
nscoord originalSize = plainFont.size;
|
||||
plainFont.size = nscoord(0.7 * plainFont.size);
|
||||
aPresContext->GetMetricsFor(plainFont, &mSmallFont);
|
||||
nscoord originalSize = plainFont->size;
|
||||
plainFont->size = nscoord(0.7 * plainFont->size);
|
||||
aPresContext->GetMetricsFor(*plainFont, &mSmallFont);
|
||||
// Reset to the size value saved earlier.
|
||||
plainFont.size = originalSize;
|
||||
plainFont->size = originalSize;
|
||||
}
|
||||
else {
|
||||
mSmallFont = nsnull;
|
||||
}
|
||||
|
||||
// Reset to the decoration saved earlier
|
||||
plainFont.decorations = originalDecorations;
|
||||
plainFont->decorations = originalDecorations;
|
||||
|
||||
// XXX Get these from style
|
||||
mSelectionBGColor = NS_RGB(0, 0, 0);
|
||||
|
||||
@ -304,29 +304,29 @@ public:
|
||||
|
||||
// Cache the original decorations and reuse the current font
|
||||
// to query metrics, rather than creating a new font which is expensive.
|
||||
nsFont& plainFont = (nsFont)mFont->mFont; //XXX: Change to use a CONST_CAST macro.
|
||||
PRUint8 originalDecorations = plainFont.decorations;
|
||||
plainFont.decorations = NS_FONT_DECORATION_NONE;
|
||||
aPresContext->GetMetricsFor(plainFont, &mNormalFont);
|
||||
nsFont* plainFont = (nsFont *)&mFont->mFont; //XXX: Change to use a CONST_CAST macro.
|
||||
PRUint8 originalDecorations = plainFont->decorations;
|
||||
plainFont->decorations = NS_FONT_DECORATION_NONE;
|
||||
aPresContext->GetMetricsFor(*plainFont, &mNormalFont);
|
||||
aRenderingContext.SetFont(mNormalFont);
|
||||
aRenderingContext.GetWidth(' ', mSpaceWidth);
|
||||
mLastFont = mNormalFont;
|
||||
|
||||
// Get the small-caps font if needed
|
||||
mSmallCaps = NS_STYLE_FONT_VARIANT_SMALL_CAPS == plainFont.variant;
|
||||
mSmallCaps = NS_STYLE_FONT_VARIANT_SMALL_CAPS == plainFont->variant;
|
||||
if (mSmallCaps) {
|
||||
nscoord originalSize = plainFont.size;
|
||||
plainFont.size = nscoord(0.7 * plainFont.size);
|
||||
aPresContext->GetMetricsFor(plainFont, &mSmallFont);
|
||||
nscoord originalSize = plainFont->size;
|
||||
plainFont->size = nscoord(0.7 * plainFont->size);
|
||||
aPresContext->GetMetricsFor(*plainFont, &mSmallFont);
|
||||
// Reset to the size value saved earlier.
|
||||
plainFont.size = originalSize;
|
||||
plainFont->size = originalSize;
|
||||
}
|
||||
else {
|
||||
mSmallFont = nsnull;
|
||||
}
|
||||
|
||||
// Reset to the decoration saved earlier
|
||||
plainFont.decorations = originalDecorations;
|
||||
plainFont->decorations = originalDecorations;
|
||||
|
||||
// XXX Get these from style
|
||||
mSelectionBGColor = NS_RGB(0, 0, 0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user