nsCOMPtr<nsIAtom> tag; aParent->GetTag(*getter_AddRefs(tag)); if (tag.get() == nsXULAtoms::outlinerbody) { *aResult = aParent; NS_IF_ADDREF(*aResult); } else { PRInt32 count; aParent->ChildCount(count); for (PRInt32 i = 0; i < count; i++) { nsCOMPtr<nsIContent> child; aParent->ChildAt(i, *getter_AddRefs(child)); FindBodyElement(child, aResult);
ChildIterator iter, last; for (ChildIterator::Init(aParent, &iter, &last); iter != last; ++iter) { nsCOMPtr<nsIContent> content = *iter; nsCOMPtr<nsIAtom> tag; content->GetTag(*getter_AddRefs(tag)); if (tag.get() == nsXULAtoms::outlinerbody) { *aResult = content; NS_ADDREF(*aResult); break; } else { FindBodyElement(content, aResult);
static void FindBodyElement(nsIContent* aParent, nsIContent** aResult){  nsCOMPtr<nsIAtom> tag;  aParent->GetTag(*getter_AddRefs(tag));  if (tag.get() == nsXULAtoms::outlinerbody) {    *aResult = aParent;    NS_IF_ADDREF(*aResult);  }  else {    PRInt32 count;    aParent->ChildCount(count);    for (PRInt32 i = 0; i < count; i++) {      nsCOMPtr<nsIContent> child;      aParent->ChildAt(i, *getter_AddRefs(child));      FindBodyElement(child, aResult);      if (*aResult)        break;    }  }}