Fixing my while loops. They could crash under rare circumstances.

git-svn-id: svn://10.0.0.236/trunk@40653 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
hyatt%netscape.com
1999-07-22 10:06:38 +00:00
parent b6aba20dee
commit 1e949b447e
2 changed files with 18 additions and 12 deletions

View File

@@ -4128,14 +4128,15 @@ nsCSSFrameConstructor::ContentAppended(nsIPresContext* aPresContext,
tag.get() == nsXULAtoms::treeitem)) {
// Walk up to the outermost tree row group frame and tell it that
// content was added.
nsCOMPtr<nsIContent> parent = dont_QueryInterface(aContainer);
nsCOMPtr<nsIContent> parent;
nsCOMPtr<nsIContent> child = dont_QueryInterface(aContainer);
child->GetParent(*getter_AddRefs(parent));
while (parent) {
child->GetParent(*getter_AddRefs(parent));
parent->GetTag(*getter_AddRefs(tag));
if (tag.get() == nsXULAtoms::tree)
break;
child = parent;
child->GetParent(*getter_AddRefs(parent));
}
if (parent) {
@@ -4345,14 +4346,15 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
tag.get() == nsXULAtoms::treeitem)) {
// Walk up to the outermost tree row group frame and tell it that
// content was added.
nsCOMPtr<nsIContent> parent = dont_QueryInterface(aContainer);
nsCOMPtr<nsIContent> parent;
nsCOMPtr<nsIContent> child = dont_QueryInterface(aContainer);
child->GetParent(*getter_AddRefs(parent));
while (parent) {
child->GetParent(*getter_AddRefs(parent));
parent->GetTag(*getter_AddRefs(tag));
if (tag.get() == nsXULAtoms::tree)
break;
child = parent;
child->GetParent(*getter_AddRefs(parent));
}
if (parent) {
@@ -4665,14 +4667,15 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext,
// has been removed (so that we can update the scrollbar state).
// Walk up to the outermost tree row group frame and tell it that
// content was removed.
nsCOMPtr<nsIContent> parent = dont_QueryInterface(aContainer);
nsCOMPtr<nsIContent> parent;
nsCOMPtr<nsIContent> child = dont_QueryInterface(aContainer);
child->GetParent(*getter_AddRefs(parent));
while (parent) {
child->GetParent(*getter_AddRefs(parent));
parent->GetTag(*getter_AddRefs(tag));
if (tag.get() == nsXULAtoms::tree)
break;
child = parent;
child->GetParent(*getter_AddRefs(parent));
}
if (parent) {