Closed Bug 156554 Opened 23 years ago Closed 23 years ago

Make nsRange QI directly

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: caillon, Assigned: caillon)

Details

Attachments

(1 file)

Right now there are silly helper functions that nsRange uses to do QIs. We should just remove those and QI directly.
Comment on attachment 90682 [details] [diff] [review] Simple patch. > if (theRange) > { >- nsCOMPtr<nsIDOMNode> domNode; >- res = GetDOMNodeFromContent(cN, address_of(domNode)); >+ nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(cN)); > NS_POSTCONDITION(NS_SUCCEEDED(res), "error updating range > NS_POSTCONDITION(domNode, "error updating range list"); you should either use do_QueryInterface(cN, res) or remove the first postcondition. I'd prefer the latter. >@@ -2463,16 +2438,11 @@ > > nsCOMPtr<nsIContent> parent( do_QueryInterface(aParentNode) ); > nsCOMPtr<nsIContent> replaced( do_QueryInterface(aReplacedNode) ); >- nsCOMPtr<nsIDOMNode> parentDomNode; >- nsresult res; >- >- res = GetDOMNodeFromContent(parent, address_of(parentDomNode)); >- if (NS_FAILED(res)) return res; >+ nsCOMPtr<nsIDOMNode> parentDomNode( do_QueryInterface(parent) ); what's up with the extra spaces? r=sicking
Attachment #90682 - Flags: review+
Comment on attachment 90682 [details] [diff] [review] Simple patch. Ben says sr=ben
Attachment #90682 - Flags: superreview+
Checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Component: DOM: Traversal-Range → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: