Guarantee that the pres context's device context will be non-null by returning failure from Init() if it's null. Rename inline getter GetDeviceContext() to DeviceContext(), convert all callers to use the inline getter, and remove the virtual/refcounting getter. Bug 229371, r+sr=dbaron.
git-svn-id: svn://10.0.0.236/trunk@152182 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -6957,16 +6957,6 @@ nsTypedSelection::GetPointFromOffset(nsIFrame *aFrame, PRInt32 aContentOffset, n
|
||||
if (!presContext)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsCOMPtr<nsIDeviceContext> deviceContext;
|
||||
|
||||
rv = presContext->GetDeviceContext(getter_AddRefs(deviceContext));
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
if (!deviceContext)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
//
|
||||
// Now get the closest view with a widget so we can create
|
||||
// a rendering context.
|
||||
@@ -6999,7 +6989,8 @@ nsTypedSelection::GetPointFromOffset(nsIFrame *aFrame, PRInt32 aContentOffset, n
|
||||
|
||||
nsCOMPtr<nsIRenderingContext> rendContext;
|
||||
|
||||
rv = deviceContext->CreateRenderingContext(closestView, *getter_AddRefs(rendContext));
|
||||
rv = presContext->DeviceContext()->
|
||||
CreateRenderingContext(closestView, *getter_AddRefs(rendContext));
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
Reference in New Issue
Block a user