result = wallet_GetSelectIndex(ptr->selectElement, next, ptr->selectIndex);
result = wallet_GetSelectIndex(mapElementPtr->selectElement, next, mapElementPtr->selectIndex);
WLLT_PrefillReturn(const nsString& results){  PRUnichar* listAsAscii;  PRUnichar* fillins;  PRUnichar* urlName;  PRUnichar* skip;  nsAutoString next;  /* get values that are in environment variables */  fillins = SI_FindValueInArgs(results, NS_ConvertToString("|fillins|"));  listAsAscii = SI_FindValueInArgs(results, NS_ConvertToString("|list|"));  skip = SI_FindValueInArgs(results, NS_ConvertToString("|skip|"));  urlName = SI_FindValueInArgs(results, NS_ConvertToString("|url|"));  /* add url to url list if user doesn't want to preview this page in the future */  if (nsAutoString(skip).EqualsWithConversion("true")) {    nsAutoString url = nsAutoString(urlName);    nsVoidArray* dummy;    nsAutoString value; value.AssignWithConversion("nn");    wallet_ReadFromList(url, value, dummy, wallet_URL_list, PR_FALSE);    value.SetCharAt('y', NO_PREVIEW);    if (wallet_WriteToList(url, value, dummy, wallet_URL_list, PR_FALSE, DUP_OVERWRITE)) {      wallet_WriteToFile(URLFileName, wallet_URL_list);    }  }  /* process the list, doing the fillins */  nsVoidArray * list;  PRInt32 error;  list = (nsVoidArray *)nsAutoString(listAsAscii).ToInteger(&error);  if (fillins[0] == '\0') { /* user pressed CANCEL */    wallet_ReleasePrefillElementList(list);    return;  }  /*   * note: there are two lists involved here and we are stepping through both of them.   * One is the pre-fill list that was generated when we walked through the html content.   * For each pre-fillable item, it contains n entries, one for each possible value that   * can be prefilled for that field.  The first entry for each field can be identified   * because it has a non-zero count field (in fact, the count is the number of entries   * for that field), all subsequent entries for the same field have a zero count field.   * The other is the fillin list which was generated by the html dialog that just   * finished.  It contains one entry for each pre-fillable item specificying that   * particular value that should be prefilled for that item.   */  wallet_PrefillElement * ptr;  nsAutoString ptr2 = nsAutoString(fillins);  /* step through pre-fill list */  PRInt32 count = LIST_COUNT(list);  for (PRInt32 i=0; i<count; i++) {    ptr = NS_STATIC_CAST(wallet_PrefillElement*, list->ElementAt(i));    /* advance in fillins list each time a new schema name in pre-fill list is encountered */    if (ptr->count != 0) {      /* count != 0 indicates a new schema name */      nsAutoString tail;      if (wallet_GetNextInString(ptr2, next, tail) == -1) {        break;      }      ptr2 = tail;      if (next != *ptr->schema) {        break; /* something's wrong so stop prefilling */      }      wallet_GetNextInString(ptr2, next, tail);      ptr2 = tail;    }    if (next == *ptr->value) {      /*       * Remove entry from wallet_SchemaToValue_list and then reinsert.  This will       * keep multiple values in that list for the same field ordered with       * most-recently-used first.  That's useful since the first such entry       * is the default value used for pre-filling.       */      /*       * Test for ptr->count being zero is an optimization that avoids us from doing a       * reordering if the current entry already was first       */      if (ptr->count == 0) {        nsAutoString oldValue;        PRInt32 index = 0;        PRInt32 lastIndex = index;        nsVoidArray* dummy;        while(wallet_ReadFromList(*ptr->schema, oldValue, dummy, wallet_SchemaToValue_list, PR_TRUE, index)) {          if (oldValue == *ptr->value) {            wallet_MapElement * mapElement =              (wallet_MapElement *) (wallet_SchemaToValue_list->ElementAt(lastIndex));            wallet_SchemaToValue_list->RemoveElementAt(lastIndex);            wallet_WriteToList(              mapElement->item1,              mapElement->item2,              mapElement->itemList,              wallet_SchemaToValue_list,              PR_FALSE); /* note: obscure=false, otherwise we will obscure an obscured value */            delete mapElement;            break;          }          lastIndex = index;        }      }    }    /* Change the value */     if ((next == *ptr->value) || ((ptr->count>0) && next.IsEmpty())) {       if (((next == *ptr->value) || next.IsEmpty()) && ptr->inputElement) {         ptr->inputElement->SetValue(next);       } else {         nsresult result;         result = wallet_GetSelectIndex(ptr->selectElement, next, ptr->selectIndex);         if (NS_SUCCEEDED(result)) {           ptr->selectElement->SetSelectedIndex(ptr->selectIndex);         } else {           ptr->selectElement->SetSelectedIndex(0);        }      }    }  }  /* Release the prefill list that was generated when we walked thru the html content */  wallet_ReleasePrefillElementList(list);}