fixing bug that broke selection in docs with generated content

This commit is contained in:
jfrancis%netscape.com 1999-06-20 00:12:59 +00:00
parent e5c2d001e2
commit d7a49fad32
4 changed files with 8 additions and 14 deletions

View File

@ -240,11 +240,8 @@ PRBool GetNodeBracketPoints(nsIContent* aNode,
}
else
{
nsCOMPtr<nsIContent> cN(do_QueryInterface(*outParent));
if (!cN || NS_FAILED(cN->IndexOf(aNode, indx)))
return PR_FALSE;
*outStartOffset = indx;
*outEndOffset = indx+1;
*outStartOffset = nsRange::IndexOf(theDOMNode);
*outEndOffset = *outStartOffset+1;
}
return PR_TRUE;
}
@ -588,7 +585,7 @@ nsresult nsRange::ComparePointToRange(nsCOMPtr<nsIDOMNode> aParent, PRInt32 aOff
return NS_OK;
}
PRInt32 nsRange::IndexOf(nsCOMPtr<nsIDOMNode> aChildNode)
PRInt32 nsRange::IndexOf(nsIDOMNode* aChildNode)
{
nsCOMPtr<nsIDOMNode> parentNode;
nsCOMPtr<nsIContent> contentChild;

View File

@ -123,7 +123,7 @@ public:
// helper routines
static PRBool InSameDoc(nsCOMPtr<nsIDOMNode> aNode1, nsCOMPtr<nsIDOMNode> aNode2);
static PRInt32 IndexOf(nsCOMPtr<nsIDOMNode> aNode);
static PRInt32 IndexOf(nsIDOMNode* aNode);
static PRInt32 FillArrayWithAncestors(nsVoidArray* aArray,nsCOMPtr<nsIDOMNode> aNode);
static nsCOMPtr<nsIDOMNode> CommonParent(nsCOMPtr<nsIDOMNode> aNode1, nsCOMPtr<nsIDOMNode> aNode2);
static nsresult GetDOMNodeFromContent(nsCOMPtr<nsIContent> inContentNode, nsCOMPtr<nsIDOMNode>* outDomNode);

View File

@ -240,11 +240,8 @@ PRBool GetNodeBracketPoints(nsIContent* aNode,
}
else
{
nsCOMPtr<nsIContent> cN(do_QueryInterface(*outParent));
if (!cN || NS_FAILED(cN->IndexOf(aNode, indx)))
return PR_FALSE;
*outStartOffset = indx;
*outEndOffset = indx+1;
*outStartOffset = nsRange::IndexOf(theDOMNode);
*outEndOffset = *outStartOffset+1;
}
return PR_TRUE;
}
@ -588,7 +585,7 @@ nsresult nsRange::ComparePointToRange(nsCOMPtr<nsIDOMNode> aParent, PRInt32 aOff
return NS_OK;
}
PRInt32 nsRange::IndexOf(nsCOMPtr<nsIDOMNode> aChildNode)
PRInt32 nsRange::IndexOf(nsIDOMNode* aChildNode)
{
nsCOMPtr<nsIDOMNode> parentNode;
nsCOMPtr<nsIContent> contentChild;

View File

@ -123,7 +123,7 @@ public:
// helper routines
static PRBool InSameDoc(nsCOMPtr<nsIDOMNode> aNode1, nsCOMPtr<nsIDOMNode> aNode2);
static PRInt32 IndexOf(nsCOMPtr<nsIDOMNode> aNode);
static PRInt32 IndexOf(nsIDOMNode* aNode);
static PRInt32 FillArrayWithAncestors(nsVoidArray* aArray,nsCOMPtr<nsIDOMNode> aNode);
static nsCOMPtr<nsIDOMNode> CommonParent(nsCOMPtr<nsIDOMNode> aNode1, nsCOMPtr<nsIDOMNode> aNode2);
static nsresult GetDOMNodeFromContent(nsCOMPtr<nsIContent> inContentNode, nsCOMPtr<nsIDOMNode>* outDomNode);