Converting usage of ::GetIID() to NS_GET_IID().

Bug #20232, r=scc@netscape.com
This commit is contained in:
pp%ludusdesign.com 2000-01-11 20:49:15 +00:00
Родитель e18bd7193a
Коммит 13efd9e8c6
247 изменённых файлов: 1038 добавлений и 4586 удалений

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsCOMPtr.h"
@ -307,7 +308,7 @@ nsChromeProtocolHandler::~nsChromeProtocolHandler()
{
}
NS_IMPL_ISUPPORTS(nsChromeProtocolHandler, nsCOMTypeInfo<nsIProtocolHandler>::GetIID());
NS_IMPL_ISUPPORTS(nsChromeProtocolHandler, NS_GET_IID(nsIProtocolHandler));
NS_METHOD
nsChromeProtocolHandler::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
@ -363,7 +364,7 @@ nsChromeProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI,
}
else {
rv = nsComponentManager::CreateInstance(kStandardURLCID, nsnull,
nsCOMTypeInfo<nsIURI>::GetIID(),
NS_GET_IID(nsIURI),
(void**)&url);
if (NS_FAILED(rv)) return rv;
rv = url->SetSpec((char*)aSpec);

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
/*
@ -110,11 +111,11 @@ static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
if (! aResult)
return NS_ERROR_NULL_POINTER;
if (aIID.Equals(nsCOMTypeInfo<nsIDOMNodeList>::GetIID()) ||
if (aIID.Equals(NS_GET_IID(nsIDOMNodeList)) ||
aIID.Equals(kISupportsIID)) {
*aResult = NS_STATIC_CAST(nsIDOMNodeList*, this);
}
else if (aIID.Equals(nsCOMTypeInfo<nsIRDFNodeList>::GetIID())) {
else if (aIID.Equals(NS_GET_IID(nsIRDFNodeList))) {
*aResult = NS_STATIC_CAST(nsIRDFNodeList*, this);
}
else if (aIID.Equals(kIScriptObjectOwnerIID)) {

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
@ -187,14 +188,14 @@ nsXULAttribute::QueryInterface(REFNSIID aIID, void** aResult)
if (! aResult)
return NS_ERROR_NULL_POINTER;
if (aIID.Equals(nsIDOMAttr::GetIID()) ||
aIID.Equals(nsIDOMNode::GetIID()) ||
if (aIID.Equals(NS_GET_IID(nsIDOMAttr)) ||
aIID.Equals(NS_GET_IID(nsIDOMNode)) ||
aIID.Equals(kISupportsIID)) {
*aResult = NS_STATIC_CAST(nsIDOMAttr*, this);
NS_ADDREF(this);
return NS_OK;
}
else if (aIID.Equals(nsIScriptObjectOwner::GetIID())) {
else if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
*aResult = NS_STATIC_CAST(nsIScriptObjectOwner*, this);
NS_ADDREF(this);
return NS_OK;
@ -384,7 +385,7 @@ nsXULAttribute::GetScriptObject(nsIScriptContext* aContext, void** aScriptObject
nsIDOMScriptObjectFactory *factory;
rv = nsServiceManager::GetService(kDOMScriptObjectFactoryCID,
nsIDOMScriptObjectFactory::GetIID(),
NS_GET_IID(nsIDOMScriptObjectFactory),
(nsISupports **)&factory);
if (NS_FAILED(rv))
@ -525,13 +526,13 @@ nsXULAttributes::QueryInterface(REFNSIID aIID, void** aResult)
if (! aResult)
return NS_ERROR_NULL_POINTER;
if (aIID.Equals(nsIDOMNamedNodeMap::GetIID()) ||
if (aIID.Equals(NS_GET_IID(nsIDOMNamedNodeMap)) ||
aIID.Equals(kISupportsIID)) {
*aResult = NS_STATIC_CAST(nsIDOMNamedNodeMap*, this);
NS_ADDREF(this);
return NS_OK;
}
else if (aIID.Equals(nsIScriptObjectOwner::GetIID())) {
else if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
*aResult = NS_STATIC_CAST(nsIScriptObjectOwner*, this);
NS_ADDREF(this);
return NS_OK;
@ -636,7 +637,7 @@ nsXULAttributes::GetScriptObject(nsIScriptContext* aContext, void** aScriptObjec
nsIDOMScriptObjectFactory *factory;
rv = nsServiceManager::GetService(kDOMScriptObjectFactoryCID,
nsIDOMScriptObjectFactory::GetIID(),
NS_GET_IID(nsIDOMScriptObjectFactory),
(nsISupports **)&factory);
if (NS_FAILED(rv))

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
/*
@ -354,7 +355,7 @@ nsXULElement::Init()
}
rv = nsServiceManager::GetService(kXULContentUtilsCID,
nsCOMTypeInfo<nsIXULContentUtils>::GetIID(),
NS_GET_IID(nsIXULContentUtils),
(nsISupports**) &gXULUtils);
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get XUL content utils");
if (NS_FAILED(rv)) return rv;
@ -536,18 +537,18 @@ nsXULElement::QueryInterface(REFNSIID iid, void** result)
nsresult rv;
if (iid.Equals(nsIStyledContent::GetIID()) ||
if (iid.Equals(NS_GET_IID(nsIStyledContent)) ||
iid.Equals(kIContentIID) ||
iid.Equals(kISupportsIID)) {
*result = NS_STATIC_CAST(nsIStyledContent*, this);
}
else if (iid.Equals(nsIXMLContent::GetIID())) {
else if (iid.Equals(NS_GET_IID(nsIXMLContent))) {
*result = NS_STATIC_CAST(nsIXMLContent*, this);
}
else if (iid.Equals(nsCOMTypeInfo<nsIXULContent>::GetIID())) {
else if (iid.Equals(NS_GET_IID(nsIXULContent))) {
*result = NS_STATIC_CAST(nsIXULContent*, this);
}
else if (iid.Equals(nsIDOMXULElement::GetIID()) ||
else if (iid.Equals(NS_GET_IID(nsIDOMXULElement)) ||
iid.Equals(kIDOMElementIID) ||
iid.Equals(kIDOMNodeIID)) {
*result = NS_STATIC_CAST(nsIDOMElement*, this);
@ -567,19 +568,19 @@ nsXULElement::QueryInterface(REFNSIID iid, void** result)
else if (iid.Equals(kIJSScriptObjectIID)) {
*result = NS_STATIC_CAST(nsIJSScriptObject*, this);
}
else if (iid.Equals(nsIFocusableContent::GetIID()) &&
else if (iid.Equals(NS_GET_IID(nsIFocusableContent)) &&
(NameSpaceID() == kNameSpaceID_XUL) &&
IsFocusableContent()) {
*result = NS_STATIC_CAST(nsIFocusableContent*, this);
}
else if (iid.Equals(nsIStyleRule::GetIID())) {
else if (iid.Equals(NS_GET_IID(nsIStyleRule))) {
*result = NS_STATIC_CAST(nsIStyleRule*, this);
}
else if (iid.Equals(NS_GET_IID(nsIChromeEventHandler))) {
*result = NS_STATIC_CAST(nsIChromeEventHandler*, this);
}
else if ((iid.Equals(NS_GET_IID(nsIDOMXULTreeElement)) ||
iid.Equals(nsIXULTreeContent::GetIID())) &&
iid.Equals(NS_GET_IID(nsIXULTreeContent))) &&
(NameSpaceID() == kNameSpaceID_XUL) &&
(Tag() == kTreeAtom)) {
// We delegate XULTreeElement APIs to an aggregate object
@ -833,7 +834,7 @@ NS_IMETHODIMP
nsXULElement::GetOwnerDocument(nsIDOMDocument** aOwnerDocument)
{
if (mDocument) {
return mDocument->QueryInterface(nsIDOMDocument::GetIID(), (void**) aOwnerDocument);
return mDocument->QueryInterface(NS_GET_IID(nsIDOMDocument), (void**) aOwnerDocument);
}
else {
*aOwnerDocument = nsnull;
@ -1173,7 +1174,7 @@ nsXULElement::GetElementsByAttribute(const nsString& aAttribute,
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIDOMNode> domElement;
rv = QueryInterface(nsIDOMNode::GetIID(), getter_AddRefs(domElement));
rv = QueryInterface(NS_GET_IID(nsIDOMNode), getter_AddRefs(domElement));
if (NS_SUCCEEDED(rv)) {
GetElementsByAttribute(domElement, aAttribute, aValue, elements);
}

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
/*
@ -155,18 +156,18 @@ XULPopupListenerImpl::QueryInterface(REFNSIID iid, void** result)
return NS_ERROR_NULL_POINTER;
*result = nsnull;
if (iid.Equals(nsIXULPopupListener::GetIID()) ||
if (iid.Equals(NS_GET_IID(nsIXULPopupListener)) ||
iid.Equals(kISupportsIID)) {
*result = NS_STATIC_CAST(nsIXULPopupListener*, this);
NS_ADDREF_THIS();
return NS_OK;
}
else if (iid.Equals(nsIDOMMouseListener::GetIID())) {
else if (iid.Equals(NS_GET_IID(nsIDOMMouseListener))) {
*result = NS_STATIC_CAST(nsIDOMMouseListener*, this);
NS_ADDREF_THIS();
return NS_OK;
}
else if (iid.Equals(nsIDOMMouseMotionListener::GetIID())) {
else if (iid.Equals(NS_GET_IID(nsIDOMMouseMotionListener))) {
*result = NS_STATIC_CAST(nsIDOMMouseMotionListener*, this);
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
/*
@ -55,10 +56,10 @@ nsXULTreeElement::QueryInterface(REFNSIID aIID, void** aResult)
if (! aResult)
return NS_ERROR_NULL_POINTER;
if (aIID.Equals(nsCOMTypeInfo<nsIDOMXULTreeElement>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMXULTreeElement))) {
*aResult = NS_STATIC_CAST(nsIDOMXULTreeElement*, this);
}
else if (aIID.Equals(nsCOMTypeInfo<nsIXULTreeContent>::GetIID())) {
else if (aIID.Equals(NS_GET_IID(nsIXULTreeContent))) {
*aResult = NS_STATIC_CAST(nsIXULTreeContent*, this);
}
else {

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
/*
@ -128,7 +129,7 @@ nsXULControllers::RemoveControllerAt(PRUint32 index, nsIController **_retval)
if(mControllers) {
nsCOMPtr<nsISupports> supports;
mControllers->GetElementAt(index, getter_AddRefs(supports));
supports->QueryInterface(nsIController::GetIID(), (void**)_retval);
supports->QueryInterface(NS_GET_IID(nsIController), (void**)_retval);
mControllers->RemoveElementAt(index);
} else
*_retval = nsnull;
@ -143,7 +144,7 @@ nsXULControllers::GetControllerAt(PRUint32 index, nsIController **_retval)
if(mControllers) {
nsCOMPtr<nsISupports> supports;
mControllers->GetElementAt(index, getter_AddRefs(supports));
supports->QueryInterface(nsIController::GetIID(), (void**)_retval);
supports->QueryInterface(NS_GET_IID(nsIController), (void**)_retval);
} else
*_retval = nsnull;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
/*
@ -256,7 +257,7 @@ public:
}
};
NS_IMPL_ISUPPORTS(nsProxyLoadStream, nsIInputStream::GetIID());
NS_IMPL_ISUPPORTS(nsProxyLoadStream, NS_GET_IID(nsIInputStream));
//----------------------------------------------------------------------
//
@ -535,12 +536,12 @@ nsXULDocument::QueryInterface(REFNSIID iid, void** result)
iid.Equals(NS_GET_IID(nsIXMLDocument))) {
*result = NS_STATIC_CAST(nsIXULDocument*, this);
}
else if (iid.Equals(nsIDOMXULDocument::GetIID()) ||
iid.Equals(nsIDOMDocument::GetIID()) ||
iid.Equals(nsIDOMNode::GetIID())) {
else if (iid.Equals(NS_GET_IID(nsIDOMXULDocument)) ||
iid.Equals(NS_GET_IID(nsIDOMDocument)) ||
iid.Equals(NS_GET_IID(nsIDOMNode))) {
*result = NS_STATIC_CAST(nsIDOMXULDocument*, this);
}
else if (iid.Equals(nsIDOMNSDocument::GetIID())) {
else if (iid.Equals(NS_GET_IID(nsIDOMNSDocument))) {
*result = NS_STATIC_CAST(nsIDOMNSDocument*, this);
}
else if (iid.Equals(NS_GET_IID(nsIJSScriptObject))) {
@ -2146,7 +2147,7 @@ nsXULDocument::GetDocumentElement(nsIDOMElement** aDocumentElement)
return NS_ERROR_NULL_POINTER;
if (mRootContent) {
return mRootContent->QueryInterface(nsIDOMElement::GetIID(), (void**)aDocumentElement);
return mRootContent->QueryInterface(NS_GET_IID(nsIDOMElement), (void**)aDocumentElement);
}
else {
*aDocumentElement = nsnull;
@ -2198,7 +2199,7 @@ nsXULDocument::CreateElement(const nsString& aTagName, nsIDOMElement** aReturn)
if (NS_FAILED(rv)) return rv;
// get the DOM interface
rv = result->QueryInterface(nsIDOMElement::GetIID(), (void**) aReturn);
rv = result->QueryInterface(NS_GET_IID(nsIDOMElement), (void**) aReturn);
NS_ASSERTION(NS_SUCCEEDED(rv), "not a DOM element");
if (NS_FAILED(rv)) return rv;
@ -2224,13 +2225,13 @@ nsXULDocument::CreateTextNode(const nsString& aData, nsIDOMText** aReturn)
nsresult rv;
nsCOMPtr<nsITextContent> text;
rv = nsComponentManager::CreateInstance(kTextNodeCID, nsnull, nsITextContent::GetIID(), getter_AddRefs(text));
rv = nsComponentManager::CreateInstance(kTextNodeCID, nsnull, NS_GET_IID(nsITextContent), getter_AddRefs(text));
if (NS_FAILED(rv)) return rv;
rv = text->SetText(aData.GetUnicode(), aData.Length(), PR_FALSE);
if (NS_FAILED(rv)) return rv;
rv = text->QueryInterface(nsIDOMText::GetIID(), (void**) aReturn);
rv = text->QueryInterface(NS_GET_IID(nsIDOMText), (void**) aReturn);
NS_ASSERTION(NS_SUCCEEDED(rv), "not a DOMText");
if (NS_FAILED(rv)) return rv;
@ -2293,7 +2294,7 @@ nsXULDocument::GetElementsByTagName(const nsString& aTagName, nsIDOMNodeList** a
if (root != nsnull) {
nsIDOMNode* domRoot;
if (NS_SUCCEEDED(rv = root->QueryInterface(nsIDOMNode::GetIID(), (void**) &domRoot))) {
if (NS_SUCCEEDED(rv = root->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) &domRoot))) {
rv = GetElementsByTagName(domRoot, aTagName, elements);
NS_RELEASE(domRoot);
}
@ -2320,7 +2321,7 @@ nsXULDocument::GetElementsByAttribute(const nsString& aAttribute, const nsString
if (root != nsnull) {
nsIDOMNode* domRoot;
if (NS_SUCCEEDED(rv = root->QueryInterface(nsIDOMNode::GetIID(), (void**) &domRoot))) {
if (NS_SUCCEEDED(rv = root->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) &domRoot))) {
rv = GetElementsByAttribute(domRoot, aAttribute, aValue, elements);
NS_RELEASE(domRoot);
}
@ -2514,7 +2515,7 @@ nsXULDocument::CreateElementWithNameSpace(const nsString& aTagName,
if (NS_FAILED(rv)) return rv;
// get the DOM interface
rv = result->QueryInterface(nsIDOMElement::GetIID(), (void**) aResult);
rv = result->QueryInterface(NS_GET_IID(nsIDOMElement), (void**) aResult);
NS_ASSERTION(NS_SUCCEEDED(rv), "not a DOM element");
if (NS_FAILED(rv)) return rv;
@ -2826,7 +2827,7 @@ nsXULDocument::GetChildNodes(nsIDOMNodeList** aChildNodes)
if (NS_SUCCEEDED(rv)) {
nsIDOMNode* domNode = nsnull;
rv = mRootContent->QueryInterface(nsIDOMNode::GetIID(), (void**)&domNode);
rv = mRootContent->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&domNode);
NS_ASSERTION(NS_SUCCEEDED(rv), "root content is not a DOM node");
if (NS_SUCCEEDED(rv)) {
@ -2874,7 +2875,7 @@ nsXULDocument::GetFirstChild(nsIDOMNode** aFirstChild)
return NS_ERROR_NULL_POINTER;
if (mRootContent) {
return mRootContent->QueryInterface(nsIDOMNode::GetIID(), (void**) aFirstChild);
return mRootContent->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aFirstChild);
}
else {
*aFirstChild = nsnull;
@ -2891,7 +2892,7 @@ nsXULDocument::GetLastChild(nsIDOMNode** aLastChild)
return NS_ERROR_NULL_POINTER;
if (mRootContent) {
return mRootContent->QueryInterface(nsIDOMNode::GetIID(), (void**) aLastChild);
return mRootContent->QueryInterface(NS_GET_IID(nsIDOMNode), (void**) aLastChild);
}
else {
*aLastChild = nsnull;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
/*
@ -300,7 +301,7 @@ XULSortServiceImpl::XULSortServiceImpl(void)
}
rv = nsServiceManager::GetService(kXULContentUtilsCID,
nsCOMTypeInfo<nsIXULContentUtils>::GetIID(),
NS_GET_IID(nsIXULContentUtils),
(nsISupports**) &gXULUtils);
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get XUL content utils");
@ -418,7 +419,7 @@ XULSortServiceImpl::~XULSortServiceImpl(void)
NS_IMPL_ISUPPORTS(XULSortServiceImpl, nsIXULSortService::GetIID());
NS_IMPL_ISUPPORTS(XULSortServiceImpl, NS_GET_IID(nsIXULSortService));
@ -919,7 +920,7 @@ XULSortServiceImpl::GetCachedTarget(sortPtr sortInfo, nsIRDFResource* aSource,
{
// if we don't have a mInner, create one
rvTemp = nsComponentManager::CreateInstance(kRDFInMemoryDataSourceCID,
nsnull, nsIRDFDataSource::GetIID(), (void **)&(sortInfo->mInner));
nsnull, NS_GET_IID(nsIRDFDataSource), (void **)&(sortInfo->mInner));
}
if (sortInfo->mInner)
{

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
/*
@ -426,7 +427,7 @@ NS_NewXULTemplateBuilder(nsIRDFContentModelBuilder** aResult)
rv = result->Init();
if (NS_SUCCEEDED(rv)) {
rv = result->QueryInterface(nsCOMTypeInfo<nsIRDFContentModelBuilder>::GetIID(), (void**) aResult);
rv = result->QueryInterface(NS_GET_IID(nsIRDFContentModelBuilder), (void**) aResult);
}
NS_RELEASE(result);
@ -551,7 +552,7 @@ RDFGenericBuilderImpl::Init()
// the IDs if they've already been registered by someone else.
rv = nsComponentManager::CreateInstance(kNameSpaceManagerCID,
nsnull,
nsCOMTypeInfo<nsINameSpaceManager>::GetIID(),
NS_GET_IID(nsINameSpaceManager),
(void**) &gNameSpaceManager);
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to create namespace manager");
if (NS_FAILED(rv)) return rv;
@ -588,12 +589,12 @@ RDFGenericBuilderImpl::Init()
gRDFService->GetResource(XUL_NAMESPACE_URI "element", &kXUL_element);
rv = nsServiceManager::GetService(kRDFContainerUtilsCID,
nsIRDFContainerUtils::GetIID(),
NS_GET_IID(nsIRDFContainerUtils),
(nsISupports**) &gRDFContainerUtils);
if (NS_FAILED(rv)) return rv;
rv = nsServiceManager::GetService(kXULSortServiceCID,
nsCOMTypeInfo<nsIXULSortService>::GetIID(),
NS_GET_IID(nsIXULSortService),
(nsISupports**) &gXULSortService);
if (NS_FAILED(rv)) return rv;
@ -604,7 +605,7 @@ RDFGenericBuilderImpl::Init()
if (NS_FAILED(rv)) return rv;
rv = nsServiceManager::GetService(kXULContentUtilsCID,
nsCOMTypeInfo<nsIXULContentUtils>::GetIID(),
NS_GET_IID(nsIXULContentUtils),
(nsISupports**) &gXULUtils);
if (NS_FAILED(rv)) return rv;
}
@ -1950,7 +1951,7 @@ RDFGenericBuilderImpl::BuildContentFromTemplate(nsIContent *aTemplateNode,
nsCOMPtr<nsITextContent> content;
rv = nsComponentManager::CreateInstance(kTextNodeCID,
nsnull,
nsITextContent::GetIID(),
NS_GET_IID(nsITextContent),
getter_AddRefs(content));
if (NS_FAILED(rv)) return rv;

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

@ -18,6 +18,7 @@
*
* Contributor(s):
* Travis Bogard <travis@netscape.com>
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsDocShell.h"
@ -192,7 +193,7 @@ nsDocShell::SetDocument(nsIDOMDocument *aDOMDoc, nsIDOMElement *aRootNode)
nsCOMPtr<nsIDocumentLoaderFactory> docFactory;
static NS_DEFINE_CID(kLayoutDocumentLoaderFactoryCID, NS_LAYOUT_DOCUMENT_LOADER_FACTORY_CID);
NS_ENSURE_SUCCESS(nsComponentManager::CreateInstance(kLayoutDocumentLoaderFactoryCID, nsnull,
nsIDocumentLoaderFactory::GetIID(),
NS_GET_IID(nsIDocumentLoaderFactory),
(void**)getter_AddRefs(docFactory)),
NS_ERROR_FAILURE);

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsDocShell.h"
#include "nsIWebShell.h"
@ -2805,7 +2806,7 @@ nsWebShell::GetLinkState(const PRUnichar* aURLSpec, nsLinkState& aState)
// XXX: GlobalHistory is going to be moved out of the webshell into a more appropriate place.
if ((nsnull == mHistoryService) && !mFailedToLoadHistoryService) {
rv = nsServiceManager::GetService(kGlobalHistoryCID,
nsIGlobalHistory::GetIID(),
NS_GET_IID(nsIGlobalHistory),
(nsISupports**) &mHistoryService);
if (NS_FAILED(rv)) {
@ -3477,7 +3478,7 @@ nsWebShell::SelectAll(void)
nsCOMPtr<nsIDOMRange> range;
rv = nsComponentManager::CreateInstance(kCDOMRangeCID, nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
getter_AddRefs(range));
rv = range->SelectNodeContents(bodyNode);
@ -3929,7 +3930,7 @@ NS_IMETHODIMP nsWebShell::SetDocument(nsIDOMDocument *aDOMDoc,
nsCOMPtr<nsIDocumentLoaderFactory> docFactory;
static NS_DEFINE_CID(kLayoutDocumentLoaderFactoryCID, NS_LAYOUT_DOCUMENT_LOADER_FACTORY_CID);
NS_ENSURE_SUCCESS(nsComponentManager::CreateInstance(kLayoutDocumentLoaderFactoryCID, nsnull,
nsIDocumentLoaderFactory::GetIID(),
NS_GET_IID(nsIDocumentLoaderFactory),
(void**)getter_AddRefs(docFactory)),
NS_ERROR_FAILURE);

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsIDOMDOMException.h"
@ -72,7 +73,7 @@ NS_NewDOMException(nsIDOMDOMException** aException,
return NS_ERROR_OUT_OF_MEMORY;
}
return it->QueryInterface(nsIDOMDOMException::GetIID(),
return it->QueryInterface(NS_GET_IID(nsIDOMDOMException),
(void**)aException);
}
@ -128,12 +129,12 @@ nsDOMException::QueryInterface(const nsIID& aIID,
if (nsnull == aInstancePtrResult) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsIScriptObjectOwner::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
*aInstancePtrResult = (void*) ((nsIScriptObjectOwner*)this);
AddRef();
return NS_OK;
}
if (aIID.Equals(nsIDOMDOMException::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMDOMException))) {
*aInstancePtrResult = (void*) ((nsIDOMDOMException*)this);
AddRef();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsCOMPtr.h"
@ -260,7 +261,7 @@ GlobalWindowImpl::QueryInterface(const nsIID& aIID,
AddRef();
return NS_OK;
}
if (aIID.Equals(nsPIDOMWindow::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsPIDOMWindow))) {
*aInstancePtrResult = (void*)(nsISupports*)(nsPIDOMWindow*)this;
AddRef();
return NS_OK;
@ -2227,7 +2228,7 @@ GlobalWindowImpl::OpenInternal(JSContext *cx,
}
nsIURI *baseUri = nsnull;
rv = mDocURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
rv = mDocURL->QueryInterface(NS_GET_IID(nsIURI), (void**)&baseUri);
if (NS_FAILED(rv)) return rv;
rv = NS_MakeAbsoluteURI(mURL, baseUri, mAbsURL);

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsGlobalWindow.h"
@ -182,7 +183,7 @@ LocationImpl::GetHash(nsString& aHash)
if (NS_OK == result) {
char *ref;
nsIURL* url;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(NS_GET_IID(nsIURL), (void**)&url);
if (NS_SUCCEEDED(result)) {
result = url->GetRef(&ref);
NS_RELEASE(url);
@ -214,7 +215,7 @@ LocationImpl::SetHash(const nsString& aHash)
result = NS_NewURI(&uri, href);
if (NS_FAILED(result)) return result;
nsIURL* url;
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
result = uri->QueryInterface(NS_GET_IID(nsIURI), (void**)&url);
NS_RELEASE(uri);
if (NS_OK == result) {
char *buf = aHash.ToNewCString();
@ -558,7 +559,7 @@ LocationImpl::GetSearch(nsString& aSearch)
if (NS_OK == result) {
char *search;
nsIURL* url;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(NS_GET_IID(nsIURL), (void**)&url);
if (NS_SUCCEEDED(result)) {
result = url->GetQuery(&search);
NS_RELEASE(url);
@ -591,7 +592,7 @@ LocationImpl::SetSearch(const nsString& aSearch)
if (NS_OK == result) {
char *buf = aSearch.ToNewCString();
nsIURL* url;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(NS_GET_IID(nsIURL), (void**)&url);
if (NS_SUCCEEDED(result)) {
result = url->SetQuery(buf);
NS_RELEASE(url);

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsMimeTypeArray.h"
@ -57,12 +58,12 @@ NS_IMETHODIMP MimeTypeArrayImpl::QueryInterface(const nsIID& aIID,
if (nsnull == aInstancePtrResult) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsIScriptObjectOwner::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
*aInstancePtrResult = (void*) ((nsIScriptObjectOwner*)this);
AddRef();
return NS_OK;
}
if (aIID.Equals(nsIDOMMimeTypeArray::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMMimeTypeArray))) {
*aInstancePtrResult = (void*) ((nsIDOMMimeTypeArray*)this);
AddRef();
return NS_OK;
@ -192,12 +193,12 @@ NS_IMETHODIMP MimeTypeElementImpl::QueryInterface(const nsIID& aIID,
if (nsnull == aInstancePtrResult) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsIScriptObjectOwner::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
*aInstancePtrResult = (void*) ((nsIScriptObjectOwner*)this);
AddRef();
return NS_OK;
}
if (aIID.Equals(nsIDOMMimeType::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMMimeType))) {
*aInstancePtrResult = (void*) ((nsIDOMMimeType*)this);
AddRef();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsPluginArray.h"
@ -37,7 +38,7 @@ PluginArrayImpl::PluginArrayImpl(nsIDOMNavigator* navigator)
mScriptObject = nsnull;
mNavigator = navigator; // don't ADDREF here, needed for parent of script object.
if (nsServiceManager::GetService(kPluginManagerCID, nsIPluginHost::GetIID(), (nsISupports**)&mPluginHost) != NS_OK)
if (nsServiceManager::GetService(kPluginManagerCID, NS_GET_IID(nsIPluginHost), (nsISupports**)&mPluginHost) != NS_OK)
mPluginHost = nsnull;
mPluginCount = 0;
@ -67,12 +68,12 @@ NS_IMETHODIMP PluginArrayImpl::QueryInterface(const nsIID& aIID,
if (nsnull == aInstancePtrResult) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsIScriptObjectOwner::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
*aInstancePtrResult = (void*) ((nsIScriptObjectOwner*)this);
AddRef();
return NS_OK;
}
if (aIID.Equals(nsIDOMPluginArray::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMPluginArray))) {
*aInstancePtrResult = (void*) ((nsIDOMPluginArray*)this);
AddRef();
return NS_OK;
@ -214,12 +215,12 @@ NS_IMETHODIMP PluginElementImpl::QueryInterface(const nsIID& aIID,
if (nsnull == aInstancePtrResult) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsIScriptObjectOwner::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIScriptObjectOwner))) {
*aInstancePtrResult = (void*) ((nsIScriptObjectOwner*)this);
AddRef();
return NS_OK;
}
if (aIID.Equals(nsIDOMPlugin::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMPlugin))) {
*aInstancePtrResult = (void*) ((nsIDOMPlugin*)this);
AddRef();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsCOMPtr.h"
#include "jsapi.h"
@ -278,7 +279,7 @@ nsJSProtocolHandler::NewChannel(const char* verb,
return NS_ERROR_OUT_OF_MEMORY;
rv = proxyObjectManager->GetProxyObject(NS_UI_THREAD_EVENTQ,
nsCOMTypeInfo<nsIEvaluateStringProxy>::GetIID(),
NS_GET_IID(nsIEvaluateStringProxy),
NS_STATIC_CAST(nsISupports*, eval),
PROXY_SYNC | PROXY_ALWAYS,
(void**) &evalProxy);

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

@ -53,8 +53,6 @@ static const char *kNPLStr = \
" * Communications Corporation. Portions created by Netscape are\n"
" * Copyright (C) 1998 Netscape Communications Corporation. All\n"
" * Rights Reserved.\n"
" *\n"
" * Contributor(s): \n"
" */\n";
static const char *kDisclaimerStr = "/* AUTO-GENERATED. DO NOT EDIT!!! */\n";
static const char *kObjTypeStr = "nsIDOM%s*";

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#ifndef XP_MAC
@ -735,7 +736,7 @@ static const char kObjectGetCaseStr[] =
static const char kXPIDLObjectGetCaseStr[] =
" // get the js object; n.b., this will do a release on 'prop'\n"
" nsJSUtils::nsConvertXPCObjectToJSVal(prop, %s::GetIID(), cx, obj, vp);\n";
" nsJSUtils::nsConvertXPCObjectToJSVal(prop, NS_GET_IID(%s), cx, obj, vp);\n";
static const char kStringGetCaseStr[] =
" nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);\n";
@ -1239,7 +1240,7 @@ static const char kMethodObjectRetStr[] =
static const char kMethodXPIDLObjectRetStr[] =
" // n.b., this will release nativeRet\n"
" nsJSUtils::nsConvertXPCObjectToJSVal(nativeRet, %s::GetIID(), cx, obj, rval);\n";
" nsJSUtils::nsConvertXPCObjectToJSVal(nativeRet, NS_GET_IID(%s), cx, obj, rval);\n";
static const char kMethodStringRetStr[] =
" nsJSUtils::nsConvertStringToJSVal(nativeRet, cx, rval);\n";

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "DeleteRangeTxn.h"
@ -319,7 +320,7 @@ NS_IMETHODIMP DeleteRangeTxn::CreateTxnsToDeleteNodesBetween()
result = nsComponentManager::CreateInstance(kSubtreeIteratorCID,
nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(result)) return result;
if (!iter) return NS_ERROR_NULL_POINTER;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
@ -611,7 +612,7 @@ nsHTMLEditor::GetCellIndexes(nsIDOMElement *aCell, PRInt32 &aRowIndex, PRInt32 &
{ // get the table cell interface from the frame
nsITableCellLayout *cellLayoutObject=nsnull; // again, frames are not ref-counted
res = layoutObject->QueryInterface(nsITableCellLayout::GetIID(), (void**)(&cellLayoutObject));
res = layoutObject->QueryInterface(NS_GET_IID(nsITableCellLayout), (void**)(&cellLayoutObject));
if ((NS_SUCCEEDED(res)) && (nsnull!=cellLayoutObject))
{
res = cellLayoutObject->GetCellIndexes(aRowIndex, aColIndex);
@ -633,7 +634,7 @@ nsHTMLEditor::GetTableLayoutObject(nsIDOMElement* aTable, nsITableLayout **table
if ((NS_SUCCEEDED(res)) && (nsnull!=layoutObject))
{ // get the table interface from the frame
res = layoutObject->QueryInterface(nsITableLayout::GetIID(),
res = layoutObject->QueryInterface(NS_GET_IID(nsITableLayout),
(void**)(tableLayoutObject));
}
return res;
@ -809,7 +810,7 @@ nsHTMLEditor::GetFirstSelectedCell(nsCOMPtr<nsIDOMElement> &aCell)
nsCOMPtr<nsIDOMRange> range( do_QueryInterface(currentItem) );
nsCOMPtr<nsIContentIterator> iter;
res = nsComponentManager::CreateInstance(kCContentIteratorCID, nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if ((NS_SUCCEEDED(res)) && iter)
{

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "EditTxn.h"
@ -132,7 +133,7 @@ EditTxn::QueryInterface(REFNSIID aIID, void** aInstancePtr)
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsITransactionDescription::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsITransactionDescription))) {
*aInstancePtr = (void*)(nsITransactionDescription*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "IMETextTxn.h"
@ -376,7 +377,7 @@ NS_IMETHODIMP IMETextTxn::CollapseTextSelection(void)
result = nsComponentManager::CreateInstance(kRangeCID,
nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
getter_AddRefs(newRange));
NS_ASSERTION(NS_SUCCEEDED(result), "Cannot create new nsIDOMRange");
if(NS_FAILED(result))

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "PlaceholderTxn.h"
@ -57,12 +58,12 @@ NS_IMETHODIMP PlaceholderTxn::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
if (!aInstancePtr) return NS_ERROR_NULL_POINTER;
if (aIID.Equals(nsIAbsorbingTransaction::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIAbsorbingTransaction))) {
*aInstancePtr = (nsISupports*)(nsIAbsorbingTransaction*)(this);
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupportsWeakReference>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupportsWeakReference))) {
*aInstancePtr = (nsISupports*)(nsISupportsWeakReference*) this;
NS_ADDREF_THIS();
return NS_OK;
@ -157,7 +158,7 @@ NS_IMETHODIMP PlaceholderTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransact
nsCOMPtr<nsIAbsorbingTransaction> plcTxn;// = do_QueryInterface(editTxn);
// cant do_QueryInterface() above due to our broken transaction interfaces.
// instead have to brute it below. ugh.
editTxn->QueryInterface(nsIAbsorbingTransaction::GetIID(), getter_AddRefs(plcTxn));
editTxn->QueryInterface(NS_GET_IID(nsIAbsorbingTransaction), getter_AddRefs(plcTxn));
if (plcTxn)
{
nsCOMPtr<nsIAtom> atom;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
@ -33,12 +34,12 @@ TypeInState::QueryInterface(REFNSIID aIID, void** aInstancePtr)
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMSelectionListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMSelectionListener))) {
*aInstancePtr = (void*)(nsIDOMSelectionListener*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsAOLCiter.h"
@ -46,13 +47,13 @@ nsAOLCiter::QueryInterface(REFNSIID aIID, void** aInstancePtr)
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID()))
if (aIID.Equals(NS_GET_IID(nsISupports)))
{
*aInstancePtr = (void*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsICiter::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsICiter))) {
*aInstancePtr = (void*)(nsICiter*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsEditProperty.h"
@ -297,12 +298,12 @@ nsEditProperty::QueryInterface(REFNSIID aIID, void** aInstancePtr)
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIEditProperty::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIEditProperty))) {
*aInstancePtr = (void*)(nsIEditProperty*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "pratom.h"
@ -205,19 +206,19 @@ nsEditor::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return NS_ERROR_NULL_POINTER;
*aInstancePtr = nsnull;
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
nsIEditor *tmp = this;
nsISupports *tmp2 = tmp;
*aInstancePtr = (void*)tmp2;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIEditor::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIEditor))) {
*aInstancePtr = (void*)(nsIEditor*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIEditorIMESupport::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIEditorIMESupport))) {
*aInstancePtr = (void*)(nsIEditorIMESupport*)this;
NS_ADDREF_THIS();
return NS_OK;
@ -318,7 +319,7 @@ nsEditor::GetDocument(nsIDOMDocument **aDoc)
if (!mDocWeak) return NS_ERROR_NOT_INITIALIZED;
nsCOMPtr<nsIDOMDocument> doc = do_QueryReferent(mDocWeak);
if (!doc) return NS_ERROR_NOT_INITIALIZED;
return doc->QueryInterface(nsIDOMDocument::GetIID(), (void **)aDoc);
return doc->QueryInterface(NS_GET_IID(nsIDOMDocument), (void **)aDoc);
}
@ -332,7 +333,7 @@ nsEditor::GetPresShell(nsIPresShell **aPS)
if (!mPresShellWeak) return NS_ERROR_NOT_INITIALIZED;
nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
if (!ps) return NS_ERROR_NOT_INITIALIZED;
return ps->QueryInterface(nsIPresShell::GetIID(), (void **)aPS);
return ps->QueryInterface(NS_GET_IID(nsIPresShell), (void **)aPS);
}
@ -369,7 +370,7 @@ nsEditor::Do(nsITransaction *aTxn)
// Then we QI to an nsIAbsorbingTransaction to get at placeholder functionality
nsCOMPtr<nsIAbsorbingTransaction> plcTxn;
editTxn->QueryInterface(nsIAbsorbingTransaction::GetIID(), getter_AddRefs(plcTxn));
editTxn->QueryInterface(NS_GET_IID(nsIAbsorbingTransaction), getter_AddRefs(plcTxn));
// have to use line above instead of "plcTxn = do_QueryInterface(editTxn);"
// due to our broken interface model for transactions.
@ -425,7 +426,7 @@ nsEditor::EnableUndo(PRBool aEnable)
{
result = nsComponentManager::CreateInstance(kCTransactionManagerCID,
nsnull,
nsITransactionManager::GetIID(), getter_AddRefs(mTxnMgr));
NS_GET_IID(nsITransactionManager), getter_AddRefs(mTxnMgr));
if (NS_FAILED(result) || !mTxnMgr) {
printf("ERROR: Failed to get TransactionManager instance.\n");
return NS_ERROR_NOT_AVAILABLE;
@ -1600,7 +1601,7 @@ nsEditor::GetBodyElement(nsIDOMElement **aBodyElement)
result = nodeList->Item(0, getter_AddRefs(node));
if (NS_SUCCEEDED(result) && node)
{
//return node->QueryInterface(nsIDOMElement::GetIID(), (void **)aBodyElement);
//return node->QueryInterface(NS_GET_IID(nsIDOMElement), (void **)aBodyElement);
// Is above equivalent to this:
nsCOMPtr<nsIDOMElement> bodyElement = do_QueryInterface(node);
if (bodyElement)
@ -2652,7 +2653,7 @@ nsEditor::GetBlockParent(nsIDOMNode *aNode, nsIDOMElement **aBlockParent)
result = IsNodeInline(parent, isInline);
if (PR_FALSE==isInline)
{
parent->QueryInterface(nsIDOMElement::GetIID(), (void**)aBlockParent);
parent->QueryInterface(NS_GET_IID(nsIDOMElement), (void**)aBlockParent);
break;
}
result = parent->GetParentNode(getter_AddRefs(temp));
@ -2723,7 +2724,7 @@ nsEditor::GetBlockSectionsForRange(nsIDOMRange *aRange, nsISupportsArray *aSecti
nsresult result;
nsCOMPtr<nsIContentIterator>iter;
result = nsComponentManager::CreateInstance(kCContentIteratorCID, nsnull,
nsIContentIterator::GetIID(), getter_AddRefs(iter));
NS_GET_IID(nsIContentIterator), getter_AddRefs(iter));
if ((NS_SUCCEEDED(result)) && iter)
{
nsCOMPtr<nsIDOMRange> lastRange;
@ -2791,7 +2792,7 @@ nsEditor::GetBlockSectionsForRange(nsIDOMRange *aRange, nsISupportsArray *aSecti
if (gNoisy) {printf("adding range, setting lastRange with start node %p\n", leftNode.get());}
nsCOMPtr<nsIDOMRange> range;
result = nsComponentManager::CreateInstance(kCRangeCID, nsnull,
nsIDOMRange::GetIID(), getter_AddRefs(range));
NS_GET_IID(nsIDOMRange), getter_AddRefs(range));
if ((NS_SUCCEEDED(result)) && range)
{ // initialize the range
range->SetStart(leftNode, 0);
@ -2828,7 +2829,7 @@ nsEditor::IntermediateNodesAreInline(nsIDOMRange *aRange,
nsCOMPtr<nsIContentIterator>iter;
nsresult result;
result = nsComponentManager::CreateInstance(kCContentIteratorCID, nsnull,
nsIContentIterator::GetIID(), getter_AddRefs(iter));
NS_GET_IID(nsIContentIterator), getter_AddRefs(iter));
//XXX: maybe CreateInstance is expensive, and I should keep around a static iter?
// as long as this method can't be called recursively or re-entrantly!
@ -3381,14 +3382,14 @@ nsEditor::GetFirstNodeOfType(nsIDOMNode *aStartNode,
result = aStartNode->GetFirstChild(getter_AddRefs(childNode));
while (childNode)
{
result = childNode->QueryInterface(nsIDOMNode::GetIID(),getter_AddRefs(element));
result = childNode->QueryInterface(NS_GET_IID(nsIDOMNode),getter_AddRefs(element));
nsAutoString tag;
if (NS_SUCCEEDED(result) && (element))
{
element->GetTagName(tag);
if (PR_TRUE==aTag.EqualsIgnoreCase(tag))
{
return (childNode->QueryInterface(nsIDOMNode::GetIID(),(void **) aResult)); // does the addref
return (childNode->QueryInterface(NS_GET_IID(nsIDOMNode),(void **) aResult)); // does the addref
}
else
{
@ -3700,7 +3701,7 @@ nsEditor::NextNodeInBlock(nsIDOMNode *aNode, IterDirection aDir)
nsCOMPtr<nsIContentIterator> iter;
if (NS_FAILED(nsComponentManager::CreateInstance(kCContentIteratorCID, nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter))))
return nullNode;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsEditorController.h"
@ -577,7 +578,7 @@ NS_IMETHODIMP nsEditorController::GetFrame(nsIGfxTextControlFrame **aFrame)
if (!frame) { return NS_ERROR_FAILURE; }
NS_ENSURE_SUCCESS(
frame->QueryInterface(nsIGfxTextControlFrame::GetIID(), (void**)aFrame),
frame->QueryInterface(NS_GET_IID(nsIGfxTextControlFrame), (void**)aFrame),
NS_ERROR_FAILURE
);
*/

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsEditorEventListeners.h"
#include "nsEditor.h"
@ -95,17 +96,17 @@ nsTextEditorKeyListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMEventListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = (void*)(nsIDOMEventListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMKeyListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMKeyListener))) {
*aInstancePtr = (void*)(nsIDOMKeyListener*)this;
NS_ADDREF_THIS();
return NS_OK;
@ -366,17 +367,17 @@ nsTextEditorMouseListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMEventListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = (void*)(nsIDOMEventListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMMouseListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMMouseListener))) {
*aInstancePtr = (void*)(nsIDOMMouseListener*)this;
NS_ADDREF_THIS();
return NS_OK;
@ -404,7 +405,7 @@ IsNodeInSelection(nsIDOMNode *aInNode, nsIDOMSelection *aInSelection, PRBool &aO
nsCOMPtr<nsIContentIterator>iter;
nsresult result = nsComponentManager::CreateInstance(kContentIteratorCID, nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(result)) { return result; }
if (!iter) { return NS_ERROR_OUT_OF_MEMORY; }
@ -611,17 +612,17 @@ nsTextEditorTextListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMEventListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = (void*)(nsIDOMEventListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMTextListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMTextListener))) {
*aInstancePtr = (void*)(nsIDOMTextListener*)this;
NS_ADDREF_THIS();
return NS_OK;
@ -693,17 +694,17 @@ nsTextEditorDragListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMEventListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = (void*)(nsIDOMEventListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMDragListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMDragListener))) {
*aInstancePtr = (void*)(nsIDOMDragListener*)this;
NS_ADDREF_THIS();
return NS_OK;
@ -794,7 +795,7 @@ nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent)
// Create transferable for getting the drag data
nsCOMPtr<nsITransferable> trans;
rv = nsComponentManager::CreateInstance("component://netscape/widget/transferable", nsnull,
nsITransferable::GetIID(),
NS_GET_IID(nsITransferable),
(void**) getter_AddRefs(trans));
if ( NS_SUCCEEDED(rv) && trans ) {
// Add the text Flavor to the transferable,
@ -861,17 +862,17 @@ nsTextEditorCompositionListener::QueryInterface(REFNSIID aIID, void** aInstanceP
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMEventListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = (void*)(nsIDOMEventListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMCompositionListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMCompositionListener))) {
*aInstancePtr = (void*)(nsIDOMCompositionListener*)this;
NS_ADDREF_THIS();
return NS_OK;
@ -962,7 +963,7 @@ NS_NewEditorKeyListener(nsIDOMEventListener ** aInstancePtrResult,
it->SetEditor(aEditor);
return it->QueryInterface(nsIDOMEventListener::GetIID(), (void **) aInstancePtrResult);
return it->QueryInterface(NS_GET_IID(nsIDOMEventListener), (void **) aInstancePtrResult);
}
@ -978,7 +979,7 @@ NS_NewEditorMouseListener(nsIDOMEventListener ** aInstancePtrResult,
it->SetEditor(aEditor);
return it->QueryInterface(nsIDOMEventListener::GetIID(), (void **) aInstancePtrResult);
return it->QueryInterface(NS_GET_IID(nsIDOMEventListener), (void **) aInstancePtrResult);
}
@ -992,7 +993,7 @@ NS_NewEditorTextListener(nsIDOMEventListener** aInstancePtrResult, nsIEditor* aE
it->SetEditor(aEditor);
return it->QueryInterface(nsIDOMEventListener::GetIID(), (void **) aInstancePtrResult);
return it->QueryInterface(NS_GET_IID(nsIDOMEventListener), (void **) aInstancePtrResult);
}
@ -1008,7 +1009,7 @@ NS_NewEditorDragListener(nsIDOMEventListener ** aInstancePtrResult,
it->SetEditor(aEditor);
return it->QueryInterface(nsIDOMEventListener::GetIID(), (void **) aInstancePtrResult);
return it->QueryInterface(NS_GET_IID(nsIDOMEventListener), (void **) aInstancePtrResult);
}
nsresult
@ -1019,7 +1020,7 @@ NS_NewEditorCompositionListener(nsIDOMEventListener** aInstancePtrResult, nsIEdi
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetEditor(aEditor);
return it->QueryInterface(nsIDOMEventListener::GetIID(), (void **) aInstancePtrResult);
return it->QueryInterface(NS_GET_IID(nsIDOMEventListener), (void **) aInstancePtrResult);
}
nsresult
@ -1031,7 +1032,7 @@ NS_NewEditorFocusListener(nsIDOMEventListener ** aInstancePtrResult,
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetEditor(aEditor);
return it->QueryInterface(nsIDOMEventListener::GetIID(), (void **) aInstancePtrResult);
return it->QueryInterface(NS_GET_IID(nsIDOMEventListener), (void **) aInstancePtrResult);
}

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include <stdio.h>
@ -230,17 +231,17 @@ nsEditorShell::QueryInterface(REFNSIID aIID,void** aInstancePtr)
AddRef();
return NS_OK;
}
else if ( aIID.Equals(nsIEditorShell::GetIID()) ) {
else if ( aIID.Equals(NS_GET_IID(nsIEditorShell)) ) {
*aInstancePtr = (void*) ((nsIEditorShell*)this);
AddRef();
return NS_OK;
}
else if ( aIID.Equals(nsIEditorSpellCheck::GetIID()) ) {
else if ( aIID.Equals(NS_GET_IID(nsIEditorSpellCheck)) ) {
*aInstancePtr = (void*) ((nsIEditorSpellCheck*)this);
AddRef();
return NS_OK;
}
else if (aIID.Equals(nsIDocumentLoaderObserver::GetIID())) {
else if (aIID.Equals(NS_GET_IID(nsIDocumentLoaderObserver))) {
*aInstancePtr = (void*) ((nsIDocumentLoaderObserver*)this);
AddRef();
return NS_OK;
@ -341,7 +342,7 @@ nsEditorShell::PrepareDocumentForEditing(nsIURI *aUrl)
{
nsCOMPtr<nsIController> controller;
nsCOMPtr<nsIControllers> controllers;
rv = nsComponentManager::CreateInstance(kEditorControllerCID, nsnull, nsIController::GetIID(), getter_AddRefs(controller));
rv = nsComponentManager::CreateInstance(kEditorControllerCID, nsnull, NS_GET_IID(nsIController), getter_AddRefs(controller));
if (NS_SUCCEEDED(rv) && controller)
{
rv = mContentWindow->GetControllers(getter_AddRefs(controllers));
@ -498,7 +499,7 @@ nsEditorShell::GetPresShellFor(nsIWebShell* aWebShell)
aWebShell->GetContentViewer(&cv);
if (nsnull != cv) {
nsIDocumentViewer* docv = nsnull;
cv->QueryInterface(nsIDocumentViewer::GetIID(), (void**) &docv);
cv->QueryInterface(NS_GET_IID(nsIDocumentViewer), (void**) &docv);
if (nsnull != docv) {
nsIPresContext* cx;
docv->GetPresContext(cx);
@ -552,7 +553,7 @@ nsEditorShell::InstantiateEditor(nsIDOMDocument *aDoc, nsIPresShell *aPresShell)
nsresult err = NS_OK;
nsCOMPtr<nsIEditor> editor;
err = nsComponentManager::CreateInstance(kHTMLEditorCID, nsnull, nsIEditor::GetIID(), getter_AddRefs(editor));
err = nsComponentManager::CreateInstance(kHTMLEditorCID, nsnull, NS_GET_IID(nsIEditor), getter_AddRefs(editor));
if(!editor)
err = NS_ERROR_OUT_OF_MEMORY;
@ -610,7 +611,7 @@ nsEditorShell::DoEditorMode(nsIWebShell *aWebShell)
if (NS_SUCCEEDED(err) && Doc)
{
nsCOMPtr<nsIDOMDocument> DOMDoc;
if (NS_SUCCEEDED(Doc->QueryInterface(nsIDOMDocument::GetIID(), (void**)getter_AddRefs(DOMDoc))))
if (NS_SUCCEEDED(Doc->QueryInterface(NS_GET_IID(nsIDOMDocument), (void**)getter_AddRefs(DOMDoc))))
{
nsCOMPtr<nsIPresShell> presShell = dont_AddRef(GetPresShellFor(aWebShell));
if( presShell )
@ -1322,7 +1323,7 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval)
}
nsCOMPtr<nsIFileWidget> fileWidget;
res = nsComponentManager::CreateInstance(kCFileWidgetCID, nsnull, nsIFileWidget::GetIID(), getter_AddRefs(fileWidget));
res = nsComponentManager::CreateInstance(kCFileWidgetCID, nsnull, NS_GET_IID(nsIFileWidget), getter_AddRefs(fileWidget));
if (NS_SUCCEEDED(res) && fileWidget)
{
nsAutoString promptString = GetString("SaveDocumentAs");
@ -1511,7 +1512,7 @@ nsEditorShell::GetLocalFileURL(nsIDOMWindow *parent, const PRUnichar *filterType
nsresult res = nsComponentManager::CreateInstance(kCFileWidgetCID,
nsnull,
nsIFileWidget::GetIID(),
NS_GET_IID(nsIFileWidget),
(void**)&fileWidget);
if (NS_SUCCEEDED(res))
{
@ -2319,7 +2320,7 @@ nsEditorShell::ConfirmWithCancel(const nsString& aTitle, const nsString& aQuesti
nsIDialogParamBlock* block = NULL;
nsresult rv = nsComponentManager::CreateInstance(kDialogParamBlockCID, 0,
nsIDialogParamBlock::GetIID(),
NS_GET_IID(nsIDialogParamBlock),
(void**)&block );
if ( NS_SUCCEEDED(rv) )
{
@ -3272,7 +3273,7 @@ nsEditorShell::StartSpellChecking(PRUnichar **aFirstMisspelledWord)
result = nsComponentManager::CreateInstance(
kCTextServicesDocumentCID,
nsnull,
nsITextServicesDocument::GetIID(),
NS_GET_IID(nsITextServicesDocument),
(void **)getter_AddRefs(tsDoc));
if (NS_FAILED(result))
@ -3293,7 +3294,7 @@ nsEditorShell::StartSpellChecking(PRUnichar **aFirstMisspelledWord)
result = nsComponentManager::CreateInstance(kCSpellCheckerCID,
nsnull,
nsISpellChecker::GetIID(),
NS_GET_IID(nsISpellChecker),
(void **)getter_AddRefs(mSpellChecker));
if (NS_FAILED(result))

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include <stdio.h>
@ -79,7 +80,7 @@ nsEditorTxnLog::QueryInterface(REFNSIID aIID, void** aInstancePtr)
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsITransactionListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsITransactionListener))) {
*aInstancePtr = (void*)(nsITransactionListener*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsHTMLEditRules.h"
@ -97,7 +98,7 @@ nsHTMLEditRules::Init(nsHTMLEditor *aEditor, PRUint32 aFlags)
bodyNode = do_QueryInterface(bodyElem);
if (bodyNode)
{
res = nsComponentManager::CreateInstance(kRangeCID, nsnull, nsIDOMRange::GetIID(),
res = nsComponentManager::CreateInstance(kRangeCID, nsnull, NS_GET_IID(nsIDOMRange),
getter_AddRefs(mDocChangeRange));
if (NS_FAILED(res)) return res;
if (!mDocChangeRange) return NS_ERROR_NULL_POINTER;
@ -1968,7 +1969,7 @@ nsHTMLEditRules::IsEmptyNode( nsIDOMNode *aNode,
if (!nodeAsContent) return NS_ERROR_FAILURE;
nsresult res = nsComponentManager::CreateInstance(kContentIteratorCID,
nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(res)) return res;
res = iter->Init(nodeAsContent);
@ -2505,7 +2506,7 @@ nsHTMLEditRules::GetNodesForOperation(nsISupportsArray *inArrayOfRanges,
opRange = do_QueryInterface(isupports);
res = nsComponentManager::CreateInstance(kSubtreeIteratorCID,
nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(res)) return res;
res = iter->Init(opRange);
@ -3503,7 +3504,7 @@ nsHTMLEditRules::AdjustSpecialBreaks()
// need an iterator
res = nsComponentManager::CreateInstance(kContentIteratorCID,
nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(res)) return res;
@ -3591,7 +3592,7 @@ nsHTMLEditRules::AdjustWhitespace(nsIDOMSelection *aSelection)
// need an iterator
res = nsComponentManager::CreateInstance(kContentIteratorCID,
nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(res)) return res;
@ -3826,7 +3827,7 @@ nsHTMLEditRules::RemoveEmptyNodes()
// need an iterator
res = nsComponentManager::CreateInstance(kContentIteratorCID,
nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(res)) return res;
@ -4424,7 +4425,7 @@ nsHTMLEditListener::WillDeleteSelection(nsIDOMSelection *aSelection)
// construct a range to represent start and end of inNode
nsresult res = nsComponentManager::CreateInstance(kRangeCID,
nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
getter_AddRefs(range));
if (NS_FAILED(res)) return res;
res = mEditor->GetStartNodeAndOffset(aSelection, &selNode, &selOffset);
@ -4460,7 +4461,7 @@ nsHTMLEditListener::MakeRangeFromNode(nsIDOMNode *inNode, nsCOMPtr<nsIDOMRange>
// construct a range to represent start and end of inNode
nsresult res = nsComponentManager::CreateInstance(kRangeCID,
nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
getter_AddRefs(*outRange));
if (NS_FAILED(res)) return res;
res = (*outRange)->SelectNode(inNode);
@ -4484,7 +4485,7 @@ nsHTMLEditListener::MakeRangeFromTextOffsets(nsIDOMCharacterData *inNode,
// construct a range to represent start and end of text run
nsresult res = nsComponentManager::CreateInstance(kRangeCID,
nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
getter_AddRefs(*outRange));
if (NS_FAILED(res)) return res;
res = (*outRange)->SetStart(theNode, inStart);

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include <stdio.h>
@ -61,7 +62,7 @@ nsHTMLEditorLog::QueryInterface(REFNSIID aIID, void** aInstancePtr)
*aInstancePtr = nsnull;
if (aIID.Equals(nsIEditorLogging::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIEditorLogging))) {
*aInstancePtr = (void*)(nsIEditorLogging*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
@ -68,21 +69,21 @@ nsInterfaceState::QueryInterface(const nsIID& aIID, void** aInstancePtr)
}
*aInstancePtr = nsnull;
if (aIID.Equals(nsIDOMSelectionListener::GetIID()))
if (aIID.Equals(NS_GET_IID(nsIDOMSelectionListener)))
{
*aInstancePtr = (void*)(nsIDOMSelectionListener*)this;
AddRef();
return NS_OK;
}
if (aIID.Equals(nsIDocumentStateListener::GetIID()))
if (aIID.Equals(NS_GET_IID(nsIDocumentStateListener)))
{
*aInstancePtr = (void*)(nsIDocumentStateListener*)this;
AddRef();
return NS_OK;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID()))
if (aIID.Equals(NS_GET_IID(nsISupports)))
{
*aInstancePtr = (void*)(nsISupports *)(nsIDOMSelectionListener*)this;
AddRef();
@ -433,5 +434,5 @@ nsresult NS_NewInterfaceState(nsIHTMLEditor* aEditor, nsIWebShell* aWebShell, ns
return rv;
}
return newThang->QueryInterface(nsIDOMSelectionListener::GetIID(), (void **)aInstancePtrResult);
return newThang->QueryInterface(NS_GET_IID(nsIDOMSelectionListener), (void **)aInstancePtrResult);
}

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsInternetCiter.h"
@ -46,13 +47,13 @@ nsInternetCiter::QueryInterface(REFNSIID aIID, void** aInstancePtr)
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID()))
if (aIID.Equals(NS_GET_IID(nsISupports)))
{
*aInstancePtr = (void*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsICiter::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsICiter))) {
*aInstancePtr = (void*)(nsICiter*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include <stdio.h>
@ -230,17 +231,17 @@ nsEditorShell::QueryInterface(REFNSIID aIID,void** aInstancePtr)
AddRef();
return NS_OK;
}
else if ( aIID.Equals(nsIEditorShell::GetIID()) ) {
else if ( aIID.Equals(NS_GET_IID(nsIEditorShell)) ) {
*aInstancePtr = (void*) ((nsIEditorShell*)this);
AddRef();
return NS_OK;
}
else if ( aIID.Equals(nsIEditorSpellCheck::GetIID()) ) {
else if ( aIID.Equals(NS_GET_IID(nsIEditorSpellCheck)) ) {
*aInstancePtr = (void*) ((nsIEditorSpellCheck*)this);
AddRef();
return NS_OK;
}
else if (aIID.Equals(nsIDocumentLoaderObserver::GetIID())) {
else if (aIID.Equals(NS_GET_IID(nsIDocumentLoaderObserver))) {
*aInstancePtr = (void*) ((nsIDocumentLoaderObserver*)this);
AddRef();
return NS_OK;
@ -341,7 +342,7 @@ nsEditorShell::PrepareDocumentForEditing(nsIURI *aUrl)
{
nsCOMPtr<nsIController> controller;
nsCOMPtr<nsIControllers> controllers;
rv = nsComponentManager::CreateInstance(kEditorControllerCID, nsnull, nsIController::GetIID(), getter_AddRefs(controller));
rv = nsComponentManager::CreateInstance(kEditorControllerCID, nsnull, NS_GET_IID(nsIController), getter_AddRefs(controller));
if (NS_SUCCEEDED(rv) && controller)
{
rv = mContentWindow->GetControllers(getter_AddRefs(controllers));
@ -498,7 +499,7 @@ nsEditorShell::GetPresShellFor(nsIWebShell* aWebShell)
aWebShell->GetContentViewer(&cv);
if (nsnull != cv) {
nsIDocumentViewer* docv = nsnull;
cv->QueryInterface(nsIDocumentViewer::GetIID(), (void**) &docv);
cv->QueryInterface(NS_GET_IID(nsIDocumentViewer), (void**) &docv);
if (nsnull != docv) {
nsIPresContext* cx;
docv->GetPresContext(cx);
@ -552,7 +553,7 @@ nsEditorShell::InstantiateEditor(nsIDOMDocument *aDoc, nsIPresShell *aPresShell)
nsresult err = NS_OK;
nsCOMPtr<nsIEditor> editor;
err = nsComponentManager::CreateInstance(kHTMLEditorCID, nsnull, nsIEditor::GetIID(), getter_AddRefs(editor));
err = nsComponentManager::CreateInstance(kHTMLEditorCID, nsnull, NS_GET_IID(nsIEditor), getter_AddRefs(editor));
if(!editor)
err = NS_ERROR_OUT_OF_MEMORY;
@ -610,7 +611,7 @@ nsEditorShell::DoEditorMode(nsIWebShell *aWebShell)
if (NS_SUCCEEDED(err) && Doc)
{
nsCOMPtr<nsIDOMDocument> DOMDoc;
if (NS_SUCCEEDED(Doc->QueryInterface(nsIDOMDocument::GetIID(), (void**)getter_AddRefs(DOMDoc))))
if (NS_SUCCEEDED(Doc->QueryInterface(NS_GET_IID(nsIDOMDocument), (void**)getter_AddRefs(DOMDoc))))
{
nsCOMPtr<nsIPresShell> presShell = dont_AddRef(GetPresShellFor(aWebShell));
if( presShell )
@ -1322,7 +1323,7 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval)
}
nsCOMPtr<nsIFileWidget> fileWidget;
res = nsComponentManager::CreateInstance(kCFileWidgetCID, nsnull, nsIFileWidget::GetIID(), getter_AddRefs(fileWidget));
res = nsComponentManager::CreateInstance(kCFileWidgetCID, nsnull, NS_GET_IID(nsIFileWidget), getter_AddRefs(fileWidget));
if (NS_SUCCEEDED(res) && fileWidget)
{
nsAutoString promptString = GetString("SaveDocumentAs");
@ -1511,7 +1512,7 @@ nsEditorShell::GetLocalFileURL(nsIDOMWindow *parent, const PRUnichar *filterType
nsresult res = nsComponentManager::CreateInstance(kCFileWidgetCID,
nsnull,
nsIFileWidget::GetIID(),
NS_GET_IID(nsIFileWidget),
(void**)&fileWidget);
if (NS_SUCCEEDED(res))
{
@ -2319,7 +2320,7 @@ nsEditorShell::ConfirmWithCancel(const nsString& aTitle, const nsString& aQuesti
nsIDialogParamBlock* block = NULL;
nsresult rv = nsComponentManager::CreateInstance(kDialogParamBlockCID, 0,
nsIDialogParamBlock::GetIID(),
NS_GET_IID(nsIDialogParamBlock),
(void**)&block );
if ( NS_SUCCEEDED(rv) )
{
@ -3272,7 +3273,7 @@ nsEditorShell::StartSpellChecking(PRUnichar **aFirstMisspelledWord)
result = nsComponentManager::CreateInstance(
kCTextServicesDocumentCID,
nsnull,
nsITextServicesDocument::GetIID(),
NS_GET_IID(nsITextServicesDocument),
(void **)getter_AddRefs(tsDoc));
if (NS_FAILED(result))
@ -3293,7 +3294,7 @@ nsEditorShell::StartSpellChecking(PRUnichar **aFirstMisspelledWord)
result = nsComponentManager::CreateInstance(kCSpellCheckerCID,
nsnull,
nsISpellChecker::GetIID(),
NS_GET_IID(nsISpellChecker),
(void **)getter_AddRefs(mSpellChecker));
if (NS_FAILED(result))

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
@ -68,21 +69,21 @@ nsInterfaceState::QueryInterface(const nsIID& aIID, void** aInstancePtr)
}
*aInstancePtr = nsnull;
if (aIID.Equals(nsIDOMSelectionListener::GetIID()))
if (aIID.Equals(NS_GET_IID(nsIDOMSelectionListener)))
{
*aInstancePtr = (void*)(nsIDOMSelectionListener*)this;
AddRef();
return NS_OK;
}
if (aIID.Equals(nsIDocumentStateListener::GetIID()))
if (aIID.Equals(NS_GET_IID(nsIDocumentStateListener)))
{
*aInstancePtr = (void*)(nsIDocumentStateListener*)this;
AddRef();
return NS_OK;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID()))
if (aIID.Equals(NS_GET_IID(nsISupports)))
{
*aInstancePtr = (void*)(nsISupports *)(nsIDOMSelectionListener*)this;
AddRef();
@ -433,5 +434,5 @@ nsresult NS_NewInterfaceState(nsIHTMLEditor* aEditor, nsIWebShell* aWebShell, ns
return rv;
}
return newThang->QueryInterface(nsIDOMSelectionListener::GetIID(), (void **)aInstancePtrResult);
return newThang->QueryInterface(NS_GET_IID(nsIDOMSelectionListener), (void **)aInstancePtrResult);
}

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "DeleteRangeTxn.h"
@ -319,7 +320,7 @@ NS_IMETHODIMP DeleteRangeTxn::CreateTxnsToDeleteNodesBetween()
result = nsComponentManager::CreateInstance(kSubtreeIteratorCID,
nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(result)) return result;
if (!iter) return NS_ERROR_NULL_POINTER;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "EditTxn.h"
@ -132,7 +133,7 @@ EditTxn::QueryInterface(REFNSIID aIID, void** aInstancePtr)
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsITransactionDescription::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsITransactionDescription))) {
*aInstancePtr = (void*)(nsITransactionDescription*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "IMETextTxn.h"
@ -376,7 +377,7 @@ NS_IMETHODIMP IMETextTxn::CollapseTextSelection(void)
result = nsComponentManager::CreateInstance(kRangeCID,
nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
getter_AddRefs(newRange));
NS_ASSERTION(NS_SUCCEEDED(result), "Cannot create new nsIDOMRange");
if(NS_FAILED(result))

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "PlaceholderTxn.h"
@ -57,12 +58,12 @@ NS_IMETHODIMP PlaceholderTxn::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
if (!aInstancePtr) return NS_ERROR_NULL_POINTER;
if (aIID.Equals(nsIAbsorbingTransaction::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIAbsorbingTransaction))) {
*aInstancePtr = (nsISupports*)(nsIAbsorbingTransaction*)(this);
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupportsWeakReference>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupportsWeakReference))) {
*aInstancePtr = (nsISupports*)(nsISupportsWeakReference*) this;
NS_ADDREF_THIS();
return NS_OK;
@ -157,7 +158,7 @@ NS_IMETHODIMP PlaceholderTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransact
nsCOMPtr<nsIAbsorbingTransaction> plcTxn;// = do_QueryInterface(editTxn);
// cant do_QueryInterface() above due to our broken transaction interfaces.
// instead have to brute it below. ugh.
editTxn->QueryInterface(nsIAbsorbingTransaction::GetIID(), getter_AddRefs(plcTxn));
editTxn->QueryInterface(NS_GET_IID(nsIAbsorbingTransaction), getter_AddRefs(plcTxn));
if (plcTxn)
{
nsCOMPtr<nsIAtom> atom;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "pratom.h"
@ -205,19 +206,19 @@ nsEditor::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return NS_ERROR_NULL_POINTER;
*aInstancePtr = nsnull;
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
nsIEditor *tmp = this;
nsISupports *tmp2 = tmp;
*aInstancePtr = (void*)tmp2;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIEditor::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIEditor))) {
*aInstancePtr = (void*)(nsIEditor*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIEditorIMESupport::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIEditorIMESupport))) {
*aInstancePtr = (void*)(nsIEditorIMESupport*)this;
NS_ADDREF_THIS();
return NS_OK;
@ -318,7 +319,7 @@ nsEditor::GetDocument(nsIDOMDocument **aDoc)
if (!mDocWeak) return NS_ERROR_NOT_INITIALIZED;
nsCOMPtr<nsIDOMDocument> doc = do_QueryReferent(mDocWeak);
if (!doc) return NS_ERROR_NOT_INITIALIZED;
return doc->QueryInterface(nsIDOMDocument::GetIID(), (void **)aDoc);
return doc->QueryInterface(NS_GET_IID(nsIDOMDocument), (void **)aDoc);
}
@ -332,7 +333,7 @@ nsEditor::GetPresShell(nsIPresShell **aPS)
if (!mPresShellWeak) return NS_ERROR_NOT_INITIALIZED;
nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
if (!ps) return NS_ERROR_NOT_INITIALIZED;
return ps->QueryInterface(nsIPresShell::GetIID(), (void **)aPS);
return ps->QueryInterface(NS_GET_IID(nsIPresShell), (void **)aPS);
}
@ -369,7 +370,7 @@ nsEditor::Do(nsITransaction *aTxn)
// Then we QI to an nsIAbsorbingTransaction to get at placeholder functionality
nsCOMPtr<nsIAbsorbingTransaction> plcTxn;
editTxn->QueryInterface(nsIAbsorbingTransaction::GetIID(), getter_AddRefs(plcTxn));
editTxn->QueryInterface(NS_GET_IID(nsIAbsorbingTransaction), getter_AddRefs(plcTxn));
// have to use line above instead of "plcTxn = do_QueryInterface(editTxn);"
// due to our broken interface model for transactions.
@ -425,7 +426,7 @@ nsEditor::EnableUndo(PRBool aEnable)
{
result = nsComponentManager::CreateInstance(kCTransactionManagerCID,
nsnull,
nsITransactionManager::GetIID(), getter_AddRefs(mTxnMgr));
NS_GET_IID(nsITransactionManager), getter_AddRefs(mTxnMgr));
if (NS_FAILED(result) || !mTxnMgr) {
printf("ERROR: Failed to get TransactionManager instance.\n");
return NS_ERROR_NOT_AVAILABLE;
@ -1600,7 +1601,7 @@ nsEditor::GetBodyElement(nsIDOMElement **aBodyElement)
result = nodeList->Item(0, getter_AddRefs(node));
if (NS_SUCCEEDED(result) && node)
{
//return node->QueryInterface(nsIDOMElement::GetIID(), (void **)aBodyElement);
//return node->QueryInterface(NS_GET_IID(nsIDOMElement), (void **)aBodyElement);
// Is above equivalent to this:
nsCOMPtr<nsIDOMElement> bodyElement = do_QueryInterface(node);
if (bodyElement)
@ -2652,7 +2653,7 @@ nsEditor::GetBlockParent(nsIDOMNode *aNode, nsIDOMElement **aBlockParent)
result = IsNodeInline(parent, isInline);
if (PR_FALSE==isInline)
{
parent->QueryInterface(nsIDOMElement::GetIID(), (void**)aBlockParent);
parent->QueryInterface(NS_GET_IID(nsIDOMElement), (void**)aBlockParent);
break;
}
result = parent->GetParentNode(getter_AddRefs(temp));
@ -2723,7 +2724,7 @@ nsEditor::GetBlockSectionsForRange(nsIDOMRange *aRange, nsISupportsArray *aSecti
nsresult result;
nsCOMPtr<nsIContentIterator>iter;
result = nsComponentManager::CreateInstance(kCContentIteratorCID, nsnull,
nsIContentIterator::GetIID(), getter_AddRefs(iter));
NS_GET_IID(nsIContentIterator), getter_AddRefs(iter));
if ((NS_SUCCEEDED(result)) && iter)
{
nsCOMPtr<nsIDOMRange> lastRange;
@ -2791,7 +2792,7 @@ nsEditor::GetBlockSectionsForRange(nsIDOMRange *aRange, nsISupportsArray *aSecti
if (gNoisy) {printf("adding range, setting lastRange with start node %p\n", leftNode.get());}
nsCOMPtr<nsIDOMRange> range;
result = nsComponentManager::CreateInstance(kCRangeCID, nsnull,
nsIDOMRange::GetIID(), getter_AddRefs(range));
NS_GET_IID(nsIDOMRange), getter_AddRefs(range));
if ((NS_SUCCEEDED(result)) && range)
{ // initialize the range
range->SetStart(leftNode, 0);
@ -2828,7 +2829,7 @@ nsEditor::IntermediateNodesAreInline(nsIDOMRange *aRange,
nsCOMPtr<nsIContentIterator>iter;
nsresult result;
result = nsComponentManager::CreateInstance(kCContentIteratorCID, nsnull,
nsIContentIterator::GetIID(), getter_AddRefs(iter));
NS_GET_IID(nsIContentIterator), getter_AddRefs(iter));
//XXX: maybe CreateInstance is expensive, and I should keep around a static iter?
// as long as this method can't be called recursively or re-entrantly!
@ -3381,14 +3382,14 @@ nsEditor::GetFirstNodeOfType(nsIDOMNode *aStartNode,
result = aStartNode->GetFirstChild(getter_AddRefs(childNode));
while (childNode)
{
result = childNode->QueryInterface(nsIDOMNode::GetIID(),getter_AddRefs(element));
result = childNode->QueryInterface(NS_GET_IID(nsIDOMNode),getter_AddRefs(element));
nsAutoString tag;
if (NS_SUCCEEDED(result) && (element))
{
element->GetTagName(tag);
if (PR_TRUE==aTag.EqualsIgnoreCase(tag))
{
return (childNode->QueryInterface(nsIDOMNode::GetIID(),(void **) aResult)); // does the addref
return (childNode->QueryInterface(NS_GET_IID(nsIDOMNode),(void **) aResult)); // does the addref
}
else
{
@ -3700,7 +3701,7 @@ nsEditor::NextNodeInBlock(nsIDOMNode *aNode, IterDirection aDir)
nsCOMPtr<nsIContentIterator> iter;
if (NS_FAILED(nsComponentManager::CreateInstance(kCContentIteratorCID, nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter))))
return nullNode;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsEditorController.h"
@ -577,7 +578,7 @@ NS_IMETHODIMP nsEditorController::GetFrame(nsIGfxTextControlFrame **aFrame)
if (!frame) { return NS_ERROR_FAILURE; }
NS_ENSURE_SUCCESS(
frame->QueryInterface(nsIGfxTextControlFrame::GetIID(), (void**)aFrame),
frame->QueryInterface(NS_GET_IID(nsIGfxTextControlFrame), (void**)aFrame),
NS_ERROR_FAILURE
);
*/

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
@ -33,12 +34,12 @@ TypeInState::QueryInterface(REFNSIID aIID, void** aInstancePtr)
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMSelectionListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMSelectionListener))) {
*aInstancePtr = (void*)(nsIDOMSelectionListener*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsEditProperty.h"
@ -297,12 +298,12 @@ nsEditProperty::QueryInterface(REFNSIID aIID, void** aInstancePtr)
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIEditProperty::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIEditProperty))) {
*aInstancePtr = (void*)(nsIEditProperty*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include <stdio.h>
@ -79,7 +80,7 @@ nsEditorTxnLog::QueryInterface(REFNSIID aIID, void** aInstancePtr)
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsITransactionListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsITransactionListener))) {
*aInstancePtr = (void*)(nsITransactionListener*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsHTMLEditRules.h"
@ -97,7 +98,7 @@ nsHTMLEditRules::Init(nsHTMLEditor *aEditor, PRUint32 aFlags)
bodyNode = do_QueryInterface(bodyElem);
if (bodyNode)
{
res = nsComponentManager::CreateInstance(kRangeCID, nsnull, nsIDOMRange::GetIID(),
res = nsComponentManager::CreateInstance(kRangeCID, nsnull, NS_GET_IID(nsIDOMRange),
getter_AddRefs(mDocChangeRange));
if (NS_FAILED(res)) return res;
if (!mDocChangeRange) return NS_ERROR_NULL_POINTER;
@ -1968,7 +1969,7 @@ nsHTMLEditRules::IsEmptyNode( nsIDOMNode *aNode,
if (!nodeAsContent) return NS_ERROR_FAILURE;
nsresult res = nsComponentManager::CreateInstance(kContentIteratorCID,
nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(res)) return res;
res = iter->Init(nodeAsContent);
@ -2505,7 +2506,7 @@ nsHTMLEditRules::GetNodesForOperation(nsISupportsArray *inArrayOfRanges,
opRange = do_QueryInterface(isupports);
res = nsComponentManager::CreateInstance(kSubtreeIteratorCID,
nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(res)) return res;
res = iter->Init(opRange);
@ -3503,7 +3504,7 @@ nsHTMLEditRules::AdjustSpecialBreaks()
// need an iterator
res = nsComponentManager::CreateInstance(kContentIteratorCID,
nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(res)) return res;
@ -3591,7 +3592,7 @@ nsHTMLEditRules::AdjustWhitespace(nsIDOMSelection *aSelection)
// need an iterator
res = nsComponentManager::CreateInstance(kContentIteratorCID,
nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(res)) return res;
@ -3826,7 +3827,7 @@ nsHTMLEditRules::RemoveEmptyNodes()
// need an iterator
res = nsComponentManager::CreateInstance(kContentIteratorCID,
nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(res)) return res;
@ -4424,7 +4425,7 @@ nsHTMLEditListener::WillDeleteSelection(nsIDOMSelection *aSelection)
// construct a range to represent start and end of inNode
nsresult res = nsComponentManager::CreateInstance(kRangeCID,
nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
getter_AddRefs(range));
if (NS_FAILED(res)) return res;
res = mEditor->GetStartNodeAndOffset(aSelection, &selNode, &selOffset);
@ -4460,7 +4461,7 @@ nsHTMLEditListener::MakeRangeFromNode(nsIDOMNode *inNode, nsCOMPtr<nsIDOMRange>
// construct a range to represent start and end of inNode
nsresult res = nsComponentManager::CreateInstance(kRangeCID,
nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
getter_AddRefs(*outRange));
if (NS_FAILED(res)) return res;
res = (*outRange)->SelectNode(inNode);
@ -4484,7 +4485,7 @@ nsHTMLEditListener::MakeRangeFromTextOffsets(nsIDOMCharacterData *inNode,
// construct a range to represent start and end of text run
nsresult res = nsComponentManager::CreateInstance(kRangeCID,
nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
getter_AddRefs(*outRange));
if (NS_FAILED(res)) return res;
res = (*outRange)->SetStart(theNode, inStart);

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include <stdio.h>
@ -61,7 +62,7 @@ nsHTMLEditorLog::QueryInterface(REFNSIID aIID, void** aInstancePtr)
*aInstancePtr = nsnull;
if (aIID.Equals(nsIEditorLogging::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIEditorLogging))) {
*aInstancePtr = (void*)(nsIEditorLogging*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsAOLCiter.h"
@ -46,13 +47,13 @@ nsAOLCiter::QueryInterface(REFNSIID aIID, void** aInstancePtr)
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID()))
if (aIID.Equals(NS_GET_IID(nsISupports)))
{
*aInstancePtr = (void*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsICiter::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsICiter))) {
*aInstancePtr = (void*)(nsICiter*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsEditorEventListeners.h"
#include "nsEditor.h"
@ -95,17 +96,17 @@ nsTextEditorKeyListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMEventListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = (void*)(nsIDOMEventListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMKeyListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMKeyListener))) {
*aInstancePtr = (void*)(nsIDOMKeyListener*)this;
NS_ADDREF_THIS();
return NS_OK;
@ -366,17 +367,17 @@ nsTextEditorMouseListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMEventListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = (void*)(nsIDOMEventListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMMouseListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMMouseListener))) {
*aInstancePtr = (void*)(nsIDOMMouseListener*)this;
NS_ADDREF_THIS();
return NS_OK;
@ -404,7 +405,7 @@ IsNodeInSelection(nsIDOMNode *aInNode, nsIDOMSelection *aInSelection, PRBool &aO
nsCOMPtr<nsIContentIterator>iter;
nsresult result = nsComponentManager::CreateInstance(kContentIteratorCID, nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
getter_AddRefs(iter));
if (NS_FAILED(result)) { return result; }
if (!iter) { return NS_ERROR_OUT_OF_MEMORY; }
@ -611,17 +612,17 @@ nsTextEditorTextListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMEventListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = (void*)(nsIDOMEventListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMTextListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMTextListener))) {
*aInstancePtr = (void*)(nsIDOMTextListener*)this;
NS_ADDREF_THIS();
return NS_OK;
@ -693,17 +694,17 @@ nsTextEditorDragListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMEventListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = (void*)(nsIDOMEventListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMDragListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMDragListener))) {
*aInstancePtr = (void*)(nsIDOMDragListener*)this;
NS_ADDREF_THIS();
return NS_OK;
@ -794,7 +795,7 @@ nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent)
// Create transferable for getting the drag data
nsCOMPtr<nsITransferable> trans;
rv = nsComponentManager::CreateInstance("component://netscape/widget/transferable", nsnull,
nsITransferable::GetIID(),
NS_GET_IID(nsITransferable),
(void**) getter_AddRefs(trans));
if ( NS_SUCCEEDED(rv) && trans ) {
// Add the text Flavor to the transferable,
@ -861,17 +862,17 @@ nsTextEditorCompositionListener::QueryInterface(REFNSIID aIID, void** aInstanceP
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMEventListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = (void*)(nsIDOMEventListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIDOMCompositionListener::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsIDOMCompositionListener))) {
*aInstancePtr = (void*)(nsIDOMCompositionListener*)this;
NS_ADDREF_THIS();
return NS_OK;
@ -962,7 +963,7 @@ NS_NewEditorKeyListener(nsIDOMEventListener ** aInstancePtrResult,
it->SetEditor(aEditor);
return it->QueryInterface(nsIDOMEventListener::GetIID(), (void **) aInstancePtrResult);
return it->QueryInterface(NS_GET_IID(nsIDOMEventListener), (void **) aInstancePtrResult);
}
@ -978,7 +979,7 @@ NS_NewEditorMouseListener(nsIDOMEventListener ** aInstancePtrResult,
it->SetEditor(aEditor);
return it->QueryInterface(nsIDOMEventListener::GetIID(), (void **) aInstancePtrResult);
return it->QueryInterface(NS_GET_IID(nsIDOMEventListener), (void **) aInstancePtrResult);
}
@ -992,7 +993,7 @@ NS_NewEditorTextListener(nsIDOMEventListener** aInstancePtrResult, nsIEditor* aE
it->SetEditor(aEditor);
return it->QueryInterface(nsIDOMEventListener::GetIID(), (void **) aInstancePtrResult);
return it->QueryInterface(NS_GET_IID(nsIDOMEventListener), (void **) aInstancePtrResult);
}
@ -1008,7 +1009,7 @@ NS_NewEditorDragListener(nsIDOMEventListener ** aInstancePtrResult,
it->SetEditor(aEditor);
return it->QueryInterface(nsIDOMEventListener::GetIID(), (void **) aInstancePtrResult);
return it->QueryInterface(NS_GET_IID(nsIDOMEventListener), (void **) aInstancePtrResult);
}
nsresult
@ -1019,7 +1020,7 @@ NS_NewEditorCompositionListener(nsIDOMEventListener** aInstancePtrResult, nsIEdi
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetEditor(aEditor);
return it->QueryInterface(nsIDOMEventListener::GetIID(), (void **) aInstancePtrResult);
return it->QueryInterface(NS_GET_IID(nsIDOMEventListener), (void **) aInstancePtrResult);
}
nsresult
@ -1031,7 +1032,7 @@ NS_NewEditorFocusListener(nsIDOMEventListener ** aInstancePtrResult,
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetEditor(aEditor);
return it->QueryInterface(nsIDOMEventListener::GetIID(), (void **) aInstancePtrResult);
return it->QueryInterface(NS_GET_IID(nsIDOMEventListener), (void **) aInstancePtrResult);
}

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsInternetCiter.h"
@ -46,13 +47,13 @@ nsInternetCiter::QueryInterface(REFNSIID aIID, void** aInstancePtr)
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID()))
if (aIID.Equals(NS_GET_IID(nsISupports)))
{
*aInstancePtr = (void*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsICiter::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsICiter))) {
*aInstancePtr = (void*)(nsICiter*)this;
NS_ADDREF_THIS();
return NS_OK;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsLayoutCID.h"
@ -2463,7 +2464,7 @@ nsTextServicesDocument::CreateContentIterator(nsIDOMRange *aRange, nsIContentIte
*aIterator = 0;
result = nsComponentManager::CreateInstance(kCContentIteratorCID, nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
(void **)aIterator);
if (NS_FAILED(result))
@ -2544,7 +2545,7 @@ nsTextServicesDocument::CreateBodyContentRange(nsIDOMRange **aRange)
return NS_ERROR_NULL_POINTER;
result = nsComponentManager::CreateInstance(kCDOMRangeCID, nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
(void **)aRange);
if (NS_FAILED(result))
@ -2634,7 +2635,7 @@ nsTextServicesDocument::CreateBodyToNodeOffsetRange(nsIDOMNode *aParent, PRInt32
}
result = nsComponentManager::CreateInstance(kCDOMRangeCID, nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
(void **)aRange);
if (NS_FAILED(result))
@ -3782,7 +3783,7 @@ nsTextServicesDocument::ComparePoints(nsIDOMNode* aParent1, PRInt32 aOffset1,
nsCOMPtr<nsIDOMRange> range;
result = nsComponentManager::CreateInstance(kCDOMRangeCID, nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
getter_AddRefs(range));
if (NS_FAILED(result))
@ -3851,7 +3852,7 @@ nsTextServicesDocument::CreateRange(nsIDOMNode *aStartParent, PRInt32 aStartOffs
nsresult result;
result = nsComponentManager::CreateInstance(kCDOMRangeCID, nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
(void **)aRange);
if (NS_FAILED(result))

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsLayoutCID.h"
@ -2463,7 +2464,7 @@ nsTextServicesDocument::CreateContentIterator(nsIDOMRange *aRange, nsIContentIte
*aIterator = 0;
result = nsComponentManager::CreateInstance(kCContentIteratorCID, nsnull,
nsIContentIterator::GetIID(),
NS_GET_IID(nsIContentIterator),
(void **)aIterator);
if (NS_FAILED(result))
@ -2544,7 +2545,7 @@ nsTextServicesDocument::CreateBodyContentRange(nsIDOMRange **aRange)
return NS_ERROR_NULL_POINTER;
result = nsComponentManager::CreateInstance(kCDOMRangeCID, nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
(void **)aRange);
if (NS_FAILED(result))
@ -2634,7 +2635,7 @@ nsTextServicesDocument::CreateBodyToNodeOffsetRange(nsIDOMNode *aParent, PRInt32
}
result = nsComponentManager::CreateInstance(kCDOMRangeCID, nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
(void **)aRange);
if (NS_FAILED(result))
@ -3782,7 +3783,7 @@ nsTextServicesDocument::ComparePoints(nsIDOMNode* aParent1, PRInt32 aOffset1,
nsCOMPtr<nsIDOMRange> range;
result = nsComponentManager::CreateInstance(kCDOMRangeCID, nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
getter_AddRefs(range));
if (NS_FAILED(result))
@ -3851,7 +3852,7 @@ nsTextServicesDocument::CreateRange(nsIDOMNode *aStartParent, PRInt32 aStartOffs
nsresult result;
result = nsComponentManager::CreateInstance(kCDOMRangeCID, nsnull,
nsIDOMRange::GetIID(),
NS_GET_IID(nsIDOMRange),
(void **)aRange);
if (NS_FAILED(result))

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "stdafx.h"
@ -647,7 +648,7 @@ HRESULT CMozillaBrowser::CreateWebShell()
// Load preferences service
rv = nsServiceManager::GetService(kPrefCID,
nsIPref::GetIID(),
NS_GET_IID(nsIPref),
(nsISupports **)&m_pIPref);
if (NS_FAILED(rv))
{
@ -731,7 +732,7 @@ HRESULT CMozillaBrowser::SetEditorMode(BOOL bEnabled)
nsresult result = nsComponentManager::CreateInstance(kHTMLEditorCID,
nsnull,
nsIEditor::GetIID(),
NS_GET_IID(nsIEditor),
(void **) &m_pEditor);
if (NS_FAILED(result))
{

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

@ -17,11 +17,9 @@
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
* Rights Reserved.
*
* Contributor(s):
*
*
* Contributor(s):
* Robert Ginda, rginda@ndcico.com, original author
* Robert Ginda <rginda@ndcico.com> (original author)
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "prerror.h"
@ -111,7 +109,7 @@ bsConnection::~bsConnection()
}
NS_IMPL_ISUPPORTS(bsConnection, bsIConnection::GetIID());
NS_IMPL_ISUPPORTS(bsConnection, NS_GET_IID(bsIConnection));
NS_IMETHODIMP
bsConnection::Init(const char *hostname)

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#define NS_IMPL_IDS
@ -424,7 +425,7 @@ nsPICS::Init()
static PRBool first_time=PR_TRUE;
res = nsServiceManager::GetService(kPrefCID,
nsIPref::GetIID(),
NS_GET_IID(nsIPref),
(nsISupports **)&aPrefs);
if (NS_OK != res) {
@ -466,7 +467,7 @@ nsPICS::Init()
return rv;
rv = nsServiceManager::GetService(NS_OBSERVERSERVICE_PROGID,
nsIObserverService::GetIID(),
NS_GET_IID(nsIObserverService),
(nsISupports **)&anObserverService);
if(rv == NS_OK) {

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#define NS_IMPL_IDS
@ -158,7 +159,7 @@ NS_IMETHODIMP nsPICSElementObserver::Notify(PRUint32 aDocumentID,
rv = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(rv)) return rv;
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&uaURL);
rv = uri->QueryInterface(NS_GET_IID(nsIURI), (void**)&uaURL);
NS_RELEASE(uri);
if (NS_FAILED(rv)) return rv;
}

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

@ -90,7 +90,7 @@ PRInt32 main(PRInt32 argc, char *argv[])
nsComponentManager::RegisterComponent(kCParserCID, NULL, NULL, RAPTORHTMLPARS_DLL, PR_FALSE, PR_FALSE);
res = nsServiceManager::GetService(NS_OBSERVERSERVICE_PROGID,
nsIObserverService::GetIID(),
NS_GET_IID(nsIObserverService),
(nsISupports **)&anObserverService);

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

@ -22,8 +22,10 @@
* -- original author.
* Bob Miller, kbob@oblix.com
* -- plugged core leak.
* Pierre Phaneuf, pp@ludusdesign.com
* -- fixed some XPCOM usage.
*
* $Id: XSLProcessor.cpp,v 1.5 1999-11-25 03:03:06 kvisco%ziplink.net Exp $
* $Id: XSLProcessor.cpp,v 1.6 2000-01-11 20:47:47 pp%ludusdesign.com Exp $
*/
#include "XSLProcessor.h"
@ -36,7 +38,7 @@
/**
* XSLProcessor is a class for Processing XSL styelsheets
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
* @version $Revision: 1.5 $ $Date: 1999-11-25 03:03:06 $
* @version $Revision: 1.6 $ $Date: 2000-01-11 20:47:47 $
**/
/**
@ -126,7 +128,7 @@ XSLProcessor::Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult)
return rv;
}
NS_IMPL_ISUPPORTS(XSLProcessor, nsIDocumentTransformer::GetIID());
NS_IMPL_ISUPPORTS(XSLProcessor, NS_GET_IID(nsIDocumentTransformer));
#endif
/**

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nscore.h"
@ -46,7 +47,7 @@ SignonViewerImpl::~SignonViewerImpl()
{
}
NS_IMPL_ISUPPORTS(SignonViewerImpl, nsISignonViewer::GetIID());
NS_IMPL_ISUPPORTS(SignonViewerImpl, NS_GET_IID(nsISignonViewer));
NS_IMETHODIMP
SignonViewerImpl::GetSignonValue(char** aValue)

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsCOMPtr.h"
@ -186,7 +187,7 @@ void nsWalletlibService::Init()
nsIDocumentLoader *docLoaderService;
nsresult rv = nsServiceManager::GetService
(NS_OBSERVERSERVICE_PROGID, nsIObserverService::GetIID(), (nsISupports**)&svc );
(NS_OBSERVERSERVICE_PROGID, NS_GET_IID(nsIObserverService), (nsISupports**)&svc );
if ( NS_SUCCEEDED( rv ) && svc ) {
nsString topic(NS_FORMSUBMIT_SUBJECT);
rv = svc->AddObserver( this, topic.GetUnicode());

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#define alphabetize 1
@ -643,7 +644,7 @@ si_RemoveUser(char *URLName, char *userName, PRBool save) {
char * colon = nsnull;
if (URLName) {
nsCOMPtr<nsIURL> uri;
nsComponentManager::CreateInstance(kStandardUrlCID, nsnull, nsCOMTypeInfo<nsIURL>::GetIID(), (void **) getter_AddRefs(uri));
nsComponentManager::CreateInstance(kStandardUrlCID, nsnull, NS_GET_IID(nsIURL), (void **) getter_AddRefs(uri));
uri->SetSpec((char *)URLName);
/* uri is of the form <scheme>://<username>:<password>@<host>:<portnumber>/<pathname>) */
@ -2244,7 +2245,7 @@ SINGSIGN_PromptUsernameAndPassword
/* convert to a uri so we can parse out the hostname */
nsCOMPtr<nsIURL> uri;
nsComponentManager::CreateInstance(kStandardUrlCID, nsnull, nsCOMTypeInfo<nsIURL>::GetIID(), (void **) getter_AddRefs(uri));
nsComponentManager::CreateInstance(kStandardUrlCID, nsnull, NS_GET_IID(nsIURL), (void **) getter_AddRefs(uri));
uri->SetSpec((char *)urlname);
/* uri is of the form <scheme>://<username>:<password>@<host>:<portnumber>/<pathname>) */
@ -2300,7 +2301,7 @@ SINGSIGN_PromptPassword
/* convert to a uri so we can parse out the username and hostname */
nsCOMPtr<nsIURL> uri;
nsComponentManager::CreateInstance(kStandardUrlCID, nsnull, nsCOMTypeInfo<nsIURL>::GetIID(), (void **) getter_AddRefs(uri));
nsComponentManager::CreateInstance(kStandardUrlCID, nsnull, NS_GET_IID(nsIURL), (void **) getter_AddRefs(uri));
uri->SetSpec((char *)urlname);
/* uri is of the form <scheme>://<username>:<password>@<host>:<portnumber>/<pathname>) */

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
/*
@ -650,7 +651,7 @@ Wallet_Localize(char* genericString) {
return v.ToNewUnicode();
}
ret = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
ret = uri->QueryInterface(NS_GET_IID(nsIURI), (void**)&url);
nsServiceManager::ReleaseService(kIOServiceCID, pNetService);
if (NS_FAILED(ret)) {

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

@ -16,6 +16,7 @@
* Copyright (C) 1999 Ramalingam Saravanan. All Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
// mozLineTerm.cpp: class implementing mozILineTerm/mozILineTermAux interfaces,
@ -133,11 +134,11 @@ mozLineTerm::QueryInterface(REFNSIID aIID,void** aInstancePtr)
*aInstancePtr = NS_STATIC_CAST(nsISupports*,
NS_STATIC_CAST(mozILineTermAux*,this));
} else if ( aIID.Equals(mozILineTerm::GetIID()) ) {
} else if ( aIID.Equals(NS_GET_IID(mozILineTerm)) ) {
*aInstancePtr = NS_STATIC_CAST(mozILineTerm*,
NS_STATIC_CAST(mozILineTermAux*,this));
} else if ( aIID.Equals(mozILineTermAux::GetIID()) ) {
} else if ( aIID.Equals(NS_GET_IID(mozILineTermAux)) ) {
*aInstancePtr = NS_STATIC_CAST(mozILineTermAux*,this);
} else {

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

@ -16,6 +16,7 @@
* Copyright (C) 1999 Ramalingam Saravanan. All Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
// mozXMLTermListeners.cpp: implementation of classes in mozXMLTermListeners.h
@ -46,7 +47,7 @@ NS_NewXMLTermKeyListener(nsIDOMEventListener ** aInstancePtrResult,
// Save non-owning reference to embedding XMLTerminal object
listener->SetXMLTerminal(aXMLTerminal);
return listener->QueryInterface(nsIDOMEventListener::GetIID(),
return listener->QueryInterface(NS_GET_IID(nsIDOMEventListener),
(void **) aInstancePtrResult);
}
@ -62,7 +63,7 @@ NS_NewXMLTermTextListener(nsIDOMEventListener ** aInstancePtrResult,
// Save non-owning reference to embedding XMLTerminal object
listener->SetXMLTerminal(aXMLTerminal);
return listener->QueryInterface(nsIDOMEventListener::GetIID(),
return listener->QueryInterface(NS_GET_IID(nsIDOMEventListener),
(void **) aInstancePtrResult);
}
@ -78,7 +79,7 @@ NS_NewXMLTermMouseListener(nsIDOMEventListener ** aInstancePtrResult,
// Save non-owning reference to embedding XMLTerminal object
listener->SetXMLTerminal(aXMLTerminal);
return listener->QueryInterface(nsIDOMEventListener::GetIID(),
return listener->QueryInterface(NS_GET_IID(nsIDOMEventListener),
(void **) aInstancePtrResult);
}
@ -94,7 +95,7 @@ NS_NewXMLTermDragListener(nsIDOMEventListener ** aInstancePtrResult,
// Save non-owning reference to embedding XMLTerminal object
listener->SetXMLTerminal(aXMLTerminal);
return listener->QueryInterface(nsIDOMEventListener::GetIID(),
return listener->QueryInterface(NS_GET_IID(nsIDOMEventListener),
(void **) aInstancePtrResult);
}
@ -128,14 +129,14 @@ mozXMLTermKeyListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
// Always NULL result, in case of failure
*aInstancePtr = NULL;
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = NS_STATIC_CAST(nsISupports*,
NS_STATIC_CAST(nsIDOMKeyListener*,this));
} else if (aIID.Equals(nsIDOMEventListener::GetIID())) {
} else if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = NS_STATIC_CAST(nsIDOMEventListener*,this);
} else if (aIID.Equals(nsIDOMKeyListener::GetIID())) {
} else if (aIID.Equals(NS_GET_IID(nsIDOMKeyListener))) {
*aInstancePtr = NS_STATIC_CAST(nsIDOMKeyListener*,this);
} else {
@ -344,14 +345,14 @@ mozXMLTermTextListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
// Always NULL result, in case of failure
*aInstancePtr = NULL;
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = NS_STATIC_CAST(nsISupports*,
NS_STATIC_CAST(nsIDOMTextListener*,this));
} else if (aIID.Equals(nsIDOMEventListener::GetIID())) {
} else if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = NS_STATIC_CAST(nsIDOMEventListener*,this);
} else if (aIID.Equals(nsIDOMTextListener::GetIID())) {
} else if (aIID.Equals(NS_GET_IID(nsIDOMTextListener))) {
*aInstancePtr = NS_STATIC_CAST(nsIDOMTextListener*,this);
} else {
@ -422,14 +423,14 @@ mozXMLTermMouseListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
// Always NULL result, in case of failure
*aInstancePtr = NULL;
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = NS_STATIC_CAST(nsISupports*,
NS_STATIC_CAST(nsIDOMMouseListener*,this));
} else if (aIID.Equals(nsIDOMEventListener::GetIID())) {
} else if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = NS_STATIC_CAST(nsIDOMEventListener*,this);
} else if (aIID.Equals(nsIDOMMouseListener::GetIID())) {
} else if (aIID.Equals(NS_GET_IID(nsIDOMMouseListener))) {
*aInstancePtr = NS_STATIC_CAST(nsIDOMMouseListener*,this);
} else {
@ -542,14 +543,14 @@ mozXMLTermDragListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
// Always NULL result, in case of failure
*aInstancePtr = NULL;
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = NS_STATIC_CAST(nsISupports*,
NS_STATIC_CAST(nsIDOMDragListener*,this));
} else if (aIID.Equals(nsIDOMEventListener::GetIID())) {
} else if (aIID.Equals(NS_GET_IID(nsIDOMEventListener))) {
*aInstancePtr = NS_STATIC_CAST(nsIDOMEventListener*,this);
} else if (aIID.Equals(nsIDOMDragListener::GetIID())) {
} else if (aIID.Equals(NS_GET_IID(nsIDOMDragListener))) {
*aInstancePtr = NS_STATIC_CAST(nsIDOMDragListener*,this);
} else {

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

@ -16,6 +16,7 @@
* Copyright (C) 1999 Ramalingam Saravanan. All Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
// mozXMLTermShell.cpp: implementation of mozIXMLTermShell
@ -118,7 +119,7 @@ mozXMLTermShell::QueryInterface(REFNSIID aIID,void** aInstancePtr)
*aInstancePtr = NS_STATIC_CAST(nsISupports*,
NS_STATIC_CAST(mozIXMLTermShell*,this));
} else if ( aIID.Equals(mozIXMLTermShell::GetIID()) ) {
} else if ( aIID.Equals(NS_GET_IID(mozIXMLTermShell)) ) {
*aInstancePtr = NS_STATIC_CAST(mozIXMLTermShell*,this);
} else {
@ -288,7 +289,7 @@ mozXMLTermShell::NewXMLTermWindow(const PRUnichar* args)
// Create the toolkit core instance...
nsIDOMToolkitCore* toolkit = nsnull;
result = nsServiceManager::GetService(kToolkitCoreCID,
nsIDOMToolkitCore::GetIID(),
NS_GET_IID(nsIDOMToolkitCore),
(nsISupports**)&toolkit);
if (NS_FAILED(result))
return result;
@ -316,7 +317,7 @@ mozXMLTermShell::Exit()
// Create the Application Shell instance...
nsresult result = nsServiceManager::GetService(kAppShellServiceCID,
nsIAppShellService::GetIID(),
NS_GET_IID(nsIAppShellService),
(nsISupports**)&appShell);
if (NS_SUCCEEDED(result)) {
appShell->Shutdown();

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

@ -16,6 +16,7 @@
* Copyright (C) 1999 Ramalingam Saravanan. All Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
// mozXMLTerminal.cpp: implementation of mozIXMLTerminal interface
@ -264,30 +265,30 @@ NS_IMETHODIMP mozXMLTerminal::Finalize(void)
if (mDOMDocument) {
// Release any event listeners for the document
nsCOMPtr<nsIDOMEventReceiver> eventReceiver;
nsresult result = mDOMDocument->QueryInterface(nsIDOMEventReceiver::GetIID(), getter_AddRefs(eventReceiver));
nsresult result = mDOMDocument->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), getter_AddRefs(eventReceiver));
if (NS_SUCCEEDED(result) && eventReceiver) {
if (mKeyListener) {
eventReceiver->RemoveEventListenerByIID(mKeyListener,
nsIDOMKeyListener::GetIID());
NS_GET_IID(nsIDOMKeyListener));
mKeyListener = nsnull;
}
if (mTextListener) {
eventReceiver->RemoveEventListenerByIID(mTextListener,
nsIDOMTextListener::GetIID());
NS_GET_IID(nsIDOMTextListener));
mTextListener = nsnull;
}
if (mMouseListener) {
eventReceiver->RemoveEventListenerByIID(mMouseListener,
nsIDOMMouseListener::GetIID());
NS_GET_IID(nsIDOMMouseListener));
mMouseListener = nsnull;
}
if (mDragListener) {
eventReceiver->RemoveEventListenerByIID(mDragListener,
nsIDOMDragListener::GetIID());
NS_GET_IID(nsIDOMDragListener));
mDragListener = nsnull;
}
}
@ -458,7 +459,7 @@ NS_IMETHODIMP mozXMLTerminal::Activate(void)
// Get the DOM event receiver for document
nsCOMPtr<nsIDOMEventReceiver> eventReceiver;
result = mDOMDocument->QueryInterface(nsIDOMEventReceiver::GetIID(),
result = mDOMDocument->QueryInterface(NS_GET_IID(nsIDOMEventReceiver),
getter_AddRefs(eventReceiver));
if (NS_FAILED(result)) {
XMLT_WARNING("mozXMLTerminal::Activate: Warning - Failed to get DOM receiver\n");
@ -474,7 +475,7 @@ NS_IMETHODIMP mozXMLTerminal::Activate(void)
// Register the key listener with the DOM event receiver
result = eventReceiver->AddEventListenerByIID(mKeyListener,
nsIDOMKeyListener::GetIID());
NS_GET_IID(nsIDOMKeyListener));
if (NS_FAILED(result)) {
XMLT_WARNING("mozXMLTerminal::Activate: Warning - Failed to register key listener\n");
@ -490,7 +491,7 @@ NS_IMETHODIMP mozXMLTerminal::Activate(void)
// Register the text listener with the DOM event receiver
result = eventReceiver->AddEventListenerByIID(mTextListener,
nsIDOMTextListener::GetIID());
NS_GET_IID(nsIDOMTextListener));
if (NS_FAILED(result)) {
XMLT_WARNING("mozXMLTerminal::Activate: Warning - Failed to register text listener\n");
return result;
@ -505,7 +506,7 @@ NS_IMETHODIMP mozXMLTerminal::Activate(void)
// Register the mouse listener with the DOM event receiver
result = eventReceiver->AddEventListenerByIID(mMouseListener,
nsIDOMMouseListener::GetIID());
NS_GET_IID(nsIDOMMouseListener));
if (NS_FAILED(result)) {
XMLT_WARNING("mozXMLTerminal::Activate: Warning - Failed to register mouse listener\n");
return result;
@ -520,7 +521,7 @@ NS_IMETHODIMP mozXMLTerminal::Activate(void)
// Register the drag listener with the DOM event receiver
result = eventReceiver->AddEventListenerByIID(mDragListener,
nsIDOMDragListener::GetIID());
NS_GET_IID(nsIDOMDragListener));
if (NS_FAILED(result)) {
XMLT_WARNING("mozXMLTerminal::Activate: Warning - Failed to register drag listener\n");
return result;
@ -593,7 +594,7 @@ NS_IMETHODIMP mozXMLTerminal::Paste()
// Generic transferable for getting clipboard data
nsCOMPtr<nsITransferable> trans;
result = nsComponentManager::CreateInstance(kCTransferableCID, nsnull,
nsITransferable::GetIID(),
NS_GET_IID(nsITransferable),
(void**) getter_AddRefs(trans));
if (NS_FAILED(result) || !trans)
@ -705,7 +706,7 @@ NS_IMETHODIMP mozXMLTerminal::GetDocument(nsIDOMDocument** aDoc)
NS_PRECONDITION(mDOMDocument, "bad state, null mDOMDocument");
if (!mDOMDocument)
return NS_ERROR_NOT_INITIALIZED;
return mDOMDocument->QueryInterface(nsIDOMDocument::GetIID(),
return mDOMDocument->QueryInterface(NS_GET_IID(nsIDOMDocument),
(void **)aDoc);
}
@ -735,7 +736,7 @@ NS_IMETHODIMP mozXMLTerminal::GetPresShell(nsIPresShell** aPresShell)
NS_PRECONDITION(mPresShell, "bad state, null mPresShell");
if (!mPresShell)
return NS_ERROR_NOT_INITIALIZED;
return mPresShell->QueryInterface(nsIPresShell::GetIID(),
return mPresShell->QueryInterface(NS_GET_IID(nsIPresShell),
(void **)aPresShell);
}

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

@ -16,6 +16,7 @@
* Copyright (C) 1999 Ramalingam Saravanan. All Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
// mozSimpleContainer.cpp: Implements mozISimpleContainer
@ -125,10 +126,10 @@ mozSimpleContainer::QueryInterface(REFNSIID aIID,void** aInstancePtr)
*aInstancePtr = NS_STATIC_CAST(nsISupports*,
NS_STATIC_CAST(mozISimpleContainer*,this));
} else if ( aIID.Equals(mozISimpleContainer::GetIID()) ) {
} else if ( aIID.Equals(NS_GET_IID(mozISimpleContainer)) ) {
*aInstancePtr = NS_STATIC_CAST(mozISimpleContainer*,this);
} else if ( aIID.Equals(nsIWebShellContainer::GetIID()) ) {
} else if ( aIID.Equals(NS_GET_IID(nsIWebShellContainer)) ) {
*aInstancePtr = NS_STATIC_CAST(nsIWebShellContainer*,this);
} else {

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include <math.h>
@ -257,7 +258,7 @@ NS_IMETHODIMP nsDeviceContextBeOS::GetDeviceContextFor(nsIDeviceContextSpec *aDe
rv = nsComponentManager::CreateInstance(kCDeviceContextPS,
nsnull,
nsIDeviceContextPS::GetIID(),
NS_GET_IID(nsIDeviceContextPS),
(void **)&dcps);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't create PS Device context");
@ -266,7 +267,7 @@ NS_IMETHODIMP nsDeviceContextBeOS::GetDeviceContextFor(nsIDeviceContextSpec *aDe
dcps->InitDeviceContextPS((nsIDeviceContext*)aContext,
(nsIDeviceContext*)this);
rv = dcps->QueryInterface(nsIDeviceContext::GetIID(),
rv = dcps->QueryInterface(NS_GET_IID(nsIDeviceContext),
(void **)&aContext);
NS_RELEASE(dcps);

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "xp_core.h"
@ -2460,7 +2461,7 @@ nsFontEnumeratorGTK::nsFontEnumeratorGTK()
}
NS_IMPL_ISUPPORTS(nsFontEnumeratorGTK,
nsCOMTypeInfo<nsIFontEnumerator>::GetIID());
NS_GET_IID(nsIFontEnumerator));
static int gInitializedFontEnumerator = 0;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsDeviceContextMac.h"
@ -695,7 +696,7 @@ nsFontEnumeratorMac::nsFontEnumeratorMac()
}
NS_IMPL_ISUPPORTS(nsFontEnumeratorMac,
nsCOMTypeInfo<nsIFontEnumerator>::GetIID());
NS_GET_IID(nsIFontEnumerator));
typedef struct EnumerateFamilyInfo
{
PRUnichar** mArray;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
@ -141,7 +142,7 @@ nsRenderingContextMac::~nsRenderingContextMac()
}
NS_IMPL_QUERY_INTERFACE(nsRenderingContextMac, nsIRenderingContext::GetIID());
NS_IMPL_QUERY_INTERFACE(nsRenderingContextMac, NS_GET_IID(nsIRenderingContext));
NS_IMPL_ADDREF(nsRenderingContextMac);
NS_IMPL_RELEASE(nsRenderingContextMac);

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "libimg.h"
@ -191,7 +192,7 @@ ImageNetContextSyncImpl::GetURL(ilIURL* aURL,
nsIURI *uri = nsnull;
nsresult rv;
rv = url->QueryInterface(nsIURI::GetIID(), (void**)&uri);
rv = url->QueryInterface(NS_GET_IID(nsIURI), (void**)&uri);
if (NS_FAILED(rv)) return -1;
// XXX NECKO what verb? what event sink getter

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

@ -16,6 +16,7 @@
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*
*/
@ -38,7 +39,7 @@ nsDeviceContextSpecFactoryOS2::nsDeviceContextSpecFactoryOS2()
NS_INIT_REFCNT();
}
NS_IMPL_ISUPPORTS(nsDeviceContextSpecFactoryOS2, nsIDeviceContextSpecFactory::GetIID())
NS_IMPL_ISUPPORTS(nsDeviceContextSpecFactoryOS2, NS_GET_IID(nsIDeviceContextSpecFactory))
NS_IMETHODIMP nsDeviceContextSpecFactoryOS2::Init()
{

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

@ -16,6 +16,7 @@
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*
*/
@ -36,7 +37,7 @@ nsDeviceContextSpecOS2::~nsDeviceContextSpecOS2()
PrnClosePrinter( mQueue);
}
NS_IMPL_ISUPPORTS(nsDeviceContextSpecOS2, nsIDeviceContextSpec::GetIID())
NS_IMPL_ISUPPORTS(nsDeviceContextSpecOS2, NS_GET_IID(nsIDeviceContextSpec))
nsresult nsDeviceContextSpecOS2::Init( PRTQUEUE *pq)
{

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

@ -16,6 +16,7 @@
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*
*/
@ -28,7 +29,7 @@
// Base class -- fonts, palette and xpcom -----------------------------------
NS_IMPL_ISUPPORTS(nsDrawingSurfaceOS2,nsIDrawingSurface::GetIID())
NS_IMPL_ISUPPORTS(nsDrawingSurfaceOS2, NS_GET_IID(nsIDrawingSurface))
// We start allocated lCIDs at 2. This leaves #1 for nsFontMetricsOS2 to
// do testing with, and 0 is, of course, LCID_DEFAULT.

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

@ -16,7 +16,7 @@
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
*
* Contributor(s):
*
* Pierre Phaneuf <pp@ludusdesign.com>
*/
// ToDo: Unicode, encoding.
@ -58,7 +58,7 @@ nsFontMetricsOS2::~nsFontMetricsOS2()
delete mFontHandle;
}
NS_IMPL_ISUPPORTS( nsFontMetricsOS2, nsIFontMetrics::GetIID())
NS_IMPL_ISUPPORTS( nsFontMetricsOS2, NS_GET_IID(nsIFontMetrics))
nsresult nsFontMetricsOS2::Init( const nsFont &aFont, nsIDeviceContext *aContext)
{

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

@ -16,7 +16,7 @@
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
*
* Contributor(s):
*
* Pierre Phaneuf <pp@ludusdesign.com>
*/
// ToDo: nowt (except get rid of unicode hack)
@ -79,7 +79,7 @@ nsGfxFactoryOS2::~nsGfxFactoryOS2()
{
}
NS_IMPL_ISUPPORTS(nsGfxFactoryOS2,nsIFactory::GetIID())
NS_IMPL_ISUPPORTS(nsGfxFactoryOS2,NS_GET_IID(nsIFactory))
nsresult nsGfxFactoryOS2::CreateInstance( nsISupports *aOuter,
const nsIID &aIID,
@ -144,7 +144,7 @@ extern "C" NS_GFXNONXP nsresult NSGetFactory(nsISupports* servMgr,
if( !*aFactory)
return NS_ERROR_OUT_OF_MEMORY;
return (*aFactory)->QueryInterface( nsIFactory::GetIID(), (void**) aFactory);
return (*aFactory)->QueryInterface( NS_GET_IID(nsIFactory), (void**) aFactory);
}
// Module-level data ---------------------------------------------------------

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

@ -16,7 +16,7 @@
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
*
* Contributor(s):
*
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsGfxDefs.h"
@ -26,7 +26,7 @@
#include "nsIDeviceContext.h"
#include "nsRenderingContextOS2.h"
NS_IMPL_ISUPPORTS(nsImageOS2,nsIImage::GetIID());
NS_IMPL_ISUPPORTS(nsImageOS2, NS_GET_IID(nsIImage));
//------------------------------------------------------------
nsImageOS2::nsImageOS2()

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

@ -16,7 +16,7 @@
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
*
* Contributor(s):
*
* Pierre Phaneuf <pp@ludusdesign.com>
*/
// ToDo: nothing
@ -62,7 +62,7 @@ nsRegionOS2::~nsRegionOS2()
PMERROR( "GpiDestroyRegion (nsR)");
}
NS_IMPL_ISUPPORTS(nsRegionOS2, nsIRegion::GetIID())
NS_IMPL_ISUPPORTS(nsRegionOS2, NS_GET_IID(nsIRegion))
// Create empty region
nsresult nsRegionOS2::Init()

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

@ -16,7 +16,7 @@
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
*
* Contributor(s):
*
* Pierre Phaneuf <pp@ludusdesign.com>
*/
//#define PROFILE_GSTATE // be noisy about graphicsstate-usage
@ -180,7 +180,7 @@ nsRenderingContextOS2::QueryInterface( REFNSIID aIID, void **aInstancePtr)
if( !aInstancePtr)
return NS_ERROR_NULL_POINTER;
if( aIID.Equals( nsIRenderingContext::GetIID()))
if( aIID.Equals( NS_GET_IID(nsIRenderingContext)))
*aInstancePtr = (void *) (nsIRenderingContext*) this;
else if( aIID.Equals( ((nsISupports*)(nsIRenderingContext*)this)->GetIID()))
*aInstancePtr = (void *) (nsISupports*)(nsIRenderingContext*)this;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsIPref.h"
@ -1580,7 +1581,7 @@ nsFontMetricsWin::FindGenericFont(HDC aDC, PRUnichar aChar)
{
if (!gPref) {
nsServiceManager::GetService(kPrefCID,
nsCOMTypeInfo<nsIPref>::GetIID(), (nsISupports**) &gPref);
NS_GET_IID(nsIPref), (nsISupports**) &gPref);
if (!gPref) {
return nsnull;
}
@ -3178,7 +3179,7 @@ nsFontEnumeratorWin::nsFontEnumeratorWin()
}
NS_IMPL_ISUPPORTS(nsFontEnumeratorWin,
nsCOMTypeInfo<nsIFontEnumerator>::GetIID());
NS_GET_IID(nsIFontEnumerator));
static int gInitializedFontEnumerator = 0;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsRenderingContextXlib.h"
@ -392,7 +393,7 @@ NS_IMETHODIMP nsDeviceContextXlib::GetDeviceContextFor(nsIDeviceContextSpec *aDe
rv = nsComponentManager::CreateInstance(kCDeviceContextPS,
nsnull,
nsIDeviceContextPS::GetIID(),
NS_GET_IID(nsIDeviceContextPS),
(void **)&dcps);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't create PS Device context");
@ -401,7 +402,7 @@ NS_IMETHODIMP nsDeviceContextXlib::GetDeviceContextFor(nsIDeviceContextSpec *aDe
dcps->InitDeviceContextPS((nsIDeviceContext*)aContext,
(nsIDeviceContext*)this);
rv = dcps->QueryInterface(nsIDeviceContext::GetIID(),
rv = dcps->QueryInterface(NS_GET_IID(nsIDeviceContext),
(void **)&aContext);
NS_RELEASE(dcps);

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsIRobotSink.h"
#include "nsIRobotSinkObserver.h"
@ -286,7 +287,7 @@ extern "C" NS_EXPORT int DebugRobot(
nsCRT::free(uriStr);
if (NS_FAILED(rv)) return rv;
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
rv = uri->QueryInterface(NS_GET_IID(nsIURI), (void**)&url);
NS_RELEASE(uri);
if (NS_OK != rv) {
printf("invalid URL: '");

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsIRobotSink.h"
#include "nsIRobotSinkObserver.h"
@ -344,7 +345,7 @@ void RobotSink::ProcessLink(const nsString& aLink)
nsIURI *uri = nsnull, *baseUri = nsnull;
rv = mDocumentURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
rv = mDocumentURL->QueryInterface(NS_GET_IID(nsIURI), (void**)&baseUri);
if (NS_FAILED(rv)) return;
char *uriStr = aLink.ToNewCString();
@ -354,7 +355,7 @@ void RobotSink::ProcessLink(const nsString& aLink)
NS_RELEASE(baseUri);
if (NS_FAILED(rv)) return;
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&absurl);
rv = uri->QueryInterface(NS_GET_IID(nsIURI), (void**)&absurl);
NS_RELEASE(uri);
if (NS_OK == rv) {

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
@ -868,7 +869,7 @@ void CObserverService::UnregisterObservers() {
void CObserverService::RegisterObservers(nsString& aTopic) {
nsresult result = NS_OK;
nsIObserverService* theObserverService = nsnull;
result = nsServiceManager::GetService(NS_OBSERVERSERVICE_PROGID, nsIObserverService::GetIID(),
result = nsServiceManager::GetService(NS_OBSERVERSERVICE_PROGID, NS_GET_IID(nsIObserverService),
(nsISupports**) &theObserverService, nsnull);
if(result == NS_OK){
nsIEnumerator* theEnum = nsnull;
@ -881,7 +882,7 @@ void CObserverService::RegisterObservers(nsString& aTopic) {
for (theEnum->First(); theEnum->IsDone() != NS_OK; theEnum->Next()) {
result = theEnum->CurrentItem(&inst);
if (NS_SUCCEEDED(result)) {
result = inst->QueryInterface(nsIElementObserver::GetIID(), (void**)&theElementObserver);
result = inst->QueryInterface(NS_GET_IID(nsIElementObserver), (void**)&theElementObserver);
NS_RELEASE(inst);
}
if (result == NS_OK) {

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
/**
@ -353,7 +354,7 @@ nsHTMLContentSinkStream::InitEncoder()
}
res = nsComponentManager::CreateInstance(kSaveAsCharsetCID, NULL,
nsISaveAsCharset::GetIID(),
NS_GET_IID(nsISaveAsCharset),
getter_AddRefs(mUnicodeEncoder));
if (NS_FAILED(res))
return res;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
/**
@ -197,7 +198,7 @@ NS_New_HTML_ContentSinkStream(nsIHTMLContentSink** aInstancePtrResult,
rv = nsComponentManager::CreateInstance(nsIHTMLContentSinkStream::GetCID(),
nsnull,
nsIHTMLContentSinkStream::GetIID(),
NS_GET_IID(nsIHTMLContentSinkStream),
getter_AddRefs(it));
if (NS_SUCCEEDED(rv)) {
rv = it->Initialize(aOutStream,
@ -206,7 +207,7 @@ NS_New_HTML_ContentSinkStream(nsIHTMLContentSink** aInstancePtrResult,
aFlags);
if (NS_SUCCEEDED(rv)) {
rv = it->QueryInterface(nsIHTMLContentSink::GetIID(),
rv = it->QueryInterface(NS_GET_IID(nsIHTMLContentSink),
(void**)aInstancePtrResult);
}
}
@ -223,7 +224,7 @@ NS_New_HTML_ContentSinkStream(nsIHTMLContentSink** aInstancePtrResult,
rv = nsComponentManager::CreateInstance(nsIHTMLContentSinkStream::GetCID(),
nsnull,
nsIHTMLContentSinkStream::GetIID(),
NS_GET_IID(nsIHTMLContentSinkStream),
getter_AddRefs(it));
if (NS_SUCCEEDED(rv)) {
rv = it->Initialize(nsnull,
@ -232,7 +233,7 @@ NS_New_HTML_ContentSinkStream(nsIHTMLContentSink** aInstancePtrResult,
aFlags);
if (NS_SUCCEEDED(rv)) {
rv = it->QueryInterface(nsIHTMLContentSink::GetIID(),
rv = it->QueryInterface(NS_GET_IID(nsIHTMLContentSink),
(void**)aInstancePtrResult);
}
}

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

@ -22,6 +22,7 @@
* Akkana Peck <akkana@netscape.com>
* Daniel Brattell <bratell@lysator.liu.se>
* Ben Bucksch <mozilla@bucksch.org>
* Pierre Phaneuf <pp@ludusdesign.com>
*/
/**
@ -96,7 +97,7 @@ nsresult nsHTMLToTXTSinkStream::InitEncoder(const nsString& aCharset)
nsICharsetConverterManager * ccm = nsnull;
res = nsServiceManager::GetService(kCharsetConverterManagerCID,
nsCOMTypeInfo<nsICharsetConverterManager>::GetIID(),
NS_GET_IID(nsICharsetConverterManager),
(nsISupports**)&ccm);
if(NS_SUCCEEDED(res) && (nsnull != ccm))
{

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#define DEBUG_XMLENCODING
@ -257,13 +258,13 @@ nsresult nsParser::QueryInterface(const nsIID& aIID, void** aInstancePtr)
else if(aIID.Equals(kIParserIID)) { //do IParser base class...
*aInstancePtr = (nsIParser*)(this);
}
else if(aIID.Equals(nsIProgressEventSink::GetIID())) {
else if(aIID.Equals(NS_GET_IID(nsIProgressEventSink))) {
*aInstancePtr = (nsIStreamListener*)(this);
}
else if(aIID.Equals(nsIStreamObserver::GetIID())) {
else if(aIID.Equals(NS_GET_IID(nsIStreamObserver))) {
*aInstancePtr = (nsIStreamObserver*)(this);
}
else if(aIID.Equals(nsIStreamListener::GetIID())) {
else if(aIID.Equals(NS_GET_IID(nsIStreamListener))) {
*aInstancePtr = (nsIStreamListener*)(this);
}
else if(aIID.Equals(kClassIID)) { //do this class...

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsCOMPtr.h"
#include "nsIGenericFactory.h"
@ -364,7 +365,7 @@ extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
}
// Increase refcnt and store away nsIModule interface to m in return_cobj
rv = m->QueryInterface(nsIModule::GetIID(), (void**)return_cobj);
rv = m->QueryInterface(NS_GET_IID(nsIModule), (void**)return_cobj);
if (NS_FAILED(rv)) {
delete m;
m = nsnull;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#define NS_IMPL_IDS
@ -95,7 +96,7 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *
nsIComponentManager* compMgr;
rv = servMgr->GetService(kComponentManagerCID,
nsIComponentManager::GetIID(),
NS_GET_IID(nsIComponentManager),
(nsISupports**)&compMgr);
if (NS_FAILED(rv)) return rv;
@ -136,7 +137,7 @@ extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char
nsIComponentManager* compMgr;
rv = servMgr->GetService(kComponentManagerCID,
nsIComponentManager::GetIID(),
NS_GET_IID(nsIComponentManager),
(nsISupports**)&compMgr);
if (NS_FAILED(rv)) return rv;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
@ -216,7 +217,7 @@ private:
char mLanguage[32];
};
NS_IMPL_ISUPPORTS(nsClassicDetector, nsICharsetDetector::GetIID());
NS_IMPL_ISUPPORTS(nsClassicDetector, NS_GET_IID(nsICharsetDetector));
//----------------------------------------------------------
nsClassicDetector::nsClassicDetector(const char* language)
@ -290,7 +291,7 @@ protected:
char mLanguage[32];
};
NS_IMPL_ISUPPORTS(nsClassicStringDetector, nsIStringCharsetDetector::GetIID());
NS_IMPL_ISUPPORTS(nsClassicStringDetector, NS_GET_IID(nsIStringCharsetDetector));
//----------------------------------------------------------
nsClassicStringDetector::nsClassicStringDetector(const char* language)

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#define NS_IMPL_IDS
#include "nsICharsetAlias.h"
@ -315,7 +316,7 @@ nsCharDetModule::RegisterSelf(nsIComponentManager *aCompMgr,
nsRegistryKey key;
nsIRegistry* registry;
rv = nsServiceManager::GetService(NS_REGISTRY_PROGID,
nsIRegistry::GetIID(),
NS_GET_IID(nsIRegistry),
(nsISupports**)&registry);
if (NS_FAILED(rv)) {
return rv;
@ -446,7 +447,7 @@ extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
}
// Increase refcnt and store away nsIModule interface to m in return_cobj
rv = m->QueryInterface(nsIModule::GetIID(), (void**)return_cobj);
rv = m->QueryInterface(NS_GET_IID(nsIModule), (void**)return_cobj);
if (NS_FAILED(rv)) {
delete m;
m = nsnull;

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nscore.h"
#include "nsCyrillicProb.h"
@ -52,7 +53,7 @@ NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr) \
NS_ADDREF_THIS(); \
return NS_OK; \
} \
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) { \
if (aIID.Equals(NS_GET_IID(nsISupports))) { \
*aInstancePtr = (void*) ((nsISupports*)this); \
NS_ADDREF_THIS(); \
return NS_OK; \
@ -172,7 +173,7 @@ nsCyrXPCOMDetector::~nsCyrXPCOMDetector()
PR_AtomicDecrement(&g_InstanceCount);
}
//---------------------------------------------------------------------
MY_NS_IMPL_ISUPPORTS(nsCyrXPCOMDetector, nsICharsetDetector::GetIID(), nsICharsetDetector)
MY_NS_IMPL_ISUPPORTS(nsCyrXPCOMDetector, NS_GET_IID(nsICharsetDetector), nsICharsetDetector)
//---------------------------------------------------------------------
NS_IMETHODIMP nsCyrXPCOMDetector::Init(
nsICharsetDetectionObserver* aObserver)
@ -248,7 +249,7 @@ nsCyrXPCOMStringDetector::~nsCyrXPCOMStringDetector()
}
//---------------------------------------------------------------------
MY_NS_IMPL_ISUPPORTS(nsCyrXPCOMStringDetector,
nsIStringCharsetDetector::GetIID(), nsIStringCharsetDetector)
NS_GET_IID(nsIStringCharsetDetector), nsIStringCharsetDetector)
//---------------------------------------------------------------------
void nsCyrXPCOMStringDetector::Report(const char *aCharset)
{

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsDebugDetector.h"
@ -128,7 +129,7 @@ void nsDebugDetector::Report()
}
NS_IMPL_ISUPPORTS(nsDebugDetector, nsICharsetDetector::GetIID());
NS_IMPL_ISUPPORTS(nsDebugDetector, NS_GET_IID(nsICharsetDetector));
//--------------------------------------------------------------
class nsDebugDetectorFactory : public nsIFactory {

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#define IMPL_NS_IPARSERFILTER
@ -97,7 +98,7 @@ NS_IMETHODIMP nsMyObserver::Init( nsIWebShellServices* aWebShellSvc,
return NS_ERROR_ILLEGAL_VALUE;
}
//--------------------------------------------------------------
NS_IMPL_ISUPPORTS ( nsMyObserver ,nsICharsetDetectionObserver::GetIID());
NS_IMPL_ISUPPORTS ( nsMyObserver ,NS_GET_IID(nsICharsetDetectionObserver));
//--------------------------------------------------------------
class nsDetectionAdaptor :
@ -156,7 +157,7 @@ NS_IMETHODIMP nsDetectionAdaptor::QueryInterface(REFNSIID aIID, void**aInstanceP
}
*aInstancePtr = NULL;
if( aIID.Equals ( nsICharsetDetectionAdaptor::GetIID() )) {
if( aIID.Equals ( NS_GET_IID(nsICharsetDetectionAdaptor) )) {
*aInstancePtr = (void*) ((nsICharsetDetectionAdaptor*) this);
NS_ADDREF_THIS();
return NS_OK;
@ -190,7 +191,7 @@ NS_IMETHODIMP nsDetectionAdaptor::Init(
if(nsnull == mobs)
return NS_ERROR_OUT_OF_MEMORY;
rv = mobs->QueryInterface(nsICharsetDetectionObserver::GetIID(),
rv = mobs->QueryInterface(NS_GET_IID(nsICharsetDetectionObserver),
(void**) &aObserver);
if(NS_SUCCEEDED(rv)) {

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

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
@ -60,7 +61,7 @@ NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr) \
NS_ADDREF_THIS(); \
return NS_OK; \
} \
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) { \
if (aIID.Equals(NS_GET_IID(nsISupports))) { \
*aInstancePtr = (void*) ((nsISupports*)this); \
NS_ADDREF_THIS(); \
return NS_OK; \
@ -350,7 +351,7 @@ nsXPCOMDetector::~nsXPCOMDetector()
PR_AtomicDecrement(&g_InstanceCount);
}
//----------------------------------------------------------
MY_NS_IMPL_ISUPPORTS(nsXPCOMDetector,nsICharsetDetector::GetIID(), nsICharsetDetector)
MY_NS_IMPL_ISUPPORTS(nsXPCOMDetector,NS_GET_IID(nsICharsetDetector), nsICharsetDetector)
//----------------------------------------------------------
NS_IMETHODIMP nsXPCOMDetector::Init(
nsICharsetDetectionObserver* aObserver)
@ -417,7 +418,7 @@ nsXPCOMStringDetector::~nsXPCOMStringDetector()
PR_AtomicDecrement(&g_InstanceCount);
}
//----------------------------------------------------------
MY_NS_IMPL_ISUPPORTS(nsXPCOMStringDetector,nsIStringCharsetDetector::GetIID(), nsIStringCharsetDetector)
MY_NS_IMPL_ISUPPORTS(nsXPCOMStringDetector,NS_GET_IID(nsIStringCharsetDetector), nsIStringCharsetDetector)
//----------------------------------------------------------
void nsXPCOMStringDetector::Report(const char* charset)
{

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше