Part of fix for bug 359341 that somehow didn't make it in the first time. r+sr=roc

This commit is contained in:
bzbarsky%mit.edu 2006-11-14 22:32:40 +00:00
parent 3dff1c63ef
commit b37af4e57a
3 changed files with 7 additions and 9 deletions

View File

@ -366,9 +366,9 @@ nsImageOS2 :: Draw(nsIRenderingContext &aContext, nsIDrawingSurface* aSurface,
{ aSX + aSWidth, mInfo->cy - aSY } }; // SUR
PRBool fPrinting = PR_FALSE;
nsIDeviceContext* context;
aContext.GetDeviceContext(context);
if (((nsDeviceContextOS2 *)context)->mPrintDC) {
nsCOMPtr<nsIDeviceContext> context;
aContext.GetDeviceContext(*getter_AddRefs(context));
if (((nsDeviceContextOS2 *)context.get())->mPrintDC) {
fPrinting = PR_TRUE;
}
@ -738,9 +738,9 @@ NS_IMETHODIMP nsImageOS2::DrawTile(nsIRenderingContext &aContext,
PRBool padded = (aPadX || aPadY);
// Get the scale - if greater than 1 then do slow tile which
nsIDeviceContext *theDeviceContext;
nsCOMPtr<nsIDeviceContext> theDeviceContext;
float scale;
aContext.GetDeviceContext(theDeviceContext);
aContext.GetDeviceContext(*getter_AddRefs(theDeviceContext));
theDeviceContext->GetCanonicalPixelScale(scale);
nsRect ValidRect (0, 0, ImageWidth, ImageHeight);

View File

@ -94,11 +94,10 @@ nsFont *font;
nsPoint *pointlist;
// Get the size of a pixel.
nsIDeviceContext* deviceContext;
aSurface->GetDeviceContext(deviceContext);
nsCOMPtr<nsIDeviceContext> deviceContext;
aSurface->GetDeviceContext(*getter_AddRefs(deviceContext));
float p2t; // pixel to twips conversion
p2t = deviceContext->DevUnitsToAppUnits();
NS_RELEASE(deviceContext);
font = new nsFont("Times", NS_FONT_STYLE_NORMAL,NS_FONT_VARIANT_NORMAL,NS_FONT_WEIGHT_BOLD,0,12);
aSurface->SetFont(*font);

View File

@ -653,7 +653,6 @@ nsIToolkit* nsBaseWidget::GetToolkit()
//-------------------------------------------------------------------------
nsIDeviceContext* nsBaseWidget::GetDeviceContext()
{
NS_IF_ADDREF(mContext);
return mContext;
}