Bug 20232 Replace T::GetIID() (etc.) with NS_GET_IID(T)

r=bsmedberg sr=biesi
This commit is contained in:
timeless%mozdev.org 2006-09-17 00:04:39 +00:00
Родитель 4ac05d33bb
Коммит 664b6df306
12 изменённых файлов: 18 добавлений и 49 удалений

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

@ -57,7 +57,6 @@
static NS_DEFINE_CID(kXMLDocumentCID, NS_XMLDOCUMENT_CID);
class nsXMLContentBuilder : public nsIXMLContentBuilder
{
protected:
@ -221,7 +220,7 @@ NS_IMETHODIMP nsXMLContentBuilder::GetRoot(nsIDOMElement * *aRoot)
*aRoot = nsnull;
return NS_OK;
}
return mTop->QueryInterface(nsIDOMElement::GetIID(), (void**)aRoot);
return CallQueryInterface(mTop, aRoot);
}
/* readonly attribute nsIDOMElement current; */
@ -231,7 +230,7 @@ NS_IMETHODIMP nsXMLContentBuilder::GetCurrent(nsIDOMElement * *aCurrent)
*aCurrent = nsnull;
return NS_OK;
}
return mCurrent->QueryInterface(nsIDOMElement::GetIID(), (void**)aCurrent);
return CallQueryInterface(mCurrent, aCurrent);
}
//----------------------------------------------------------------------

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

@ -318,7 +318,7 @@ EmbedPrivate::Realize(PRBool *aAlreadyRealized)
nsCOMPtr<nsIWeakReference> weakRef;
supportsWeak->GetWeakReference(getter_AddRefs(weakRef));
webBrowser->AddWebBrowserListener(weakRef,
nsIWebProgressListener::GetIID());
NS_GET_IID(nsIWebProgressListener));
// set ourselves as the parent uri content listener
nsCOMPtr<nsIURIContentListener> uriListener;
@ -403,7 +403,7 @@ EmbedPrivate::Destroy(void)
nsCOMPtr<nsIWeakReference> weakRef;
supportsWeak->GetWeakReference(getter_AddRefs(weakRef));
webBrowser->RemoveWebBrowserListener(weakRef,
nsIWebProgressListener::GetIID());
NS_GET_IID(nsIWebProgressListener));
weakRef = nsnull;
supportsWeak = nsnull;

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

@ -261,7 +261,7 @@ EmbedPrivate::Setup()
supportsWeak = do_QueryInterface(mProgressGuard);
nsCOMPtr<nsIWeakReference> weakRef;
supportsWeak->GetWeakReference(getter_AddRefs(weakRef));
webBrowser->AddWebBrowserListener(weakRef, nsIWebProgressListener::GetIID());
webBrowser->AddWebBrowserListener(weakRef, NS_GET_IID(nsIWebProgressListener));
// set ourselves as the parent uri content listener
nsCOMPtr<nsIURIContentListener> uriListener;
@ -326,7 +326,7 @@ EmbedPrivate::Destroy(void)
nsCOMPtr<nsIWeakReference> weakRef;
supportsWeak->GetWeakReference(getter_AddRefs(weakRef));
webBrowser->RemoveWebBrowserListener(weakRef,
nsIWebProgressListener::GetIID());
NS_GET_IID(nsIWebProgressListener));
weakRef = nsnull;
supportsWeak = nsnull;

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

@ -208,7 +208,7 @@ QGeckoEmbedPrivate::init()
nsCOMPtr<nsIWeakReference> weakRef;
supportsWeak->GetWeakReference(getter_AddRefs(weakRef));
webBrowser->AddWebBrowserListener(weakRef,
nsIWebProgressListener::GetIID());
NS_GET_IID(nsIWebProgressListener));
// set ourselves as the parent uri content listener
webBrowser->SetParentURIContentListener(contentListener);

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

@ -184,31 +184,9 @@ nsRenderingContextOS2::~nsRenderingContextOS2()
NS_IF_RELEASE(mSurface);
}
nsresult
nsRenderingContextOS2::QueryInterface( REFNSIID aIID, void **aInstancePtr)
{
if( !aInstancePtr)
return NS_ERROR_NULL_POINTER;
if( aIID.Equals( nsIRenderingContext::GetIID()))
*aInstancePtr = (void *) (nsIRenderingContext*) this;
else if( aIID.Equals( ((nsIRenderingContext*)this)->GetIID()))
*aInstancePtr = (void *) (nsIRenderingContext*)this;
else if( aIID.Equals( nsIRenderingContextOS2::GetIID()))
*aInstancePtr = (void *) (nsIRenderingContextOS2*) this;
else if( aIID.Equals( ((nsIRenderingContextOS2 *)this)->GetIID()))
*aInstancePtr = (void *) (nsIRenderingContextOS2*) this;
if( !*aInstancePtr)
return NS_NOINTERFACE;
NS_ADDREF_THIS();
return NS_OK;
}
NS_IMPL_ADDREF(nsRenderingContextOS2)
NS_IMPL_RELEASE(nsRenderingContextOS2)
NS_IMPL_ISUPPORTS2(nsRenderingContextOS2,
nsIRenderingContext,
nsIRenderingContextOS2)
NS_IMETHODIMP
nsRenderingContextOS2::Init( nsIDeviceContext *aContext,

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

@ -60,9 +60,6 @@
#include "nsISupportsObsolete.h"
#include "nsIMsgMailSession.h"
// we need this because of an egcs 1.0 (and possibly gcc) compiler bug
// that doesn't allow you to call ::nsISupports::GetIID() inside of a class
// that multiply inherits from nsISupports
static NS_DEFINE_CID(kCMailDB, NS_MAILDB_CID);
// this is totally lame and MUST be removed by M6

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

@ -96,9 +96,6 @@
#include "nsNativeCharsetUtils.h"
#include "nsIMsgAccountManager.h"
// we need this because of an egcs 1.0 (and possibly gcc) compiler bug
// that doesn't allow you to call ::nsISupports::GetIID() inside of a class
// that multiply inherits from nsISupports
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
static NS_DEFINE_CID(kCNewsDB, NS_NEWSDB_CID);

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

@ -79,7 +79,7 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr,
nsIComponentManager* compMgr;
rv = servMgr->GetService(kComponentManagerCID,
nsIComponentManager::GetIID(),
NS_GET_IID(nsIComponentManager),
(nsISupports**)&compMgr);
if (NS_FAILED(rv)) {
return rv;
@ -107,7 +107,7 @@ extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr,
nsIComponentManager* compMgr;
rv = servMgr->GetService(kComponentManagerCID,
nsIComponentManager::GetIID(),
NS_GET_IID(nsIComponentManager),
(nsISupports**)&compMgr);
if (NS_FAILED(rv)) {
return rv;

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

@ -204,7 +204,7 @@ nsSanePluginInstance::Initialize( nsIPluginInstancePeer* peer )
if ( NS_FAILED( result ) )
return result;
result = peer->QueryInterface( nsIPluginTagInfo::GetIID(),
result = peer->QueryInterface( NS_GET_IID(nsIPluginTagInfo),
( void ** )&taginfo );
if ( NS_SUCCEEDED( result ) )

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

@ -716,7 +716,7 @@ nsCertTree::GetCellText(PRInt32 row, nsITreeColumn* col,
if (NS_LITERAL_STRING("certcol").Equals(colID))
_retval.Assign(el->orgName);
else
_retval.SetCapacity(0);
_retval.Truncate();
return NS_OK;
}
PRInt32 colIndex;
@ -727,9 +727,7 @@ nsCertTree::GetCellText(PRInt32 row, nsITreeColumn* col,
mCellText->GetLength(&arrayLength);
}
if (arrayIndex < arrayLength) {
nsCOMPtr<nsISupportsString> myString;
mCellText->QueryElementAt(arrayIndex,
nsISupportsString::GetIID(), getter_AddRefs(myString));
nsCOMPtr<nsISupportsString> myString(do_QueryElementAt(mCellText, arrayIndex));
if (myString) {
myString->GetData(_retval);
return NS_OK;

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

@ -218,7 +218,7 @@ nsNSSCertificate::FormatUIStrings(const nsAutoString &nickname, nsAutoString &ni
nsCOMPtr<nsIX509Cert> x509Proxy;
NS_GetProxyForObject( NS_PROXY_TO_MAIN_THREAD,
nsIX509Cert::GetIID(),
NS_GET_IID(nsIX509Cert),
NS_STATIC_CAST(nsIX509Cert*, this),
NS_PROXY_SYNC | NS_PROXY_ALWAYS,
getter_AddRefs(x509Proxy));
@ -265,7 +265,7 @@ nsNSSCertificate::FormatUIStrings(const nsAutoString &nickname, nsAutoString &ni
rv = x509Proxy->GetValidity(getter_AddRefs(originalValidity));
if (NS_SUCCEEDED(rv) && originalValidity) {
NS_GetProxyForObject( NS_PROXY_TO_MAIN_THREAD,
nsIX509CertValidity::GetIID(),
NS_GET_IID(nsIX509CertValidity),
originalValidity,
NS_PROXY_SYNC | NS_PROXY_ALWAYS,
getter_AddRefs(validity));

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

@ -847,7 +847,7 @@ nsDirectoryService::GetFile(const char *prop, PRBool *persistent, nsIFile **_ret
// cases
else if (inAtom == nsDirectoryService::sGRE_ComponentDirectory)
{
rv = Get(NS_GRE_DIR, nsILocalFile::GetIID(), getter_AddRefs(localFile));
rv = Get(NS_GRE_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(localFile));
if (localFile)
localFile->AppendNative(COMPONENT_DIRECTORY);
}