ptr = NS_STATIC_CAST(wallet_PrefillElement*, wallet_PrefillElement_list->ElementAt(i)); if (ptr->count) { if (ptr->inputElement) { ptr->inputElement->SetValue(*(ptr->value));
mapElementPtr = NS_STATIC_CAST(wallet_PrefillElement*, wallet_PrefillElement_list->ElementAt(i)); if (mapElementPtr->count) { if (mapElementPtr->inputElement) { mapElementPtr->inputElement->SetValue(*(mapElementPtr->value));
WLLT_Prefill(nsIPresShell* shell, PRBool quick, nsIDOMWindowInternal* win){  /* create list of elements that can be prefilled */  nsVoidArray *wallet_PrefillElement_list=new nsVoidArray();  if (!wallet_PrefillElement_list) {    return NS_ERROR_FAILURE;  }  nsAutoString urlName;  gEncryptionFailure = PR_FALSE;  wallet_TraversalForPrefill(win, wallet_PrefillElement_list, urlName);  /* return if no elements were put into the list */  if (LIST_COUNT(wallet_PrefillElement_list) == 0) {    if (!gEncryptionFailure) {      PRUnichar * message = Wallet_Localize("noPrefills");      wallet_Alert(message, win);      Recycle(message);    }    return NS_ERROR_FAILURE; // indicates to caller not to display preview screen  }  /* prefill each element using the list */  /* determine if url is on list of urls that should not be previewed */  PRBool noPreview = PR_FALSE;  if (!quick) {    wallet_InitializeURLList();    nsVoidArray* dummy;    nsAutoString value; value.AssignWithConversion("nn");    if (urlName.Length() != 0) {      wallet_ReadFromList(urlName, value, dummy, wallet_URL_list, PR_FALSE);      noPreview = (value.CharAt(NO_PREVIEW) == 'y');    }  }  /* determine if preview is necessary */  if (noPreview || quick) {    /* prefill each element without any preview for user verification */    wallet_PrefillElement * ptr;    PRInt32 count = LIST_COUNT(wallet_PrefillElement_list);    for (PRInt32 i=0; i<count; i++) {      ptr = NS_STATIC_CAST(wallet_PrefillElement*, wallet_PrefillElement_list->ElementAt(i));      if (ptr->count) {        if (ptr->inputElement) {          ptr->inputElement->SetValue(*(ptr->value));        } else {          ptr->selectElement->SetSelectedIndex(ptr->selectIndex);        }      }    }    /* go thru list just generated and release everything */    wallet_ReleasePrefillElementList(wallet_PrefillElement_list);    return NS_ERROR_FAILURE; // indicates to caller not to display preview screen  } else {    /* let user preview and verify the prefills first */    wallet_list = wallet_PrefillElement_list;    wallet_url = urlName;#ifdef DEBUG////wallet_DumpStopwatch();////wallet_ClearStopwatch();//wallet_DumpTiming();//wallet_ClearTiming();#endif    return NS_OK; // indicates that caller is to display preview screen  }}