From d4b9511aad3610b62bc63f0cbde51cb90631f7e6 Mon Sep 17 00:00:00 2001 From: "danm%netscape.com" Date: Wed, 17 Feb 1999 04:39:22 +0000 Subject: [PATCH] changed nsCOMPtr comparison operators to explicitly use get(). part of nsCOMPtr carpool. git-svn-id: svn://10.0.0.236/trunk@20883 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/base/src/nsGenericDOMDataNode.cpp | 6 +- mozilla/layout/base/nsCSSFrameConstructor.cpp | 68 +++++++++---------- .../layout/base/src/nsGenericDOMDataNode.cpp | 6 +- mozilla/layout/base/src/nsRangeList.cpp | 10 +-- .../html/style/src/nsCSSFrameConstructor.cpp | 68 +++++++++---------- .../xul/base/src/nsProgressMeterFrame.cpp | 4 +- .../layout/xul/base/src/nsToolboxFrame.cpp | 4 +- .../xul/base/src/nsTreeIndentationFrame.cpp | 4 +- 8 files changed, 85 insertions(+), 85 deletions(-) diff --git a/mozilla/content/base/src/nsGenericDOMDataNode.cpp b/mozilla/content/base/src/nsGenericDOMDataNode.cpp index e100583c66e..64c3de9c3f4 100644 --- a/mozilla/content/base/src/nsGenericDOMDataNode.cpp +++ b/mozilla/content/base/src/nsGenericDOMDataNode.cpp @@ -507,15 +507,15 @@ nsGenericDOMDataNode::ConvertContentToXIF(nsXIFConverter& aConverter) const nsString buffer; mText.AppendTo(buffer); - if (startContent == content || endContent == content) + if (startContent.get() == content || endContent.get() == content) { // NOTE: ORDER MATTERS! // This must go before the Cut - if (endContent == content) + if (endContent.get() == content) buffer.Truncate(endOffset); // This must go after the Trunctate - if (startContent == content) + if (startContent.get() == content) buffer.Cut(0,startOffset); } aConverter.AddContent(buffer); diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index c2a35c4768d..66123326e01 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -1035,7 +1035,7 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresContext* aPresContext, nsCOMPtr tag; aChildContent->GetTag(*getter_AddRefs(tag)); // forms need a frame but it can't be a child of an inner table - if (nsHTMLAtoms::form == tag) { + if (nsHTMLAtoms::form == tag.get()) { // if the parent is a table, put the form in the outer table frame const nsStyleDisplay* parentDisplay = (const nsStyleDisplay*) aParentStyleContext->GetStyleData(eStyleStruct_Display); @@ -1102,40 +1102,40 @@ nsCSSFrameConstructor::TableIsValidCellContent(nsIPresContext* aPresContext, } // check tags first - if ( (nsHTMLAtoms::img == tag) || - (nsHTMLAtoms::hr == tag) || - (nsHTMLAtoms::br == tag) || - (nsHTMLAtoms::wbr == tag) || - (nsHTMLAtoms::input == tag) || - (nsHTMLAtoms::textarea == tag) || - (nsHTMLAtoms::select == tag) || - (nsHTMLAtoms::applet == tag) || - (nsHTMLAtoms::embed == tag) || - (nsHTMLAtoms::fieldset == tag) || - (nsHTMLAtoms::legend == tag) || - (nsHTMLAtoms::object == tag) || - (nsHTMLAtoms::form == tag) || - (nsHTMLAtoms::iframe == tag) || - (nsHTMLAtoms::spacer == tag) || - (nsHTMLAtoms::button == tag) || - (nsHTMLAtoms::label == tag )) { + if ( (nsHTMLAtoms::img == tag.get()) || + (nsHTMLAtoms::hr == tag.get()) || + (nsHTMLAtoms::br == tag.get()) || + (nsHTMLAtoms::wbr == tag.get()) || + (nsHTMLAtoms::input == tag.get()) || + (nsHTMLAtoms::textarea == tag.get()) || + (nsHTMLAtoms::select == tag.get()) || + (nsHTMLAtoms::applet == tag.get()) || + (nsHTMLAtoms::embed == tag.get()) || + (nsHTMLAtoms::fieldset == tag.get()) || + (nsHTMLAtoms::legend == tag.get()) || + (nsHTMLAtoms::object == tag.get()) || + (nsHTMLAtoms::form == tag.get()) || + (nsHTMLAtoms::iframe == tag.get()) || + (nsHTMLAtoms::spacer == tag.get()) || + (nsHTMLAtoms::button == tag.get()) || + (nsHTMLAtoms::label == tag.get() )) { return PR_TRUE; } #ifdef INCLUDE_XUL - if ( (nsXULAtoms::button == tag) || - (nsXULAtoms::checkbox == tag) || - (nsXULAtoms::radio == tag) || - (nsXULAtoms::text == tag) || - (nsXULAtoms::widget == tag) || - (nsXULAtoms::tree == tag) || - (nsXULAtoms::treechildren == tag) || - (nsXULAtoms::treeitem == tag) || - (nsXULAtoms::treecell == tag) || - (nsXULAtoms::treeindentation == tag) || - (nsXULAtoms::toolbox == tag) || - (nsXULAtoms::toolbar == tag) || - (nsXULAtoms::progressmeter == tag )) { + if ( (nsXULAtoms::button == tag.get()) || + (nsXULAtoms::checkbox == tag.get()) || + (nsXULAtoms::radio == tag.get()) || + (nsXULAtoms::text == tag.get()) || + (nsXULAtoms::widget == tag.get()) || + (nsXULAtoms::tree == tag.get()) || + (nsXULAtoms::treechildren == tag.get()) || + (nsXULAtoms::treeitem == tag.get()) || + (nsXULAtoms::treecell == tag.get()) || + (nsXULAtoms::treeindentation == tag.get()) || + (nsXULAtoms::toolbox == tag.get()) || + (nsXULAtoms::toolbar == tag.get()) || + (nsXULAtoms::progressmeter == tag.get() )) { return PR_TRUE; } #endif @@ -1890,7 +1890,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext, // Construct a child frame nsCOMPtr pTag; childContent->GetTag(*getter_AddRefs(pTag)); - if (pTag == nsXULAtoms::treechildren) + if (pTag.get() == nsXULAtoms::treechildren) { // We want to call ConstructFrame to keep building rows, but only if we're // open. @@ -3453,7 +3453,7 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresContext* aPresContext, content->GetTag(*getter_AddRefs(tag)); // See whether it's an IMG or an OBJECT element - if (nsHTMLAtoms::img == tag) { + if (nsHTMLAtoms::img == tag.get()) { // It's an IMG element. Try and construct an alternate frame to use when the // image can't be rendered nsIFrame* newFrame; @@ -3473,7 +3473,7 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresContext* aPresContext, parentFrame->InsertFrames(*aPresContext, *presShell, nsnull, prevSibling, newFrame); } - } else if (nsHTMLAtoms::object == tag) { + } else if (nsHTMLAtoms::object == tag.get()) { ; } else { NS_ASSERTION(PR_FALSE, "unexpected tag"); diff --git a/mozilla/layout/base/src/nsGenericDOMDataNode.cpp b/mozilla/layout/base/src/nsGenericDOMDataNode.cpp index e100583c66e..64c3de9c3f4 100644 --- a/mozilla/layout/base/src/nsGenericDOMDataNode.cpp +++ b/mozilla/layout/base/src/nsGenericDOMDataNode.cpp @@ -507,15 +507,15 @@ nsGenericDOMDataNode::ConvertContentToXIF(nsXIFConverter& aConverter) const nsString buffer; mText.AppendTo(buffer); - if (startContent == content || endContent == content) + if (startContent.get() == content || endContent.get() == content) { // NOTE: ORDER MATTERS! // This must go before the Cut - if (endContent == content) + if (endContent.get() == content) buffer.Truncate(endOffset); // This must go after the Trunctate - if (startContent == content) + if (startContent.get() == content) buffer.Cut(0,startOffset); } aConverter.AddContent(buffer); diff --git a/mozilla/layout/base/src/nsRangeList.cpp b/mozilla/layout/base/src/nsRangeList.cpp index b00d202d82b..a1164b81110 100644 --- a/mozilla/layout/base/src/nsRangeList.cpp +++ b/mozilla/layout/base/src/nsRangeList.cpp @@ -753,11 +753,11 @@ nsRangeList::TakeFocus(nsIFocusTracker *aTracker, nsIFrame *aFrame, PRInt32 aOff nsCOMPtroldContent; if (NS_SUCCEEDED(frame->GetContent(getter_AddRefs(oldContent))) && oldContent){ nsCOMPtr oldDomNode(do_QueryInterface(oldContent)); - if (oldDomNode && (oldDomNode == GetFocusNode())) { + if (oldDomNode && (oldDomNode.get() == GetFocusNode())) { nsCOMPtr anchorContent; if (NS_SUCCEEDED(anchor->GetContent(getter_AddRefs(anchorContent))) && anchorContent){ nsCOMPtranchorDomNode(do_QueryInterface(anchorContent)); - if (anchorDomNode && anchorDomNode == GetAnchorNode()) { + if (anchorDomNode && anchorDomNode.get() == GetAnchorNode()) { //get offsets @@ -867,7 +867,7 @@ findFrameFromContent(nsIFrame *aParent, nsIContent *aContent, PRBool aTurnOff) return nsnull; nsCOMPtr content; aParent->GetContent(getter_AddRefs(content)); - if (content == aContent){ + if (content.get() == aContent){ return aParent; } if (aTurnOff) @@ -1155,7 +1155,7 @@ nsRangeList::Extend(nsIDOMNode* aParentNode, PRInt32 aOffset) range->GetStartOffset(&startOffset); nsresult res; - if ((GetFocusNode() == endNode) && (GetFocusOffset() == endOffset)) + if ((GetFocusNode() == endNode.get()) && (GetFocusOffset() == endOffset)) { res = range->SetEnd(aParentNode, aOffset); if (res == NS_ERROR_ILLEGAL_VALUE) @@ -1171,7 +1171,7 @@ nsRangeList::Extend(nsIDOMNode* aParentNode, PRInt32 aOffset) return NotifySelectionListeners(); } - if ((GetFocusNode() == startNode) && (GetFocusOffset() == startOffset)) + if ((GetFocusNode() == startNode.get()) && (GetFocusOffset() == startOffset)) { res = range->SetStart(aParentNode, aOffset); if (res == NS_ERROR_ILLEGAL_VALUE) diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index c2a35c4768d..66123326e01 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -1035,7 +1035,7 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresContext* aPresContext, nsCOMPtr tag; aChildContent->GetTag(*getter_AddRefs(tag)); // forms need a frame but it can't be a child of an inner table - if (nsHTMLAtoms::form == tag) { + if (nsHTMLAtoms::form == tag.get()) { // if the parent is a table, put the form in the outer table frame const nsStyleDisplay* parentDisplay = (const nsStyleDisplay*) aParentStyleContext->GetStyleData(eStyleStruct_Display); @@ -1102,40 +1102,40 @@ nsCSSFrameConstructor::TableIsValidCellContent(nsIPresContext* aPresContext, } // check tags first - if ( (nsHTMLAtoms::img == tag) || - (nsHTMLAtoms::hr == tag) || - (nsHTMLAtoms::br == tag) || - (nsHTMLAtoms::wbr == tag) || - (nsHTMLAtoms::input == tag) || - (nsHTMLAtoms::textarea == tag) || - (nsHTMLAtoms::select == tag) || - (nsHTMLAtoms::applet == tag) || - (nsHTMLAtoms::embed == tag) || - (nsHTMLAtoms::fieldset == tag) || - (nsHTMLAtoms::legend == tag) || - (nsHTMLAtoms::object == tag) || - (nsHTMLAtoms::form == tag) || - (nsHTMLAtoms::iframe == tag) || - (nsHTMLAtoms::spacer == tag) || - (nsHTMLAtoms::button == tag) || - (nsHTMLAtoms::label == tag )) { + if ( (nsHTMLAtoms::img == tag.get()) || + (nsHTMLAtoms::hr == tag.get()) || + (nsHTMLAtoms::br == tag.get()) || + (nsHTMLAtoms::wbr == tag.get()) || + (nsHTMLAtoms::input == tag.get()) || + (nsHTMLAtoms::textarea == tag.get()) || + (nsHTMLAtoms::select == tag.get()) || + (nsHTMLAtoms::applet == tag.get()) || + (nsHTMLAtoms::embed == tag.get()) || + (nsHTMLAtoms::fieldset == tag.get()) || + (nsHTMLAtoms::legend == tag.get()) || + (nsHTMLAtoms::object == tag.get()) || + (nsHTMLAtoms::form == tag.get()) || + (nsHTMLAtoms::iframe == tag.get()) || + (nsHTMLAtoms::spacer == tag.get()) || + (nsHTMLAtoms::button == tag.get()) || + (nsHTMLAtoms::label == tag.get() )) { return PR_TRUE; } #ifdef INCLUDE_XUL - if ( (nsXULAtoms::button == tag) || - (nsXULAtoms::checkbox == tag) || - (nsXULAtoms::radio == tag) || - (nsXULAtoms::text == tag) || - (nsXULAtoms::widget == tag) || - (nsXULAtoms::tree == tag) || - (nsXULAtoms::treechildren == tag) || - (nsXULAtoms::treeitem == tag) || - (nsXULAtoms::treecell == tag) || - (nsXULAtoms::treeindentation == tag) || - (nsXULAtoms::toolbox == tag) || - (nsXULAtoms::toolbar == tag) || - (nsXULAtoms::progressmeter == tag )) { + if ( (nsXULAtoms::button == tag.get()) || + (nsXULAtoms::checkbox == tag.get()) || + (nsXULAtoms::radio == tag.get()) || + (nsXULAtoms::text == tag.get()) || + (nsXULAtoms::widget == tag.get()) || + (nsXULAtoms::tree == tag.get()) || + (nsXULAtoms::treechildren == tag.get()) || + (nsXULAtoms::treeitem == tag.get()) || + (nsXULAtoms::treecell == tag.get()) || + (nsXULAtoms::treeindentation == tag.get()) || + (nsXULAtoms::toolbox == tag.get()) || + (nsXULAtoms::toolbar == tag.get()) || + (nsXULAtoms::progressmeter == tag.get() )) { return PR_TRUE; } #endif @@ -1890,7 +1890,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext, // Construct a child frame nsCOMPtr pTag; childContent->GetTag(*getter_AddRefs(pTag)); - if (pTag == nsXULAtoms::treechildren) + if (pTag.get() == nsXULAtoms::treechildren) { // We want to call ConstructFrame to keep building rows, but only if we're // open. @@ -3453,7 +3453,7 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresContext* aPresContext, content->GetTag(*getter_AddRefs(tag)); // See whether it's an IMG or an OBJECT element - if (nsHTMLAtoms::img == tag) { + if (nsHTMLAtoms::img == tag.get()) { // It's an IMG element. Try and construct an alternate frame to use when the // image can't be rendered nsIFrame* newFrame; @@ -3473,7 +3473,7 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresContext* aPresContext, parentFrame->InsertFrames(*aPresContext, *presShell, nsnull, prevSibling, newFrame); } - } else if (nsHTMLAtoms::object == tag) { + } else if (nsHTMLAtoms::object == tag.get()) { ; } else { NS_ASSERTION(PR_FALSE, "unexpected tag"); diff --git a/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp b/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp index b370535e4e4..7778f926321 100644 --- a/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp +++ b/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp @@ -706,7 +706,7 @@ nsProgressMeterFrame :: RefreshStyleContext(nsIPresContext* aPresContext, aParentStyle, PR_FALSE, &newStyleContext); - if (newStyleContext != *aCurrentStyle) + if (newStyleContext != aCurrentStyle->get()) *aCurrentStyle = newStyleContext; } // RefreshStyleContext @@ -728,7 +728,7 @@ nsProgressMeterFrame :: ReResolveStyleContext ( nsIPresContext* aPresContext, ns return rv; } - if ( old != mStyleContext ) { + if ( old.get() != mStyleContext ) { nsCOMPtr barPseudo ( dont_AddRef(NS_NewAtom(":progressmeter-stripe")) ); RefreshStyleContext(aPresContext, barPseudo, &mBarStyle, mContent, mStyleContext); } diff --git a/mozilla/layout/xul/base/src/nsToolboxFrame.cpp b/mozilla/layout/xul/base/src/nsToolboxFrame.cpp index 9ea90ff6564..73f33ad4c06 100644 --- a/mozilla/layout/xul/base/src/nsToolboxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsToolboxFrame.cpp @@ -118,7 +118,7 @@ nsToolboxFrame :: RefreshStyleContext(nsIPresContext* aPresContext, aParentStyle, PR_FALSE, &newStyleContext); - if (newStyleContext != *aCurrentStyle) + if (newStyleContext != aCurrentStyle->get()) *aCurrentStyle = newStyleContext; } // RefreshStyleContext @@ -140,7 +140,7 @@ nsToolboxFrame :: ReResolveStyleContext ( nsIPresContext* aPresContext, nsIStyle return rv; } - if ( old != mStyleContext ) { + if ( old.get() != mStyleContext ) { nsCOMPtr grippyRolloverPseudo ( dont_AddRef(NS_NewAtom(":toolbox-rollover")) ); RefreshStyleContext(aPresContext, grippyRolloverPseudo, &mGrippyRolloverStyle, mContent, mStyleContext); diff --git a/mozilla/layout/xul/base/src/nsTreeIndentationFrame.cpp b/mozilla/layout/xul/base/src/nsTreeIndentationFrame.cpp index 5bf01c317db..ee604ae3290 100644 --- a/mozilla/layout/xul/base/src/nsTreeIndentationFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTreeIndentationFrame.cpp @@ -80,7 +80,7 @@ nsTreeIndentationFrame::Reflow(nsIPresContext& aPresContext, pContent->GetTag(*getter_AddRefs(pTag)); if (pTag) { - while (aFrame && pTag && pTag != nsXULAtoms::treeitem) + while (aFrame && pTag && pTag.get() != nsXULAtoms::treeitem) { aFrame->GetParent(&aFrame); @@ -91,7 +91,7 @@ nsTreeIndentationFrame::Reflow(nsIPresContext& aPresContext, // We now have a tree row content node. Start counting our level of nesting. nsCOMPtr pParentContent; - while (pTag != nsXULAtoms::treebody && pTag != nsXULAtoms::treehead) + while (pTag.get() != nsXULAtoms::treebody && pTag.get() != nsXULAtoms::treehead) { pContent->GetParent(*getter_AddRefs(pParentContent));