review: kmcclusk, mjudge

fix for invalid rootWidget in nsViewManager::GetWidgetBounds
This commit is contained in:
anthonyd%netscape.com 2000-04-26 00:53:31 +00:00
parent f3b435d030
commit 08c948f685

View File

@ -1841,12 +1841,15 @@ void nsViewManager2::GetMaxWidgetBounds(nsRect& aMaxWidgetBounds) const
nsIViewManager* vm = (nsIViewManager*)gViewManagers->ElementAt(index);
nsCOMPtr<nsIWidget> rootWidget;
vm->GetWidget(getter_AddRefs(rootWidget));
nsRect widgetBounds;
rootWidget->GetBounds(widgetBounds);
aMaxWidgetBounds.width = max(aMaxWidgetBounds.width, widgetBounds.width);
aMaxWidgetBounds.height = max(aMaxWidgetBounds.height, widgetBounds.height);
if(NS_SUCCEEDED(vm->GetWidget(getter_AddRefs(rootWidget))) && rootWidget)
{
nsRect widgetBounds;
rootWidget->GetBounds(widgetBounds);
aMaxWidgetBounds.width = max(aMaxWidgetBounds.width, widgetBounds.width);
aMaxWidgetBounds.height = max(aMaxWidgetBounds.height, widgetBounds.height);
}
else
NS_ASSERTION(0, "failure to get rootWidget");
}