mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
review: kmcclusk, mjudge
fix for invalid rootWidget in nsViewManager::GetWidgetBounds
This commit is contained in:
parent
f3b435d030
commit
08c948f685
@ -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");
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user