Fixed bug introduced during nsIContent porting

git-svn-id: svn://10.0.0.236/trunk@8825 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com
1998-08-29 20:44:42 +00:00
parent 29e64a354f
commit 54c474764c
2 changed files with 24 additions and 14 deletions

View File

@@ -1615,9 +1615,12 @@ NS_IMETHODIMP nsHTMLDocument::FindNext(const nsString &aSearchStr, PRBool aMatch
start = body;
NS_ADDREF(body);
// Find Very first Piece of Content
PRInt32 snc;
start->ChildCount(snc);
while (snc > 0) {
for (;;) {
PRInt32 snc;
start->ChildCount(snc);
if (snc <= 0) {
break;
}
nsIContent * child = start;
child->ChildAt(0, start);
NS_RELEASE(child);
@@ -1626,13 +1629,15 @@ NS_IMETHODIMP nsHTMLDocument::FindNext(const nsString &aSearchStr, PRBool aMatch
end = body;
NS_ADDREF(body);
// Last piece of Content
PRInt32 count;
end->ChildCount(count);
while (count > 0) {
for (;;) {
PRInt32 count;
end->ChildCount(count);
if (count <= 0) {
break;
}
nsIContent * child = end;
child->ChildAt(count-1, end);
NS_RELEASE(child);
end->ChildCount(count);
}
nsSelectionRange * range = mSelection->GetRange();

View File

@@ -1615,9 +1615,12 @@ NS_IMETHODIMP nsHTMLDocument::FindNext(const nsString &aSearchStr, PRBool aMatch
start = body;
NS_ADDREF(body);
// Find Very first Piece of Content
PRInt32 snc;
start->ChildCount(snc);
while (snc > 0) {
for (;;) {
PRInt32 snc;
start->ChildCount(snc);
if (snc <= 0) {
break;
}
nsIContent * child = start;
child->ChildAt(0, start);
NS_RELEASE(child);
@@ -1626,13 +1629,15 @@ NS_IMETHODIMP nsHTMLDocument::FindNext(const nsString &aSearchStr, PRBool aMatch
end = body;
NS_ADDREF(body);
// Last piece of Content
PRInt32 count;
end->ChildCount(count);
while (count > 0) {
for (;;) {
PRInt32 count;
end->ChildCount(count);
if (count <= 0) {
break;
}
nsIContent * child = end;
child->ChildAt(count-1, end);
NS_RELEASE(child);
end->ChildCount(count);
}
nsSelectionRange * range = mSelection->GetRange();