if (error == 0) GetOptionSelectedFromWidget(indx, &selected);
GetOptionSelectedCache(indx, &selected);
NS_IMETHODIMP nsNativeSelectControlFrame::GetProperty(nsIAtom* aName, nsString& aValue){  // Get the selected value of option from local cache (optimization vs. widget)  if (nsHTMLAtoms::selected == aName) {    PRInt32 error = 0;    PRBool selected = PR_FALSE;    PRInt32 indx = aValue.ToInteger(&error, 10); // Get index from aValue    if (error == 0)      GetOptionSelectedFromWidget(indx, &selected);    nsFormControlHelper::GetBoolString(selected, aValue);      // For selectedIndex, get the value from the widget  } else  if (nsHTMLAtoms::selectedindex == aName) {    PRInt32 selectedIndex = -1;    PRBool multiple;    GetMultiple(&multiple);    if (!multiple) {      nsIListWidget* listWidget;      nsresult result = mWidget->QueryInterface(kListWidgetIID, (void **) &listWidget);      if ((NS_OK == result) && (nsnull != listWidget)) {        selectedIndex = listWidget->GetSelectedIndex();        NS_RELEASE(listWidget);      }    } else {      // Listboxes don't do GetSelectedIndex on windows.  Use GetSelectedIndices      nsIListBox* listBox;      nsresult result = mWidget->QueryInterface(kListBoxIID, (void **) &listBox);      if ((NS_OK == result) && (nsnull != listBox)) {        PRUint32 numSelected = listBox->GetSelectedCount();        PRInt32* selOptions = nsnull;        if (numSelected > 0) {          // Could we set numSelected to 1 here? (memory, speed optimization)          selOptions = new PRInt32[numSelected];          listBox->GetSelectedIndices(selOptions, numSelected);          selectedIndex = selOptions[0];          delete[] selOptions;        }        NS_RELEASE(listBox);      }    }    aValue.Append(selectedIndex, 10);  } else {    return Inherited::GetProperty(aName, aValue);  }  return NS_OK;}