adding checks for null mContext member in a couple of places - fixes bug #2200
git-svn-id: svn://10.0.0.236/trunk@17985 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
10747a8399
commit
cb60c36d89
@ -488,8 +488,9 @@ void nsRenderingContextMac::SelectDrawingSurface(DrawingSurface* aSurface)
|
||||
|
||||
if (mGS->mFontMetrics)
|
||||
SetFont(mGS->mFontMetrics);
|
||||
|
||||
|
||||
|
||||
if (!mContext) return;
|
||||
|
||||
// GS and context initializations
|
||||
((nsDeviceContextMac *)mContext)->SetDrawingSurface(mPort);
|
||||
#if 0
|
||||
@ -521,6 +522,11 @@ NS_IMETHODIMP nsRenderingContextMac::SetPortTextState()
|
||||
if (nsnull == mGS->mFontMetrics)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
NS_PRECONDITION(mContext != nsnull, "No device context in SetPortTextState");
|
||||
|
||||
if (nsnull == mContext)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
TextStyle theStyle;
|
||||
nsFontMetricsMac::GetNativeTextStyle(*mGS->mFontMetrics, *mContext, theStyle);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user