Bug 563878. Part 9. Remove nsIView::GetScreenPosition because it is unused. r=mats

This commit is contained in:
Timothy Nikkel 2010-06-25 16:51:17 -05:00
parent 14a8952bb9
commit 66ff344afd
2 changed files with 0 additions and 26 deletions

View File

@ -187,13 +187,6 @@ public:
*/
nsPoint GetOffsetTo(const nsIView* aOther) const;
/**
* Get the screen position of the view.
* @return the pixel position of the top-left of the view in screen
* coordinates.
*/
nsIntPoint GetScreenPosition() const;
/**
* Called to query the visibility state of a view.
* @result current visibility state

View File

@ -932,25 +932,6 @@ nsPoint nsIView::GetOffsetTo(const nsIView* aOther) const
return offset;
}
nsIntPoint nsIView::GetScreenPosition() const
{
nsIntPoint screenPoint(0,0);
nsPoint toWidgetOffset(0,0);
nsIWidget* widget = GetNearestWidget(&toWidgetOffset);
if (widget) {
nsCOMPtr<nsIDeviceContext> dx;
mViewManager->GetDeviceContext(*getter_AddRefs(dx));
PRInt32 p2a = dx->AppUnitsPerDevPixel();
nsIntPoint ourPoint(NSAppUnitsToIntPixels(toWidgetOffset.x, p2a),
NSAppUnitsToIntPixels(toWidgetOffset.y, p2a));
// WidgetToScreenOffset is at the origin of the client area of
// the widget.
screenPoint = ourPoint + widget->WidgetToScreenOffset();
}
return screenPoint;
}
nsIWidget* nsIView::GetNearestWidget(nsPoint* aOffset) const
{
// aOffset is based on the view's position, which ignores any chrome on