nsTreeRowGroupFrame::GetVisibleRowCount(PRInt32& aCount, nsIContent* aParent) { PRInt32 childCount; aParent->ChildCount(childCount);  for (PRInt32 i = 0; i < childCount; i++) { nsCOMPtr<nsIContent> childContent; aParent->ChildAt(i, *getter_AddRefs(childContent)); nsCOMPtr<nsIAtom> tag; childContent->GetTag(*getter_AddRefs(tag)); if (tag.get() == nsXULAtoms::treerow) { aCount++; } else if (tag.get() == nsXULAtoms::treeitem) {  GetVisibleRowCount(aCount, childContent);   nsCOMPtr<nsIAtom> openAtom = dont_AddRef(NS_NewAtom("open")); nsString isOpen; childContent->GetAttribute(kNameSpaceID_None, openAtom, isOpen); if (isOpen == "true") {  PRInt32 childContentCount; nsCOMPtr<nsIContent> grandChild; childContent->ChildCount(childContentCount);  PRInt32 j; for (j = childContentCount-1; j >= 0; j--) {  childContent->ChildAt(j, *getter_AddRefs(grandChild)); nsCOMPtr<nsIAtom> grandChildTag; grandChild->GetTag(*getter_AddRefs(grandChildTag)); if (grandChildTag.get() == nsXULAtoms::treechildren) break; } if (j >= 0 && grandChild) GetVisibleRowCount(aCount, grandChild); } } } }
PRInt32 GetVisibleRowCount() { return mRowCount; };
nsTreeRowGroupFrame::GetVisibleRowCount(PRInt32& aCount, nsIContent* aParent){  PRInt32 childCount;  aParent->ChildCount(childCount);  for (PRInt32 i = 0; i < childCount; i++) {    nsCOMPtr<nsIContent> childContent;    aParent->ChildAt(i, *getter_AddRefs(childContent));    nsCOMPtr<nsIAtom> tag;    childContent->GetTag(*getter_AddRefs(tag));    if (tag.get() == nsXULAtoms::treerow) {      aCount++;    }    else if (tag.get() == nsXULAtoms::treeitem) {      // Descend into this row group and try to find the next row.      GetVisibleRowCount(aCount, childContent);      // If it's open, descend into its treechildren.      nsCOMPtr<nsIAtom> openAtom = dont_AddRef(NS_NewAtom("open"));      nsString isOpen;      childContent->GetAttribute(kNameSpaceID_None, openAtom, isOpen);      if (isOpen == "true") {        // Find the <treechildren> node.        PRInt32 childContentCount;        nsCOMPtr<nsIContent> grandChild;        childContent->ChildCount(childContentCount);        PRInt32 j;        for (j = childContentCount-1; j >= 0; j--) {                    childContent->ChildAt(j, *getter_AddRefs(grandChild));          nsCOMPtr<nsIAtom> grandChildTag;          grandChild->GetTag(*getter_AddRefs(grandChildTag));          if (grandChildTag.get() == nsXULAtoms::treechildren)            break;        }        if (j >= 0 && grandChild)          GetVisibleRowCount(aCount, grandChild);      }    }  }}