diff --git a/mozilla/editor/base/nsHTMLDataTransfer.cpp b/mozilla/editor/base/nsHTMLDataTransfer.cpp index a7f65f9a7a4..d6894dc2b59 100644 --- a/mozilla/editor/base/nsHTMLDataTransfer.cpp +++ b/mozilla/editor/base/nsHTMLDataTransfer.cpp @@ -259,7 +259,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr // but if not we want to delete _contents_ of cells and replace // with non-table elements. Use cellSelectionMode bool to // indicate results. - nsCOMPtr isupports = nodeList->ElementAt(0); + nsCOMPtr isupports = dont_AddRef(nodeList->ElementAt(0)); nsCOMPtr firstNode( do_QueryInterface(isupports) ); if (!nsHTMLEditUtils::IsTableElement(firstNode)) cellSelectionMode = PR_FALSE; @@ -315,7 +315,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr // build up list of parents of first node in lst that are either: // lists, or tables. - nsCOMPtr isup = nodeList->ElementAt(0); + nsCOMPtr isup = dont_AddRef(nodeList->ElementAt(0)); nsCOMPtr pNode( do_QueryInterface(isup) ); nsCOMPtr listAndTableArray; res = NS_NewISupportsArray(getter_AddRefs(listAndTableArray)); @@ -344,7 +344,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr nodeList->Count(&listCount); for (j=0; j isupports = nodeList->ElementAt(j); + nsCOMPtr isupports = dont_AddRef(nodeList->ElementAt(j)); nsCOMPtr curNode( do_QueryInterface(isupports) ); NS_ENSURE_TRUE(curNode, NS_ERROR_FAILURE); @@ -391,13 +391,13 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr // table or list contents outside the table or list. if (highWaterMark >= 0) { - nsCOMPtr isupports = listAndTableArray->ElementAt(highWaterMark); + nsCOMPtr isupports = dont_AddRef(listAndTableArray->ElementAt(highWaterMark)); nsCOMPtr curNode( do_QueryInterface(isupports) ); nsCOMPtr replaceNode, tmp; if (nsHTMLEditUtils::IsTable(curNode)) { // look upward from curNode for a piece of this table - isup = nodeList->ElementAt(0); + isup = dont_AddRef(nodeList->ElementAt(0)); pNode = do_QueryInterface(isup); while (pNode) { @@ -418,7 +418,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr else // list case { // look upward from curNode for a piece of this list - isup = nodeList->ElementAt(0); + isup = dont_AddRef(nodeList->ElementAt(0)); pNode = do_QueryInterface(isup); while (pNode) { @@ -445,7 +445,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr // so that we dont insert them twice. do { - isupports = nodeList->ElementAt(1); + isupports = dont_AddRef(nodeList->ElementAt(1)); tmp = do_QueryInterface(isupports); if (tmp && nsHTMLEditUtils::IsDescendantOf(tmp, replaceNode)) nodeList->RemoveElementAt(1); @@ -461,7 +461,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr nodeList->Count(&listCount); for (j=0; j isupports = nodeList->ElementAt(j); + nsCOMPtr isupports = dont_AddRef(nodeList->ElementAt(j)); nsCOMPtr curNode( do_QueryInterface(isupports) ); NS_ENSURE_TRUE(curNode, NS_ERROR_FAILURE); diff --git a/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp b/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp index a7f65f9a7a4..d6894dc2b59 100644 --- a/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp @@ -259,7 +259,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr // but if not we want to delete _contents_ of cells and replace // with non-table elements. Use cellSelectionMode bool to // indicate results. - nsCOMPtr isupports = nodeList->ElementAt(0); + nsCOMPtr isupports = dont_AddRef(nodeList->ElementAt(0)); nsCOMPtr firstNode( do_QueryInterface(isupports) ); if (!nsHTMLEditUtils::IsTableElement(firstNode)) cellSelectionMode = PR_FALSE; @@ -315,7 +315,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr // build up list of parents of first node in lst that are either: // lists, or tables. - nsCOMPtr isup = nodeList->ElementAt(0); + nsCOMPtr isup = dont_AddRef(nodeList->ElementAt(0)); nsCOMPtr pNode( do_QueryInterface(isup) ); nsCOMPtr listAndTableArray; res = NS_NewISupportsArray(getter_AddRefs(listAndTableArray)); @@ -344,7 +344,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr nodeList->Count(&listCount); for (j=0; j isupports = nodeList->ElementAt(j); + nsCOMPtr isupports = dont_AddRef(nodeList->ElementAt(j)); nsCOMPtr curNode( do_QueryInterface(isupports) ); NS_ENSURE_TRUE(curNode, NS_ERROR_FAILURE); @@ -391,13 +391,13 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr // table or list contents outside the table or list. if (highWaterMark >= 0) { - nsCOMPtr isupports = listAndTableArray->ElementAt(highWaterMark); + nsCOMPtr isupports = dont_AddRef(listAndTableArray->ElementAt(highWaterMark)); nsCOMPtr curNode( do_QueryInterface(isupports) ); nsCOMPtr replaceNode, tmp; if (nsHTMLEditUtils::IsTable(curNode)) { // look upward from curNode for a piece of this table - isup = nodeList->ElementAt(0); + isup = dont_AddRef(nodeList->ElementAt(0)); pNode = do_QueryInterface(isup); while (pNode) { @@ -418,7 +418,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr else // list case { // look upward from curNode for a piece of this list - isup = nodeList->ElementAt(0); + isup = dont_AddRef(nodeList->ElementAt(0)); pNode = do_QueryInterface(isup); while (pNode) { @@ -445,7 +445,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr // so that we dont insert them twice. do { - isupports = nodeList->ElementAt(1); + isupports = dont_AddRef(nodeList->ElementAt(1)); tmp = do_QueryInterface(isupports); if (tmp && nsHTMLEditUtils::IsDescendantOf(tmp, replaceNode)) nodeList->RemoveElementAt(1); @@ -461,7 +461,7 @@ nsresult nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString& aInputStr nodeList->Count(&listCount); for (j=0; j isupports = nodeList->ElementAt(j); + nsCOMPtr isupports = dont_AddRef(nodeList->ElementAt(j)); nsCOMPtr curNode( do_QueryInterface(isupports) ); NS_ENSURE_TRUE(curNode, NS_ERROR_FAILURE);