fix for bug: subtree iterator had bug in init code that could cause iter to be empty.

This commit is contained in:
jfrancis%netscape.com 1999-07-25 05:30:15 +00:00
parent 52037238fa
commit 4b1939dc92
2 changed files with 4 additions and 4 deletions

View File

@ -911,6 +911,8 @@ nsresult nsContentSubtreeIterator::Init(nsIDOMRange* aRange)
// now to find the last node
aRange->GetEndOffset(&indx);
numChildren = GetNumChildren(endParent);
if (indx > numChildren) indx = numChildren;
if (!indx)
{
@ -918,8 +920,6 @@ nsresult nsContentSubtreeIterator::Init(nsIDOMRange* aRange)
}
else
{
numChildren = GetNumChildren(endParent);
if (!numChildren) // no children, must be a text node
{
cN = cEndP;

View File

@ -911,6 +911,8 @@ nsresult nsContentSubtreeIterator::Init(nsIDOMRange* aRange)
// now to find the last node
aRange->GetEndOffset(&indx);
numChildren = GetNumChildren(endParent);
if (indx > numChildren) indx = numChildren;
if (!indx)
{
@ -918,8 +920,6 @@ nsresult nsContentSubtreeIterator::Init(nsIDOMRange* aRange)
}
else
{
numChildren = GetNumChildren(endParent);
if (!numChildren) // no children, must be a text node
{
cN = cEndP;