nsresult res = AddItemToMenu(aRDFServ, aCCMan, aObjectArray, aContainer, &str); NS_ASSERTION(NS_SUCCEEDED(res), "failed to add item to menu");
for (PRInt32 i = 0; i < aCount; i++) { if ((aDecs[i] != NULL) && str.Equals(*aDecs[i])) break; }   if (i != aCount) { nsresult res = AddItemToMenu(aRDFServ, aCCMan, aObjectArray, aContainer, &str); NS_ASSERTION(NS_SUCCEEDED(res), "failed to add item to menu"); aDecs[i] = NULL; }
nsresult nsCharsetMenu::AddFromStringToMenu(char * aCharsetList,                                            nsIRDFService * aRDFServ,                                             nsICharsetConverterManager * aCCMan,                                             nsObjectArray * aObjectArray,                                             nsIRDFContainer * aContainer){  char * p = aCharsetList;  char * q = p;  while (*p != 0) {    for (; (*q != ',') && (*q != ' ') && (*q != 0); q++);    char temp = *q;    *q = 0;    nsAutoString str(p);    nsresult res = AddItemToMenu(aRDFServ, aCCMan, aObjectArray, aContainer, &str);    NS_ASSERTION(NS_SUCCEEDED(res), "failed to add item to menu");    *q = temp;    for (; (*q == ',') || (*q == ' '); q++);    p=q;  }  return NS_OK;}