mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
one more time! this time don't look inside templates, instead look inside <treechildren> of trees
r=scottip
This commit is contained in:
parent
bc6eaeface
commit
e533d87b8a
@ -450,10 +450,29 @@ nsXULTreeElement::GetRowIndexOf(nsIDOMXULElement *aElement, PRInt32 *aReturn)
|
||||
elementTag.get() == kTreeChildrenAtom ||
|
||||
elementTag.get() == kTreeItemAtom)
|
||||
descendIntoRows = PR_FALSE;
|
||||
|
||||
// now begin with the first <treechildren> child of this node
|
||||
PRInt32 i;
|
||||
PRInt32 treeChildCount;
|
||||
nsCOMPtr<nsIContent> treeChildren;
|
||||
treeContent->ChildCount(treeChildCount);
|
||||
for (i=0; i<treeChildCount; i++) {
|
||||
treeChildren = null_nsCOMPtr();
|
||||
treeContent->ChildAt(i, *getter_AddRefs(treeChildren));
|
||||
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
treeChildren->GetTag(*getter_AddRefs(tag));
|
||||
if (tag.get() == kTreeChildrenAtom)
|
||||
break;
|
||||
}
|
||||
|
||||
if (treeChildren)
|
||||
return IndexOfContent(treeChildren, elementContent,
|
||||
descendIntoRows, PR_TRUE /* aParentIsOpen */,
|
||||
aReturn);
|
||||
|
||||
return IndexOfContent(treeContent, elementContent,
|
||||
descendIntoRows, PR_TRUE /* aParentIsOpen */,
|
||||
aReturn);
|
||||
NS_WARNING("EnsureContentVisible: tree has no <treechildren>");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -450,10 +450,29 @@ nsXULTreeElement::GetRowIndexOf(nsIDOMXULElement *aElement, PRInt32 *aReturn)
|
||||
elementTag.get() == kTreeChildrenAtom ||
|
||||
elementTag.get() == kTreeItemAtom)
|
||||
descendIntoRows = PR_FALSE;
|
||||
|
||||
// now begin with the first <treechildren> child of this node
|
||||
PRInt32 i;
|
||||
PRInt32 treeChildCount;
|
||||
nsCOMPtr<nsIContent> treeChildren;
|
||||
treeContent->ChildCount(treeChildCount);
|
||||
for (i=0; i<treeChildCount; i++) {
|
||||
treeChildren = null_nsCOMPtr();
|
||||
treeContent->ChildAt(i, *getter_AddRefs(treeChildren));
|
||||
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
treeChildren->GetTag(*getter_AddRefs(tag));
|
||||
if (tag.get() == kTreeChildrenAtom)
|
||||
break;
|
||||
}
|
||||
|
||||
if (treeChildren)
|
||||
return IndexOfContent(treeChildren, elementContent,
|
||||
descendIntoRows, PR_TRUE /* aParentIsOpen */,
|
||||
aReturn);
|
||||
|
||||
return IndexOfContent(treeContent, elementContent,
|
||||
descendIntoRows, PR_TRUE /* aParentIsOpen */,
|
||||
aReturn);
|
||||
NS_WARNING("EnsureContentVisible: tree has no <treechildren>");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user