Solaris: adding do_QueryInterface() wrappers to finish scc's nsCOMPtr carpool. a=scc

This commit is contained in:
mcafee%netscape.com 1999-02-19 11:30:31 +00:00
Родитель 09acdba146
Коммит 6fad4bf023
25 изменённых файлов: 57 добавлений и 56 удалений

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

@ -33,8 +33,8 @@ nsresult ChangeAttributeTxn::Init(nsIEditor *aEditor,
{
if (nsnull!=aEditor && nsnull!=aElement)
{
mEditor = aEditor;
mElement = aElement;
mEditor = do_QueryInterface(aEditor);
mElement = do_QueryInterface(aElement);
mAttribute = aAttribute;
mValue = aValue;
mRemoveAttribute = aRemoveAttribute;

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

@ -31,12 +31,12 @@ nsresult CreateElementTxn::Init(nsIDOMDocument *aDoc,
{
if ((nsnull!=aDoc) && (nsnull!=aParent))
{
mDoc = aDoc;
mDoc = do_QueryInterface(aDoc);
mTag = aTag;
mParent = aParent;
mParent = do_QueryInterface(aParent);
mOffsetInParent = aOffsetInParent;
mNewNode = nsnull;
mRefNode = nsnull;
mNewNode = do_QueryInterface(nsnull);
mRefNode = do_QueryInterface(nsnull);
#ifdef NS_DEBUG
{
nsCOMPtr<nsIDOMNodeList> testChildNodes;

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

@ -36,7 +36,7 @@ DeleteElementTxn::DeleteElementTxn()
nsresult DeleteElementTxn::Init(nsIDOMNode *aElement)
{
if (nsnull!=aElement) {
mElement = aElement;
mElement = do_QueryInterface(aElement);
}
else
return NS_ERROR_NULL_POINTER;

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

@ -49,7 +49,7 @@ nsresult DeleteRangeTxn::Init(nsIEditor *aEditor, nsIDOMRange *aRange)
{
if (aEditor && aRange)
{
mEditor = aEditor;
mEditor = do_QueryInterface(aEditor);
nsresult result = aRange->GetStartParent(getter_AddRefs(mStartParent));
NS_ASSERTION((NS_SUCCEEDED(result)), "GetStartParent failed.");
result = aRange->GetEndParent(getter_AddRefs(mEndParent));
@ -372,7 +372,7 @@ nsresult DeleteRangeTxn::CreateTxnsToDeleteNodesBetween(nsIDOMNode *aCommonParen
// Walk up the parent list of aFirstChild to aCommonParent,
// deleting all siblings to the right of the ancestors of aFirstChild.
BuildAncestorList(aLastChild, ancestorList);
child = aFirstChild;
child = do_QueryInterface(aFirstChild);
result = child->GetParentNode(getter_AddRefs(parent));
while ((NS_SUCCEEDED(result)) && parent)
{
@ -442,7 +442,7 @@ nsresult DeleteRangeTxn::CreateTxnsToDeleteNodesBetween(nsIDOMNode *aCommonParen
BuildAncestorList(aFirstChild, ancestorList);
if (PR_TRUE==needToProcessLastChild)
{
child = aLastChild;
child = do_QueryInterface(aLastChild);
result = child->GetParentNode(getter_AddRefs(parent));
while ((NS_SUCCEEDED(result)) && parent)
{
@ -511,7 +511,7 @@ nsresult DeleteRangeTxn::BuildAncestorList(nsIDOMNode *aNode, nsISupportsArray *
{
aList->Clear();
nsCOMPtr<nsIDOMNode> parent;
nsCOMPtr<nsIDOMNode> child(aNode);
nsCOMPtr<nsIDOMNode> child(do_QueryInterface(aNode));
result = child->GetParentNode(getter_AddRefs(parent));
while ((NS_SUCCEEDED(result)) && child && parent)
{

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

@ -29,7 +29,7 @@ nsresult DeleteTextTxn::Init(nsIDOMCharacterData *aElement,
PRUint32 aOffset,
PRUint32 aNumCharsToDelete)
{
mElement = aElement;
mElement = do_QueryInterface(aElement);
mOffset = aOffset;
mNumCharsToDelete = aNumCharsToDelete;
mDeletedText = "";

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

@ -152,7 +152,7 @@ nsresult EditAggregateTxn::AppendChild(EditTxn *aTxn)
nsresult EditAggregateTxn::SetName(nsIAtom *aName)
{
mName = aName;
mName = do_QueryInterface(aName);
return NS_OK;
}

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

@ -45,7 +45,7 @@ nsresult InsertTextTxn::Init(nsIDOMCharacterData *aElement,
const nsString& aStringToInsert,
nsIPresShell* aPresShell)
{
mElement = aElement;
mElement = do_QueryInterface(aElement);
mOffset = aOffset;
mStringToInsert = aStringToInsert;
mPresShell = aPresShell;

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

@ -32,9 +32,9 @@ nsresult JoinElementTxn::Init(nsIEditor *aEditor,
nsIDOMNode *aLeftNode,
nsIDOMNode *aRightNode)
{
mEditor = aEditor;
mLeftNode = aLeftNode;
mRightNode = aRightNode;
mEditor = do_QueryInterface(aEditor);
mLeftNode = do_QueryInterface(aLeftNode);
mRightNode = do_QueryInterface(aRightNode);
mOffset=0;
return NS_OK;
}

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

@ -33,8 +33,8 @@ nsresult SplitElementTxn::Init(nsIEditor *aEditor,
nsIDOMNode *aNode,
PRInt32 aOffset)
{
mEditor = aEditor;
mExistingRightNode = aNode;
mEditor = do_QueryInterface(aEditor);
mExistingRightNode = do_QueryInterface(aNode);
mOffset = aOffset;
return NS_OK;
}

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

@ -39,7 +39,7 @@ GetEditFactory(nsIFactory **aFactory, const nsCID & aClass)
if (!g_pNSIFactory)
{
nsEditFactory *factory = new nsEditFactory(aClass);
g_pNSIFactory = factory;
g_pNSIFactory = do_QueryInterface(factory);
if (factory)
result = NS_OK;
}

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

@ -1169,7 +1169,7 @@ nsEditor::GetPriorNode(nsIDOMNode *aCurrentNode, nsIDOMNode **aResultNode)
// otherwise, walk up the parent change until there is a child that comes before
// the ancestor of aCurrentNode. Then return that node's rightmost child
nsCOMPtr<nsIDOMNode> parent(aCurrentNode);
nsCOMPtr<nsIDOMNode> parent(do_QueryInterface(aCurrentNode));
do {
nsCOMPtr<nsIDOMNode> node(parent);
result = node->GetParentNode(getter_AddRefs(parent));
@ -1200,7 +1200,7 @@ nsEditor::GetNextNode(nsIDOMNode *aCurrentNode, nsIDOMNode **aResultNode)
// otherwise, walk up the parent change until there is a child that comes before
// the ancestor of aCurrentNode. Then return that node's rightmost child
nsCOMPtr<nsIDOMNode> parent(aCurrentNode);
nsCOMPtr<nsIDOMNode> parent(do_QueryInterface(aCurrentNode));
do {
nsCOMPtr<nsIDOMNode> node(parent);
result = node->GetParentNode(getter_AddRefs(parent));
@ -1221,7 +1221,7 @@ nsresult
nsEditor::GetRightmostChild(nsIDOMNode *aCurrentNode, nsIDOMNode **aResultNode)
{
nsresult result = NS_OK;
nsCOMPtr<nsIDOMNode> resultNode(aCurrentNode);
nsCOMPtr<nsIDOMNode> resultNode(do_QueryInterface(aCurrentNode));
PRBool hasChildren;
resultNode->HasChildNodes(&hasChildren);
while ((NS_SUCCEEDED(result)) && (PR_TRUE==hasChildren))
@ -1242,7 +1242,7 @@ nsresult
nsEditor::GetLeftmostChild(nsIDOMNode *aCurrentNode, nsIDOMNode **aResultNode)
{
nsresult result = NS_OK;
nsCOMPtr<nsIDOMNode> resultNode(aCurrentNode);
nsCOMPtr<nsIDOMNode> resultNode(do_QueryInterface(aCurrentNode));
PRBool hasChildren;
resultNode->HasChildNodes(&hasChildren);
while ((NS_SUCCEEDED(result)) && (PR_TRUE==hasChildren))

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

@ -41,7 +41,7 @@ public:
/** SetEditor gives an address to the editor that will be accessed
* @param aEditor the editor this listener calls for editing operations
*/
void SetEditor(nsITextEditor *aEditor){mEditor = aEditor;}
void SetEditor(nsITextEditor *aEditor){mEditor = do_QueryInterface(aEditor);}
/*interfaces for addref and release and queryinterface*/
NS_DECL_ISUPPORTS
@ -79,7 +79,7 @@ public:
/** SetEditor gives an address to the editor that will be accessed
* @param aEditor the editor this listener calls for editing operations
*/
void SetEditor(nsITextEditor *aEditor){mEditor = aEditor;}
void SetEditor(nsITextEditor *aEditor){mEditor = do_QueryInterface(aEditor);}
/*interfaces for addref and release and queryinterface*/
NS_DECL_ISUPPORTS

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

@ -39,7 +39,7 @@ GetTextEditFactory(nsIFactory **aFactory, const nsCID & aClass)
if (!g_pNSIFactory)
{
nsTextEditFactory *factory = new nsTextEditFactory(aClass);
g_pNSIFactory = factory;
g_pNSIFactory = do_QueryInterface(factory);
if (factory)
result = NS_OK;
}

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

@ -90,7 +90,7 @@ nsresult nsTextEditor::InitTextEditor(nsIDOMDocument *aDoc,
if (NS_FAILED(result) || !editor) {
return NS_ERROR_OUT_OF_MEMORY;
}
mEditor = editor; // CreateInstance did our addRef
mEditor = do_QueryInterface(editor); // CreateInstance did our addRef
mEditor->Init(aDoc, aPresShell);
mEditor->EnableUndo(PR_TRUE);
@ -101,15 +101,16 @@ nsresult nsTextEditor::InitTextEditor(nsIDOMDocument *aDoc,
}
result = NS_NewEditorMouseListener(getter_AddRefs(mMouseListenerP), this);
if (NS_OK != result) {
mKeyListenerP = 0; // drop the key listener if we couldn't get a mouse listener
// drop the key listener if we couldn't get a mouse listener.
mKeyListenerP = do_QueryInterface(0);
return result;
}
nsCOMPtr<nsIDOMEventReceiver> erP;
result = aDoc->QueryInterface(kIDOMEventReceiverIID, getter_AddRefs(erP));
if (NS_OK != result)
{
mKeyListenerP = 0;
mMouseListenerP = 0; //dont need these if we cant register them
mKeyListenerP = do_QueryInterface(0);
mMouseListenerP = do_QueryInterface(0); //dont need these if we cant register them
return result;
}
erP->AddEventListener(mKeyListenerP, kIDOMKeyListenerIID);

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

@ -33,8 +33,8 @@ nsresult ChangeAttributeTxn::Init(nsIEditor *aEditor,
{
if (nsnull!=aEditor && nsnull!=aElement)
{
mEditor = aEditor;
mElement = aElement;
mEditor = do_QueryInterface(aEditor);
mElement = do_QueryInterface(aElement);
mAttribute = aAttribute;
mValue = aValue;
mRemoveAttribute = aRemoveAttribute;

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

@ -31,12 +31,12 @@ nsresult CreateElementTxn::Init(nsIDOMDocument *aDoc,
{
if ((nsnull!=aDoc) && (nsnull!=aParent))
{
mDoc = aDoc;
mDoc = do_QueryInterface(aDoc);
mTag = aTag;
mParent = aParent;
mParent = do_QueryInterface(aParent);
mOffsetInParent = aOffsetInParent;
mNewNode = nsnull;
mRefNode = nsnull;
mNewNode = do_QueryInterface(nsnull);
mRefNode = do_QueryInterface(nsnull);
#ifdef NS_DEBUG
{
nsCOMPtr<nsIDOMNodeList> testChildNodes;

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

@ -36,7 +36,7 @@ DeleteElementTxn::DeleteElementTxn()
nsresult DeleteElementTxn::Init(nsIDOMNode *aElement)
{
if (nsnull!=aElement) {
mElement = aElement;
mElement = do_QueryInterface(aElement);
}
else
return NS_ERROR_NULL_POINTER;

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

@ -49,7 +49,7 @@ nsresult DeleteRangeTxn::Init(nsIEditor *aEditor, nsIDOMRange *aRange)
{
if (aEditor && aRange)
{
mEditor = aEditor;
mEditor = do_QueryInterface(aEditor);
nsresult result = aRange->GetStartParent(getter_AddRefs(mStartParent));
NS_ASSERTION((NS_SUCCEEDED(result)), "GetStartParent failed.");
result = aRange->GetEndParent(getter_AddRefs(mEndParent));
@ -372,7 +372,7 @@ nsresult DeleteRangeTxn::CreateTxnsToDeleteNodesBetween(nsIDOMNode *aCommonParen
// Walk up the parent list of aFirstChild to aCommonParent,
// deleting all siblings to the right of the ancestors of aFirstChild.
BuildAncestorList(aLastChild, ancestorList);
child = aFirstChild;
child = do_QueryInterface(aFirstChild);
result = child->GetParentNode(getter_AddRefs(parent));
while ((NS_SUCCEEDED(result)) && parent)
{
@ -442,7 +442,7 @@ nsresult DeleteRangeTxn::CreateTxnsToDeleteNodesBetween(nsIDOMNode *aCommonParen
BuildAncestorList(aFirstChild, ancestorList);
if (PR_TRUE==needToProcessLastChild)
{
child = aLastChild;
child = do_QueryInterface(aLastChild);
result = child->GetParentNode(getter_AddRefs(parent));
while ((NS_SUCCEEDED(result)) && parent)
{
@ -511,7 +511,7 @@ nsresult DeleteRangeTxn::BuildAncestorList(nsIDOMNode *aNode, nsISupportsArray *
{
aList->Clear();
nsCOMPtr<nsIDOMNode> parent;
nsCOMPtr<nsIDOMNode> child(aNode);
nsCOMPtr<nsIDOMNode> child(do_QueryInterface(aNode));
result = child->GetParentNode(getter_AddRefs(parent));
while ((NS_SUCCEEDED(result)) && child && parent)
{

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

@ -29,7 +29,7 @@ nsresult DeleteTextTxn::Init(nsIDOMCharacterData *aElement,
PRUint32 aOffset,
PRUint32 aNumCharsToDelete)
{
mElement = aElement;
mElement = do_QueryInterface(aElement);
mOffset = aOffset;
mNumCharsToDelete = aNumCharsToDelete;
mDeletedText = "";

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

@ -152,7 +152,7 @@ nsresult EditAggregateTxn::AppendChild(EditTxn *aTxn)
nsresult EditAggregateTxn::SetName(nsIAtom *aName)
{
mName = aName;
mName = do_QueryInterface(aName);
return NS_OK;
}

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

@ -45,7 +45,7 @@ nsresult InsertTextTxn::Init(nsIDOMCharacterData *aElement,
const nsString& aStringToInsert,
nsIPresShell* aPresShell)
{
mElement = aElement;
mElement = do_QueryInterface(aElement);
mOffset = aOffset;
mStringToInsert = aStringToInsert;
mPresShell = aPresShell;

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

@ -32,9 +32,9 @@ nsresult JoinElementTxn::Init(nsIEditor *aEditor,
nsIDOMNode *aLeftNode,
nsIDOMNode *aRightNode)
{
mEditor = aEditor;
mLeftNode = aLeftNode;
mRightNode = aRightNode;
mEditor = do_QueryInterface(aEditor);
mLeftNode = do_QueryInterface(aLeftNode);
mRightNode = do_QueryInterface(aRightNode);
mOffset=0;
return NS_OK;
}

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

@ -33,8 +33,8 @@ nsresult SplitElementTxn::Init(nsIEditor *aEditor,
nsIDOMNode *aNode,
PRInt32 aOffset)
{
mEditor = aEditor;
mExistingRightNode = aNode;
mEditor = do_QueryInterface(aEditor);
mExistingRightNode = do_QueryInterface(aNode);
mOffset = aOffset;
return NS_OK;
}

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

@ -1169,7 +1169,7 @@ nsEditor::GetPriorNode(nsIDOMNode *aCurrentNode, nsIDOMNode **aResultNode)
// otherwise, walk up the parent change until there is a child that comes before
// the ancestor of aCurrentNode. Then return that node's rightmost child
nsCOMPtr<nsIDOMNode> parent(aCurrentNode);
nsCOMPtr<nsIDOMNode> parent(do_QueryInterface(aCurrentNode));
do {
nsCOMPtr<nsIDOMNode> node(parent);
result = node->GetParentNode(getter_AddRefs(parent));
@ -1200,7 +1200,7 @@ nsEditor::GetNextNode(nsIDOMNode *aCurrentNode, nsIDOMNode **aResultNode)
// otherwise, walk up the parent change until there is a child that comes before
// the ancestor of aCurrentNode. Then return that node's rightmost child
nsCOMPtr<nsIDOMNode> parent(aCurrentNode);
nsCOMPtr<nsIDOMNode> parent(do_QueryInterface(aCurrentNode));
do {
nsCOMPtr<nsIDOMNode> node(parent);
result = node->GetParentNode(getter_AddRefs(parent));
@ -1221,7 +1221,7 @@ nsresult
nsEditor::GetRightmostChild(nsIDOMNode *aCurrentNode, nsIDOMNode **aResultNode)
{
nsresult result = NS_OK;
nsCOMPtr<nsIDOMNode> resultNode(aCurrentNode);
nsCOMPtr<nsIDOMNode> resultNode(do_QueryInterface(aCurrentNode));
PRBool hasChildren;
resultNode->HasChildNodes(&hasChildren);
while ((NS_SUCCEEDED(result)) && (PR_TRUE==hasChildren))
@ -1242,7 +1242,7 @@ nsresult
nsEditor::GetLeftmostChild(nsIDOMNode *aCurrentNode, nsIDOMNode **aResultNode)
{
nsresult result = NS_OK;
nsCOMPtr<nsIDOMNode> resultNode(aCurrentNode);
nsCOMPtr<nsIDOMNode> resultNode(do_QueryInterface(aCurrentNode));
PRBool hasChildren;
resultNode->HasChildNodes(&hasChildren);
while ((NS_SUCCEEDED(result)) && (PR_TRUE==hasChildren))

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

@ -41,7 +41,7 @@ public:
/** SetEditor gives an address to the editor that will be accessed
* @param aEditor the editor this listener calls for editing operations
*/
void SetEditor(nsITextEditor *aEditor){mEditor = aEditor;}
void SetEditor(nsITextEditor *aEditor){mEditor = do_QueryInterface(aEditor);}
/*interfaces for addref and release and queryinterface*/
NS_DECL_ISUPPORTS
@ -79,7 +79,7 @@ public:
/** SetEditor gives an address to the editor that will be accessed
* @param aEditor the editor this listener calls for editing operations
*/
void SetEditor(nsITextEditor *aEditor){mEditor = aEditor;}
void SetEditor(nsITextEditor *aEditor){mEditor = do_QueryInterface(aEditor);}
/*interfaces for addref and release and queryinterface*/
NS_DECL_ISUPPORTS