Fix for null pointer in full page plugins on Mac. bug 74789 a=av sr=shaver

This commit is contained in:
peterlubczynski%netscape.com 2001-04-04 23:46:27 +00:00
Родитель 85fb69863e
Коммит d2614be8ea
2 изменённых файлов: 20 добавлений и 12 удалений

Просмотреть файл

@ -448,13 +448,17 @@ PluginViewerImpl::SetDOMDocument(nsIDOMDocument *aDocument)
nsEventStatus PR_CALLBACK
HandlePluginEvent(nsGUIEvent *aEvent)
{
if( (*aEvent).message == NS_PLUGIN_ACTIVATE) {
(nsIWidget*)((*aEvent).widget)->SetFocus();
}
#ifdef XP_MAC
if (aEvent == nsnull || aEvent->widget == nsnull) //null pointer check
return nsEventStatus_eIgnore;
if( aEvent->message == NS_PLUGIN_ACTIVATE)
(nsIWidget*)(aEvent->widget)->SetFocus(); // send focus to child window
#ifdef XP_MAC // on Mac, we store a pointer to this class as native data in the widget
PluginViewerImpl * pluginViewer;
(nsIWidget*)((*aEvent).widget)->GetClientData((PluginViewerImpl *)pluginViewer);
return pluginViewer->mOwner->ProcessEvent(*aEvent);
(nsIWidget*)(aEvent->widget)->GetClientData((PluginViewerImpl *)pluginViewer);
if (pluginViewer != nsnull && pluginViewer->mOwner != nsnull)
return pluginViewer->mOwner->ProcessEvent(*aEvent);
#endif
return nsEventStatus_eIgnore;
}

Просмотреть файл

@ -448,13 +448,17 @@ PluginViewerImpl::SetDOMDocument(nsIDOMDocument *aDocument)
nsEventStatus PR_CALLBACK
HandlePluginEvent(nsGUIEvent *aEvent)
{
if( (*aEvent).message == NS_PLUGIN_ACTIVATE) {
(nsIWidget*)((*aEvent).widget)->SetFocus();
}
#ifdef XP_MAC
if (aEvent == nsnull || aEvent->widget == nsnull) //null pointer check
return nsEventStatus_eIgnore;
if( aEvent->message == NS_PLUGIN_ACTIVATE)
(nsIWidget*)(aEvent->widget)->SetFocus(); // send focus to child window
#ifdef XP_MAC // on Mac, we store a pointer to this class as native data in the widget
PluginViewerImpl * pluginViewer;
(nsIWidget*)((*aEvent).widget)->GetClientData((PluginViewerImpl *)pluginViewer);
return pluginViewer->mOwner->ProcessEvent(*aEvent);
(nsIWidget*)(aEvent->widget)->GetClientData((PluginViewerImpl *)pluginViewer);
if (pluginViewer != nsnull && pluginViewer->mOwner != nsnull)
return pluginViewer->mOwner->ProcessEvent(*aEvent);
#endif
return nsEventStatus_eIgnore;
}