PRInt32 index = listWidget->GetSelectedIndex();
PRInt32 indx = listWidget->GetSelectedIndex();
nsSelectControlFrame::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,                                     nsString* aValues, nsString* aNames){  aNumValues = 0;  nsAutoString name;  nsresult result = GetName(&name);  if ((aMaxNumValues <= 0) || (NS_CONTENT_ATTR_NOT_THERE == result)) {    return PR_FALSE;  }  nsIDOMHTMLCollection* options = GetOptions();  if (!options) {    return PR_FALSE;  }  PRBool status = PR_FALSE;  PRBool multiple;  GetMultiple(&multiple);  if (!multiple) {    nsIListWidget* listWidget;    result = mWidget->QueryInterface(kListWidgetIID, (void **) &listWidget);    if ((NS_OK == result) && listWidget) {      PRInt32 index = listWidget->GetSelectedIndex();      NS_RELEASE(listWidget);      if (index >= 0) {        nsAutoString value;        GetOptionValue(*options, index, value);        aNumValues = 1;        aNames[0]  = name;        aValues[0] = value;        status = PR_TRUE;      }    }   } else {    nsIListBox* listBox;    nsresult result = mWidget->QueryInterface(kListBoxIID, (void **) &listBox);    if ((NS_OK == result) && listBox) {      PRInt32 numSelections = listBox->GetSelectedCount();      NS_ASSERTION(aMaxNumValues >= numSelections, "invalid max num values");      if (numSelections >= 0) {        PRInt32* selections = new PRInt32[numSelections];        listBox->GetSelectedIndices(selections, numSelections);        aNumValues = 0;        for (int i = 0; i < numSelections; i++) {          nsAutoString value;          GetOptionValue(*options, selections[i], value);          aNames[i]  = name;          aValues[i] = value;          aNumValues++;        }        delete[] selections;        status = PR_TRUE;      }      NS_RELEASE(listBox);    }  }  NS_RELEASE(options);  return status;}