if (!options) { return; }  PRBool multiple; GetMultiple(&multiple);
if (!options) return;
nsNativeSelectControlFrame::Reset() {  nsIDOMHTMLCollection* options = GetOptions();  if (!options) {    return;  }  PRBool multiple;  GetMultiple(&multiple);  PRUint32 numOptions;  options->GetLength(&numOptions);  PRInt32 selectedIndex = -1;  nsIListWidget* listWidget;  nsresult result = mWidget->QueryInterface(kListWidgetIID, (void **) &listWidget);  if ((NS_OK == result) && listWidget) {    listWidget->Deselect();    for (PRUint32 i = 0; i < numOptions; i++) {      nsIDOMHTMLOptionElement* option = GetOption(*options, i);      if (option) {        PRBool selected = PR_FALSE;        // Cache the state of each option locally        option->GetDefaultSelected(&selected);        SetOptionSelected(i, selected);        if (selected) {          listWidget->SelectItem(i);          if (selectedIndex < 0)            selectedIndex = i;        }        NS_RELEASE(option);      }    }  }  // if none were selected, select 1st one if we are a combo box  if (mIsComboBox && (numOptions > 0) && (selectedIndex < 0)) {    listWidget->SelectItem(0);    SetOptionSelected(0, PR_TRUE);  }  NS_RELEASE(listWidget);  NS_RELEASE(options);}