*aValue = -1;
nsHTMLSelectElement::GetSelectedIndex(PRInt32* aValue){  nsIFormControlFrame* formControlFrame = nsnull;  if (NS_OK == GetPrimaryFrame(formControlFrame)) {    nsString value;    formControlFrame->GetProperty(nsHTMLAtoms::selectedindex, value);    NS_RELEASE(formControlFrame);    if (value.Length() > 0) {      PRInt32 retval = 0;      PRInt32 error = 0;      retval = value.ToInteger(&error, 10); // Convert to integer, base 10      if (!error) {        *aValue = retval;        return NS_OK;      }    }  }  *aValue = -1; // If no selectedIndex was to be had, make it -1 (none selected)  return NS_OK;}