nsCOMPtr<nsIView> parentView; nsresult rv = frame->GetOffsetFromView(context, origin, getter_AddRefs(parentView));
nsIView* parentView; nsresult rv = frame->GetOffsetFromView(context, origin, &parentView);
nsHTMLImageElement::GetXY(PRInt32* aX, PRInt32* aY){  if (aX) {    *aX = 0;  }  if (aY) {    *aY = 0;  }  if (!mDocument) {    return NS_OK;  }  // Get Presentation shell 0  nsCOMPtr<nsIPresShell> presShell;  mDocument->GetShellAt(0, getter_AddRefs(presShell));  if (!presShell) {    return NS_OK;  }  // Get the Presentation Context from the Shell  nsCOMPtr<nsIPresContext> context;  presShell->GetPresContext(getter_AddRefs(context));  if (!context) {    return NS_OK;  }  // Flush all pending notifications so that our frames are uptodate  mDocument->FlushPendingNotifications();  // Get the Frame for this image  nsIFrame* frame = nsnull;  presShell->GetPrimaryFrameFor(this, &frame);  if (!frame) {    return NS_OK;  }  nsPoint origin(0, 0);  nsCOMPtr<nsIView> parentView;  nsresult rv = frame->GetOffsetFromView(context, origin, getter_AddRefs(parentView));  NS_ENSURE_SUCCESS(rv, rv);  // Get the scale from that Presentation Context  float scale;  context->GetTwipsToPixels(&scale);  // Convert to pixels using that scale  if (aX) {    *aX = NSTwipsToIntPixels(origin.x, scale);  }  if (aY) {    *aY = NSTwipsToIntPixels(origin.y, scale);  }  return NS_OK;}