From d1c44bd4ed01bf951e73b3c365bbe511a55f7fa8 Mon Sep 17 00:00:00 2001 From: "locka%iol.ie" Date: Sun, 13 Dec 1998 21:41:46 +0000 Subject: [PATCH] Tweaked QueryInterface implementation --- webshell/embed/ActiveX/WebShellContainer.cpp | 63 ++++++++++---------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/webshell/embed/ActiveX/WebShellContainer.cpp b/webshell/embed/ActiveX/WebShellContainer.cpp index 3ebd1f2f1aec..5219e08e4024 100644 --- a/webshell/embed/ActiveX/WebShellContainer.cpp +++ b/webshell/embed/ActiveX/WebShellContainer.cpp @@ -23,6 +23,7 @@ static NS_DEFINE_IID(kIWebShellContainerIID, NS_IWEB_SHELL_CONTAINER_IID); static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID); +static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); /* static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID); */ @@ -50,41 +51,36 @@ NS_IMPL_RELEASE(CWebShellContainer) nsresult CWebShellContainer::QueryInterface(const nsIID& aIID, void** aInstancePtrResult) { - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } + NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); + if (nsnull == aInstancePtrResult) + { + return NS_ERROR_NULL_POINTER; + } - *aInstancePtrResult = NULL; -/* - if (aIID.Equals(kIBrowserWindowIID)) { - *aInstancePtrResult = (void*) ((nsIBrowserWindow*)this); - AddRef(); - return NS_OK; - } */ - if (aIID.Equals(kIStreamObserverIID)) { - *aInstancePtrResult = (void*) ((nsIStreamObserver*)this); - AddRef(); - return NS_OK; - } + *aInstancePtrResult = NULL; - if (aIID.Equals(kIWebShellContainerIID)) { - *aInstancePtrResult = (void*) ((nsIWebShellContainer*)this); - AddRef(); - return NS_OK; - } -/* if (aIID.Equals(kINetSupportIID)) { - *aInstancePtrResult = (void*) ((nsINetSupport*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtrResult = (void*) ((nsISupports*)((nsIBrowserWindow*)this)); - AddRef(); - return NS_OK; - } - */ - return NS_NOINTERFACE; + if (aIID.Equals(kIStreamObserverIID)) + { + *aInstancePtrResult = (void*) ((nsIStreamObserver*)this); + AddRef(); + return NS_OK; + } + + if (aIID.Equals(kIWebShellContainerIID)) + { + *aInstancePtrResult = (void*) ((nsIWebShellContainer*)this); + AddRef(); + return NS_OK; + } + + if (aIID.Equals(kISupportsIID)) + { + *aInstancePtrResult = (void*) ((nsIStreamObserver*)this); + AddRef(); + return NS_OK; + } + + return NS_NOINTERFACE; } @@ -148,6 +144,7 @@ NS_IMETHODIMP CWebShellContainer::ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aProgress, PRInt32 aProgressMax) { ATLTRACE(_T("CWebShellContainer::ProgressLoadURL()\n")); + m_pEvents1->Fire_ProgressChange(aProgress, aProgressMax); m_pEvents2->Fire_ProgressChange(aProgress, aProgressMax); return NS_OK;