Fix for bug #32212.

git-svn-id: svn://10.0.0.236/trunk@63289 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
hyatt%netscape.com
2000-03-17 11:27:01 +00:00
parent 782cf9f297
commit 66123cf87d
2 changed files with 44 additions and 19 deletions

View File

@@ -1387,27 +1387,10 @@ nsMenuFrame::GetBoxInfo(nsIPresContext* aPresContext, const nsHTMLReflowState& a
aSize.prefSize.width = childInfo.prefSize.width;
}
// This retrieval guarantess that the selectedItem will
// be set before we lay out.
nsCOMPtr<nsIDOMElement> element;
menulist->GetSelectedItem(getter_AddRefs(element));
if (!element) {
nsAutoString value;
menulist->GetValue(value);
if (value == "") {
nsCOMPtr<nsIContent> child;
GetMenuChildrenElement(getter_AddRefs(child));
if (child) {
PRInt32 count;
child->ChildCount(count);
if (count > 0) {
nsCOMPtr<nsIContent> item;
child->ChildAt(0, *getter_AddRefs(item));
nsCOMPtr<nsIDOMElement> selectedElement(do_QueryInterface(item));
if (selectedElement)
menulist->SetSelectedItem(selectedElement);
}
}
}
}
}
return rv;
}