Bug 750575; use nsCOMPtr around nsIPresShell in canvas code. r=roc

This commit is contained in:
Nicholas Cameron 2012-06-12 10:48:42 -07:00
parent 12f6753057
commit 1cbb2d0f07
2 changed files with 12 additions and 12 deletions

View File

@ -2840,7 +2840,7 @@ nsCanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText,
return NS_ERROR_FAILURE;
}
nsIPresShell* presShell = GetPresShell();
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
if (!presShell)
return NS_ERROR_FAILURE;

View File

@ -3155,9 +3155,9 @@ nsCanvasRenderingContext2DAzure::DrawOrMeasureText(const nsAString& aRawText,
return NS_ERROR_FAILURE;
}
nsIPresShell* presShell = GetPresShell();
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
if (!presShell)
return NS_ERROR_FAILURE;
return NS_ERROR_FAILURE;
nsIDocument* document = presShell->GetDocument();
@ -3213,15 +3213,15 @@ nsCanvasRenderingContext2DAzure::DrawOrMeasureText(const nsAString& aRawText,
// bounding boxes before rendering anything
nsBidi bidiEngine;
rv = nsBidiPresUtils::ProcessText(textToDraw.get(),
textToDraw.Length(),
isRTL ? NSBIDI_RTL : NSBIDI_LTR,
presShell->GetPresContext(),
processor,
nsBidiPresUtils::MODE_MEASURE,
nsnull,
0,
&totalWidthCoord,
&bidiEngine);
textToDraw.Length(),
isRTL ? NSBIDI_RTL : NSBIDI_LTR,
presShell->GetPresContext(),
processor,
nsBidiPresUtils::MODE_MEASURE,
nsnull,
0,
&totalWidthCoord,
&bidiEngine);
if (NS_FAILED(rv)) {
return rv;
}