Bug 172846 QueryInterface should not throw Components.results.NS_NOINTERFACE for Components.interfaces.nsISupports

r=caillon sr=bz
This commit is contained in:
timeless%mac.com 2002-10-06 23:14:25 +00:00
Родитель b869372029
Коммит f1ea69808e
13 изменённых файлов: 79 добавлений и 62 удалений

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

@ -326,7 +326,9 @@ var progressListener = {
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsIWebProgressListener) || iid.equals(Components.interfaces.nsISupportsWeakReference))
if (iid.equals(Components.interfaces.nsIWebProgressListener) ||
iid.equals(Components.interfaces.nsISupportsWeakReference) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;

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

@ -326,7 +326,9 @@ var progressListener = {
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsIWebProgressListener) || iid.equals(Components.interfaces.nsISupportsWeakReference))
if (iid.equals(Components.interfaces.nsIWebProgressListener) ||
iid.equals(Components.interfaces.nsISupportsWeakReference) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;

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

@ -48,21 +48,22 @@ function nsCommandHandler()
nsCommandHandler.prototype =
{
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsICommandHandler) ||
iid.equals(Components.interfaces.nsISupports))
{
if (iid.equals(Components.interfaces.nsICommandHandler))
{
return this;
}
throw Components.results.NS_NOINTERFACE;
},
return this;
}
throw Components.results.NS_NOINTERFACE;
},
exec : function(command, params)
{
},
query : function(command, params, result)
{
result = "";
}
exec : function(command, params)
{
},
query : function(command, params, result)
{
result = "";
}
}
//
@ -77,8 +78,11 @@ nsBrowserStatusHandler.prototype =
QueryInterface : function(aIID)
{
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
aIID.equals(Components.interfaces.nsISupportsWeakReference))
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
aIID.equals(Components.interfaces.nsISupports))
{
return this;
}
throw Components.results.NS_NOINTERFACE;
},

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

@ -224,7 +224,9 @@ var progressListener = {
},
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsIWebProgressListener) || iid.equals(Components.interfaces.nsISupportsWeakReference))
if (iid.equals(Components.interfaces.nsIWebProgressListener) ||
iid.equals(Components.interfaces.nsISupportsWeakReference) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;

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

@ -8,7 +8,8 @@ var observer1 = {
print("observer1 notified for: "+aTopic+" with: "+someData);
},
QueryInterface: function (iid) {
if (iid.equals(Components.interfaces.nsISupportsWeakReference)) {
if (iid.equals(Components.interfaces.nsISupportsWeakReference) ||
iid.equals(Components.interfaces.nsISupports)) {
return this;
}
throw Components.results.NS_ERROR_NO_INTERFACE;

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

@ -84,18 +84,16 @@ var progressListener = {
gProgressMeter.setAttribute("mode","normal");
gProgressMeter.setAttribute("value", "100");
if (aStatus) {
if (aStatus)
SetProgressText(gReplicationBundle.getString("replicationSucceeded"));
}
else {
else
SetProgressText(gReplicationBundle.getString("replicationFailed"));
}
window.close();
}
},
onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
{
SetProgressText(gReplicationBundle.getFormattedString("currentCount", [aCurSelfProgress]));
SetProgressText(gReplicationBundle.getFormattedString("currentCount", [aCurSelfProgress]));
},
onLocationChange: function(aWebProgress, aRequest, aLocation)
{
@ -109,7 +107,8 @@ var progressListener = {
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsIWebProgressListener) ||
iid.equals(Components.interfaces.nsISupportsWeakReference))
iid.equals(Components.interfaces.nsISupportsWeakReference) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
}

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

@ -283,7 +283,8 @@ nsMsgStatusFeedback.prototype =
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsIMsgStatusFeedback) ||
iid.equals(Components.interfaces.nsIXULBrowserWindow))
iid.equals(Components.interfaces.nsIXULBrowserWindow) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
},
@ -395,10 +396,10 @@ nsMsgWindowCommands.prototype =
{
QueryInterface : function(iid)
{
if(iid.equals(Components.interfaces.nsIMsgWindowCommands))
if (iid.equals(Components.interfaces.nsIMsgWindowCommands) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
return null;
},
SelectFolder: function(folderUri)
{
@ -419,10 +420,10 @@ nsMessagePaneController.prototype =
{
QueryInterface : function(iid)
{
if(iid.equals(Components.interfaces.nsIMsgMessagePaneController))
if (iid.equals(Components.interfaces.nsIMsgMessagePaneController) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
return null;
},
clearMsgPane: function()
{

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

@ -154,11 +154,11 @@ nsMsgDBViewCommandUpdater.prototype =
QueryInterface : function(iid)
{
if(iid.equals(Components.interfaces.nsIMsgDBViewCommandUpdater))
return this;
if (iid.equals(Components.interfaces.nsIMsgDBViewCommandUpdater) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
return null;
}
}

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

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
@ -78,18 +78,20 @@ function BrowserExitPrintPreview()
// This observer is called once the progress dialog has been "opened"
var gPrintPreviewObs = {
observe: function(aSubject, aTopic, aData)
{
setTimeout(FinishPrintPreview, 0);
},
observe: function(aSubject, aTopic, aData)
{
setTimeout(FinishPrintPreview, 0);
},
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsIObserver) || iid.equals(Components.interfaces.nsISupportsWeakReference))
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsIObserver) ||
iid.equals(Components.interfaces.nsISupportsWeakReference) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
}
throw Components.results.NS_NOINTERFACE;
}
};
function getBundle(aURI)

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

@ -86,11 +86,11 @@ nsMsgDBViewCommandUpdater.prototype =
QueryInterface : function(iid)
{
if(iid.equals(Components.interfaces.nsIMsgDBViewCommandUpdater))
return this;
if (iid.equals(Components.interfaces.nsIMsgDBViewCommandUpdater) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
return null;
}
}

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

@ -440,23 +440,23 @@ function nsMsgSearchCommandUpdater()
nsMsgSearchCommandUpdater.prototype =
{
updateCommandStatus : function()
{
// the back end is smart and is only telling us to update command status
// when the # of items in the selection has actually changed.
document.commandDispatcher.updateCommands('mail-search');
},
{
// the back end is smart and is only telling us to update command status
// when the # of items in the selection has actually changed.
document.commandDispatcher.updateCommands('mail-search');
},
displayMessageChanged : function(aFolder, aSubject, aKeywords)
{
},
QueryInterface : function(iid)
{
if(iid.equals(Components.interfaces.nsIMsgDBViewCommandUpdater))
{
if (iid.equals(Components.interfaces.nsIMsgDBViewCommandUpdater) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
return null;
}
throw Components.results.NS_NOINTERFACE;
}
}
function setupDatasource() {

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

@ -343,10 +343,12 @@ var progressListener = {
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsIWebProgressListener) || iid.equals(Components.interfaces.nsISupportsWeakReference))
return this;
if (iid.equals(Components.interfaces.nsIWebProgressListener) ||
iid.equals(Components.interfaces.nsISupportsWeakReference) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
throw Components.results.NS_NOINTERFACE;
}
};

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

@ -116,10 +116,12 @@ var progressListener = {
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsIWebProgressListener) || iid.equals(Components.interfaces.nsISupportsWeakReference))
return this;
if (iid.equals(Components.interfaces.nsIWebProgressListener) ||
iid.equals(Components.interfaces.nsISupportsWeakReference) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
throw Components.results.NS_NOINTERFACE;
}
};