From 9726e994c4d0b5b18b740a70d7c138aee5a35617 Mon Sep 17 00:00:00 2001 From: "jfrancis%netscape.com" Date: Tue, 29 Aug 2000 05:43:03 +0000 Subject: [PATCH] i'm an idiot --- content/base/src/nsSelection.cpp | 7 ++++--- layout/base/src/nsSelection.cpp | 7 ++++--- layout/generic/nsSelection.cpp | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/content/base/src/nsSelection.cpp b/content/base/src/nsSelection.cpp index fa07a6afdb38..30ec24ac33eb 100644 --- a/content/base/src/nsSelection.cpp +++ b/content/base/src/nsSelection.cpp @@ -5236,7 +5236,7 @@ nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes) for (PRUint32 i=0; i < cnt; ++i) { nsCOMPtr element = dont_AddRef(mRangeArray->ElementAt(i)); - nsCOMPtr newrange, range = do_QueryInterface(element); + nsCOMPtr range = do_QueryInterface(element); if (!range) return NS_ERROR_UNEXPECTED; /* @@ -5245,6 +5245,7 @@ nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes) // children are all selected to be selected itself. This is to help the user get // what they expect when copying html. + nsCOMPtr newrange; rv = range->CloneRange(getter_AddRefs(newrange)); if (NS_FAILED(rv)) return rv; if (!newrange) return NS_ERROR_NULL_POINTER; @@ -5255,7 +5256,7 @@ nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes) nsCOMPtr content (do_QueryInterface(aNode)); if (content) { - if (IsNodeIntersectsRange(content, newrange)) + if (IsNodeIntersectsRange(content, range)) { // If recursive, then we're done -- IsNodeIntersectsRange does the right thing if (aRecursive) @@ -5267,7 +5268,7 @@ nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes) // else not recursive -- node itself must be contained, // so we need to do more checking PRBool nodeStartsBeforeRange, nodeEndsAfterRange; - if (NS_SUCCEEDED(CompareNodeToRange(content, newrange, + if (NS_SUCCEEDED(CompareNodeToRange(content, range, &nodeStartsBeforeRange, &nodeEndsAfterRange))) { diff --git a/layout/base/src/nsSelection.cpp b/layout/base/src/nsSelection.cpp index fa07a6afdb38..30ec24ac33eb 100644 --- a/layout/base/src/nsSelection.cpp +++ b/layout/base/src/nsSelection.cpp @@ -5236,7 +5236,7 @@ nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes) for (PRUint32 i=0; i < cnt; ++i) { nsCOMPtr element = dont_AddRef(mRangeArray->ElementAt(i)); - nsCOMPtr newrange, range = do_QueryInterface(element); + nsCOMPtr range = do_QueryInterface(element); if (!range) return NS_ERROR_UNEXPECTED; /* @@ -5245,6 +5245,7 @@ nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes) // children are all selected to be selected itself. This is to help the user get // what they expect when copying html. + nsCOMPtr newrange; rv = range->CloneRange(getter_AddRefs(newrange)); if (NS_FAILED(rv)) return rv; if (!newrange) return NS_ERROR_NULL_POINTER; @@ -5255,7 +5256,7 @@ nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes) nsCOMPtr content (do_QueryInterface(aNode)); if (content) { - if (IsNodeIntersectsRange(content, newrange)) + if (IsNodeIntersectsRange(content, range)) { // If recursive, then we're done -- IsNodeIntersectsRange does the right thing if (aRecursive) @@ -5267,7 +5268,7 @@ nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes) // else not recursive -- node itself must be contained, // so we need to do more checking PRBool nodeStartsBeforeRange, nodeEndsAfterRange; - if (NS_SUCCEEDED(CompareNodeToRange(content, newrange, + if (NS_SUCCEEDED(CompareNodeToRange(content, range, &nodeStartsBeforeRange, &nodeEndsAfterRange))) { diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp index fa07a6afdb38..30ec24ac33eb 100644 --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -5236,7 +5236,7 @@ nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes) for (PRUint32 i=0; i < cnt; ++i) { nsCOMPtr element = dont_AddRef(mRangeArray->ElementAt(i)); - nsCOMPtr newrange, range = do_QueryInterface(element); + nsCOMPtr range = do_QueryInterface(element); if (!range) return NS_ERROR_UNEXPECTED; /* @@ -5245,6 +5245,7 @@ nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes) // children are all selected to be selected itself. This is to help the user get // what they expect when copying html. + nsCOMPtr newrange; rv = range->CloneRange(getter_AddRefs(newrange)); if (NS_FAILED(rv)) return rv; if (!newrange) return NS_ERROR_NULL_POINTER; @@ -5255,7 +5256,7 @@ nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes) nsCOMPtr content (do_QueryInterface(aNode)); if (content) { - if (IsNodeIntersectsRange(content, newrange)) + if (IsNodeIntersectsRange(content, range)) { // If recursive, then we're done -- IsNodeIntersectsRange does the right thing if (aRecursive) @@ -5267,7 +5268,7 @@ nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes) // else not recursive -- node itself must be contained, // so we need to do more checking PRBool nodeStartsBeforeRange, nodeEndsAfterRange; - if (NS_SUCCEEDED(CompareNodeToRange(content, newrange, + if (NS_SUCCEEDED(CompareNodeToRange(content, range, &nodeStartsBeforeRange, &nodeEndsAfterRange))) {