From 92753a46b372d98ced7cbadb2b5739823c7a4f8b Mon Sep 17 00:00:00 2001 From: "mcafee%netscape.com" Date: Fri, 19 Feb 1999 11:30:31 +0000 Subject: [PATCH] Solaris: adding do_QueryInterface() wrappers to finish scc's nsCOMPtr carpool. a=scc git-svn-id: svn://10.0.0.236/trunk@21297 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/base/ChangeAttributeTxn.cpp | 4 ++-- mozilla/editor/base/CreateElementTxn.cpp | 8 ++++---- mozilla/editor/base/DeleteElementTxn.cpp | 2 +- mozilla/editor/base/DeleteRangeTxn.cpp | 8 ++++---- mozilla/editor/base/DeleteTextTxn.cpp | 2 +- mozilla/editor/base/EditAggregateTxn.cpp | 2 +- mozilla/editor/base/InsertTextTxn.cpp | 2 +- mozilla/editor/base/JoinElementTxn.cpp | 6 +++--- mozilla/editor/base/SplitElementTxn.cpp | 4 ++-- mozilla/editor/base/nsEditFactory.cpp | 2 +- mozilla/editor/base/nsEditor.cpp | 8 ++++---- mozilla/editor/base/nsEditorEventListeners.h | 4 ++-- mozilla/editor/base/nsTextEditFactory.cpp | 2 +- mozilla/editor/base/nsTextEditor.cpp | 9 +++++---- mozilla/editor/libeditor/base/ChangeAttributeTxn.cpp | 4 ++-- mozilla/editor/libeditor/base/CreateElementTxn.cpp | 8 ++++---- mozilla/editor/libeditor/base/DeleteElementTxn.cpp | 2 +- mozilla/editor/libeditor/base/DeleteRangeTxn.cpp | 8 ++++---- mozilla/editor/libeditor/base/DeleteTextTxn.cpp | 2 +- mozilla/editor/libeditor/base/EditAggregateTxn.cpp | 2 +- mozilla/editor/libeditor/base/InsertTextTxn.cpp | 2 +- mozilla/editor/libeditor/base/JoinElementTxn.cpp | 6 +++--- mozilla/editor/libeditor/base/SplitElementTxn.cpp | 4 ++-- mozilla/editor/libeditor/base/nsEditor.cpp | 8 ++++---- mozilla/editor/libeditor/text/nsEditorEventListeners.h | 4 ++-- 25 files changed, 57 insertions(+), 56 deletions(-) diff --git a/mozilla/editor/base/ChangeAttributeTxn.cpp b/mozilla/editor/base/ChangeAttributeTxn.cpp index 5a6cc9a4929..a9c483e2e4e 100644 --- a/mozilla/editor/base/ChangeAttributeTxn.cpp +++ b/mozilla/editor/base/ChangeAttributeTxn.cpp @@ -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; diff --git a/mozilla/editor/base/CreateElementTxn.cpp b/mozilla/editor/base/CreateElementTxn.cpp index b5abd3b00a0..3fcb1bfc673 100644 --- a/mozilla/editor/base/CreateElementTxn.cpp +++ b/mozilla/editor/base/CreateElementTxn.cpp @@ -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 testChildNodes; diff --git a/mozilla/editor/base/DeleteElementTxn.cpp b/mozilla/editor/base/DeleteElementTxn.cpp index 976e9eae8bd..79c375b65a0 100644 --- a/mozilla/editor/base/DeleteElementTxn.cpp +++ b/mozilla/editor/base/DeleteElementTxn.cpp @@ -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; diff --git a/mozilla/editor/base/DeleteRangeTxn.cpp b/mozilla/editor/base/DeleteRangeTxn.cpp index 9ca43916b83..e5a9d3c0d04 100644 --- a/mozilla/editor/base/DeleteRangeTxn.cpp +++ b/mozilla/editor/base/DeleteRangeTxn.cpp @@ -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 parent; - nsCOMPtr child(aNode); + nsCOMPtr child(do_QueryInterface(aNode)); result = child->GetParentNode(getter_AddRefs(parent)); while ((NS_SUCCEEDED(result)) && child && parent) { diff --git a/mozilla/editor/base/DeleteTextTxn.cpp b/mozilla/editor/base/DeleteTextTxn.cpp index f7c12e41cc3..cb8d91cc6ec 100644 --- a/mozilla/editor/base/DeleteTextTxn.cpp +++ b/mozilla/editor/base/DeleteTextTxn.cpp @@ -29,7 +29,7 @@ nsresult DeleteTextTxn::Init(nsIDOMCharacterData *aElement, PRUint32 aOffset, PRUint32 aNumCharsToDelete) { - mElement = aElement; + mElement = do_QueryInterface(aElement); mOffset = aOffset; mNumCharsToDelete = aNumCharsToDelete; mDeletedText = ""; diff --git a/mozilla/editor/base/EditAggregateTxn.cpp b/mozilla/editor/base/EditAggregateTxn.cpp index 03560411f8f..84b16074ea6 100644 --- a/mozilla/editor/base/EditAggregateTxn.cpp +++ b/mozilla/editor/base/EditAggregateTxn.cpp @@ -152,7 +152,7 @@ nsresult EditAggregateTxn::AppendChild(EditTxn *aTxn) nsresult EditAggregateTxn::SetName(nsIAtom *aName) { - mName = aName; + mName = do_QueryInterface(aName); return NS_OK; } diff --git a/mozilla/editor/base/InsertTextTxn.cpp b/mozilla/editor/base/InsertTextTxn.cpp index 90c46cc52e6..2a22b987e76 100644 --- a/mozilla/editor/base/InsertTextTxn.cpp +++ b/mozilla/editor/base/InsertTextTxn.cpp @@ -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; diff --git a/mozilla/editor/base/JoinElementTxn.cpp b/mozilla/editor/base/JoinElementTxn.cpp index 1d3a5f3d706..549ed3ee60b 100644 --- a/mozilla/editor/base/JoinElementTxn.cpp +++ b/mozilla/editor/base/JoinElementTxn.cpp @@ -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; } diff --git a/mozilla/editor/base/SplitElementTxn.cpp b/mozilla/editor/base/SplitElementTxn.cpp index 387d518b29d..295c76daa69 100644 --- a/mozilla/editor/base/SplitElementTxn.cpp +++ b/mozilla/editor/base/SplitElementTxn.cpp @@ -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; } diff --git a/mozilla/editor/base/nsEditFactory.cpp b/mozilla/editor/base/nsEditFactory.cpp index e838eec7a17..a98a3026284 100644 --- a/mozilla/editor/base/nsEditFactory.cpp +++ b/mozilla/editor/base/nsEditFactory.cpp @@ -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; } diff --git a/mozilla/editor/base/nsEditor.cpp b/mozilla/editor/base/nsEditor.cpp index bdaabaf1f62..e286464485f 100644 --- a/mozilla/editor/base/nsEditor.cpp +++ b/mozilla/editor/base/nsEditor.cpp @@ -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 parent(aCurrentNode); + nsCOMPtr parent(do_QueryInterface(aCurrentNode)); do { nsCOMPtr 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 parent(aCurrentNode); + nsCOMPtr parent(do_QueryInterface(aCurrentNode)); do { nsCOMPtr node(parent); result = node->GetParentNode(getter_AddRefs(parent)); @@ -1221,7 +1221,7 @@ nsresult nsEditor::GetRightmostChild(nsIDOMNode *aCurrentNode, nsIDOMNode **aResultNode) { nsresult result = NS_OK; - nsCOMPtr resultNode(aCurrentNode); + nsCOMPtr 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 resultNode(aCurrentNode); + nsCOMPtr resultNode(do_QueryInterface(aCurrentNode)); PRBool hasChildren; resultNode->HasChildNodes(&hasChildren); while ((NS_SUCCEEDED(result)) && (PR_TRUE==hasChildren)) diff --git a/mozilla/editor/base/nsEditorEventListeners.h b/mozilla/editor/base/nsEditorEventListeners.h index 84f1c13a063..0b4eaec4340 100644 --- a/mozilla/editor/base/nsEditorEventListeners.h +++ b/mozilla/editor/base/nsEditorEventListeners.h @@ -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 diff --git a/mozilla/editor/base/nsTextEditFactory.cpp b/mozilla/editor/base/nsTextEditFactory.cpp index 01afe64b138..38f304049ae 100644 --- a/mozilla/editor/base/nsTextEditFactory.cpp +++ b/mozilla/editor/base/nsTextEditFactory.cpp @@ -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; } diff --git a/mozilla/editor/base/nsTextEditor.cpp b/mozilla/editor/base/nsTextEditor.cpp index f0848b61890..9fbe5b69d13 100644 --- a/mozilla/editor/base/nsTextEditor.cpp +++ b/mozilla/editor/base/nsTextEditor.cpp @@ -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 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); diff --git a/mozilla/editor/libeditor/base/ChangeAttributeTxn.cpp b/mozilla/editor/libeditor/base/ChangeAttributeTxn.cpp index 5a6cc9a4929..a9c483e2e4e 100644 --- a/mozilla/editor/libeditor/base/ChangeAttributeTxn.cpp +++ b/mozilla/editor/libeditor/base/ChangeAttributeTxn.cpp @@ -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; diff --git a/mozilla/editor/libeditor/base/CreateElementTxn.cpp b/mozilla/editor/libeditor/base/CreateElementTxn.cpp index b5abd3b00a0..3fcb1bfc673 100644 --- a/mozilla/editor/libeditor/base/CreateElementTxn.cpp +++ b/mozilla/editor/libeditor/base/CreateElementTxn.cpp @@ -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 testChildNodes; diff --git a/mozilla/editor/libeditor/base/DeleteElementTxn.cpp b/mozilla/editor/libeditor/base/DeleteElementTxn.cpp index 976e9eae8bd..79c375b65a0 100644 --- a/mozilla/editor/libeditor/base/DeleteElementTxn.cpp +++ b/mozilla/editor/libeditor/base/DeleteElementTxn.cpp @@ -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; diff --git a/mozilla/editor/libeditor/base/DeleteRangeTxn.cpp b/mozilla/editor/libeditor/base/DeleteRangeTxn.cpp index 9ca43916b83..e5a9d3c0d04 100644 --- a/mozilla/editor/libeditor/base/DeleteRangeTxn.cpp +++ b/mozilla/editor/libeditor/base/DeleteRangeTxn.cpp @@ -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 parent; - nsCOMPtr child(aNode); + nsCOMPtr child(do_QueryInterface(aNode)); result = child->GetParentNode(getter_AddRefs(parent)); while ((NS_SUCCEEDED(result)) && child && parent) { diff --git a/mozilla/editor/libeditor/base/DeleteTextTxn.cpp b/mozilla/editor/libeditor/base/DeleteTextTxn.cpp index f7c12e41cc3..cb8d91cc6ec 100644 --- a/mozilla/editor/libeditor/base/DeleteTextTxn.cpp +++ b/mozilla/editor/libeditor/base/DeleteTextTxn.cpp @@ -29,7 +29,7 @@ nsresult DeleteTextTxn::Init(nsIDOMCharacterData *aElement, PRUint32 aOffset, PRUint32 aNumCharsToDelete) { - mElement = aElement; + mElement = do_QueryInterface(aElement); mOffset = aOffset; mNumCharsToDelete = aNumCharsToDelete; mDeletedText = ""; diff --git a/mozilla/editor/libeditor/base/EditAggregateTxn.cpp b/mozilla/editor/libeditor/base/EditAggregateTxn.cpp index 03560411f8f..84b16074ea6 100644 --- a/mozilla/editor/libeditor/base/EditAggregateTxn.cpp +++ b/mozilla/editor/libeditor/base/EditAggregateTxn.cpp @@ -152,7 +152,7 @@ nsresult EditAggregateTxn::AppendChild(EditTxn *aTxn) nsresult EditAggregateTxn::SetName(nsIAtom *aName) { - mName = aName; + mName = do_QueryInterface(aName); return NS_OK; } diff --git a/mozilla/editor/libeditor/base/InsertTextTxn.cpp b/mozilla/editor/libeditor/base/InsertTextTxn.cpp index 90c46cc52e6..2a22b987e76 100644 --- a/mozilla/editor/libeditor/base/InsertTextTxn.cpp +++ b/mozilla/editor/libeditor/base/InsertTextTxn.cpp @@ -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; diff --git a/mozilla/editor/libeditor/base/JoinElementTxn.cpp b/mozilla/editor/libeditor/base/JoinElementTxn.cpp index 1d3a5f3d706..549ed3ee60b 100644 --- a/mozilla/editor/libeditor/base/JoinElementTxn.cpp +++ b/mozilla/editor/libeditor/base/JoinElementTxn.cpp @@ -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; } diff --git a/mozilla/editor/libeditor/base/SplitElementTxn.cpp b/mozilla/editor/libeditor/base/SplitElementTxn.cpp index 387d518b29d..295c76daa69 100644 --- a/mozilla/editor/libeditor/base/SplitElementTxn.cpp +++ b/mozilla/editor/libeditor/base/SplitElementTxn.cpp @@ -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; } diff --git a/mozilla/editor/libeditor/base/nsEditor.cpp b/mozilla/editor/libeditor/base/nsEditor.cpp index bdaabaf1f62..e286464485f 100644 --- a/mozilla/editor/libeditor/base/nsEditor.cpp +++ b/mozilla/editor/libeditor/base/nsEditor.cpp @@ -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 parent(aCurrentNode); + nsCOMPtr parent(do_QueryInterface(aCurrentNode)); do { nsCOMPtr 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 parent(aCurrentNode); + nsCOMPtr parent(do_QueryInterface(aCurrentNode)); do { nsCOMPtr node(parent); result = node->GetParentNode(getter_AddRefs(parent)); @@ -1221,7 +1221,7 @@ nsresult nsEditor::GetRightmostChild(nsIDOMNode *aCurrentNode, nsIDOMNode **aResultNode) { nsresult result = NS_OK; - nsCOMPtr resultNode(aCurrentNode); + nsCOMPtr 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 resultNode(aCurrentNode); + nsCOMPtr resultNode(do_QueryInterface(aCurrentNode)); PRBool hasChildren; resultNode->HasChildNodes(&hasChildren); while ((NS_SUCCEEDED(result)) && (PR_TRUE==hasChildren)) diff --git a/mozilla/editor/libeditor/text/nsEditorEventListeners.h b/mozilla/editor/libeditor/text/nsEditorEventListeners.h index 84f1c13a063..0b4eaec4340 100644 --- a/mozilla/editor/libeditor/text/nsEditorEventListeners.h +++ b/mozilla/editor/libeditor/text/nsEditorEventListeners.h @@ -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