Bug 447838 - Fix build warnings in nsTextFrameThebes.cpp; r=roc

This commit is contained in:
Ed Morley 2011-07-12 12:06:34 -04:00
parent 69399cfaba
commit 78387ed743

View File

@ -132,7 +132,7 @@ using namespace mozilla::dom;
struct TabWidth {
TabWidth(PRUint32 aOffset, PRUint32 aWidth)
: mOffset(aOffset), mWidth(aWidth)
: mOffset(aOffset), mWidth(float(aWidth))
{ }
PRUint32 mOffset; // character offset within the text covered by the
@ -2750,7 +2750,7 @@ ComputeTabWidthAppUnits(nsIFrame* aFrame, gfxTextRun* aTextRun)
// Round the space width when converting to appunits the same way
// textruns do
gfxFloat spaceWidthAppUnits =
NS_roundf(GetFirstFontMetrics(
NS_round(GetFirstFontMetrics(
GetFontGroupForFrame(aFrame)).spaceWidth *
aTextRun->GetAppUnitsPerDevUnit());
return textStyle->mTabSize * spaceWidthAppUnits;
@ -2830,8 +2830,8 @@ PropertyProvider::CalcTabWidths(PRUint32 aStart, PRUint32 aLength)
}
double nextTab = AdvanceToNextTab(mOffsetFromBlockOriginForTabs,
mFrame, mTextRun, &tabWidth);
mTabWidths->mWidths.AppendElement(
TabWidth(i - startOffset, nextTab - mOffsetFromBlockOriginForTabs));
mTabWidths->mWidths.AppendElement(TabWidth(i - startOffset,
NSToIntRound(nextTab - mOffsetFromBlockOriginForTabs)));
mOffsetFromBlockOriginForTabs = nextTab;
}
@ -4418,7 +4418,7 @@ nsTextFrame::PaintTextDecorations(
gfxFloat app = aTextPaintStyle.PresContext()->AppUnitsPerDevPixel();
// XXX aFramePt is in AppUnits, shouldn't it be nsFloatPoint?
nscoord x = aFramePt.x;
nscoord x = NSToCoordRound(aFramePt.x);
nscoord width = GetRect().width;
aClipEdges.Intersect(&x, &width);
gfxPoint pt(x / app, (aTextBaselinePt.y - mAscent) / app);
@ -4798,8 +4798,10 @@ nsTextFrame::PaintOneShadow(PRUint32 aOffset, PRUint32 aLength,
// that much in order to make the origin the top-left corner of the text bounding box.
gfxRect shadowGfxRect = shadowMetrics.mBoundingBox +
gfxPoint(aFramePt.x + aLeftSideOffset, aTextBaselinePt.y) + shadowOffset;
nsRect shadowRect(shadowGfxRect.X(), shadowGfxRect.Y(),
shadowGfxRect.Width(), shadowGfxRect.Height());
nsRect shadowRect(NSToCoordRound(shadowGfxRect.X()),
NSToCoordRound(shadowGfxRect.Y()),
NSToCoordRound(shadowGfxRect.Width()),
NSToCoordRound(shadowGfxRect.Height()));
nsContextBoxBlur contextBoxBlur;
gfxContext* shadowContext = contextBoxBlur.Init(shadowRect, 0, blurRadius,
@ -6307,7 +6309,8 @@ nsTextFrame::AddInlineMinWidthForFlow(nsRenderingContext *aRenderingContext,
} else if (i < flowEndInTextRun && hyphBreakBefore &&
hyphBreakBefore[i - start])
{
aData->OptionallyBreak(aRenderingContext, provider.GetHyphenWidth());
aData->OptionallyBreak(aRenderingContext,
NSToCoordRound(provider.GetHyphenWidth()));
} {
aData->OptionallyBreak(aRenderingContext);
}