nsITreeFrame* treeFrame = (nsITreeFrame*)frame;
nsCOMPtr<nsITreeFrame> treeFrame(do_QueryInterface(frame));
NS_IMETHODIMP nsTreeBoxObject::GetIndexOfItem(nsIDOMElement* aElement, PRInt32 *aResult){  *aResult = -1;  nsIFrame* frame = GetFrame();  if (!frame)    return NS_OK;  nsITreeFrame* treeFrame = (nsITreeFrame*)frame;   nsCOMPtr<nsIPresContext> presContext;  mPresShell->GetPresContext(getter_AddRefs(presContext));  return treeFrame->GetIndexOfItem(presContext, aElement, aResult);}