Fixed a crash on "File | Print Setup" (or any other dialog without specific menubar) #3769. Approved: chofmann.

This commit is contained in:
pierre%netscape.com 1999-03-17 07:17:19 +00:00
parent 7b558a135d
commit e23982f42f

View File

@ -308,7 +308,7 @@ PRBool nsMacEventHandler::HandleActivateEvent(EventRecord& aOSEvent)
nsWindow* focusedWidget = mTopLevelWidget;
toolkit->SetFocus(focusedWidget);
nsIMenuBar* menuBar = focusedWidget->GetMenuBar();
if(menuBar)
if (menuBar)
{
void* menuHandle = nsnull;
@ -330,10 +330,12 @@ PRBool nsMacEventHandler::HandleActivateEvent(EventRecord& aOSEvent)
//¥TODO: save the focused widget for that window
toolkit->SetFocus(nsnull);
Handle menuBar = ::GetMenuBar(); // Get a copy of the menu list
nsIMenuBar* menuBarInterface = mTopLevelWidget->GetMenuBar();
menuBarInterface->SetNativeData((void*)menuBar);
if (menuBarInterface)
{
Handle menuBar = ::GetMenuBar(); // Get a copy of the menu list
menuBarInterface->SetNativeData((void*)menuBar);
}
}
}
return PR_TRUE;