nsIListBox* listBox;
void nsSelectControlFrame::GetOptionSelectedFromWidget(PRInt32 index, PRBool* aValue){  nsIListBox* listBox;  *aValue = PR_FALSE;  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);      PRUint32 i;      for (i = 0; i < numSelected; i++) {        if (selOptions[i] == index) {          *aValue = PR_TRUE;          break;        }      }      delete[] selOptions;    }    NS_RELEASE(listBox);  }}