nsCOMPtr<nsISupportsArray> decs; res = ccMan->GetDecoderList(getter_AddRefs(decs)); if (NS_FAILED(res)) return res;  NS_WITH_SERVICE(nsIPref, pref, NS_PREF_PROGID, &res); if (NS_FAILED(res)) return res;  res = AddFromPrefsToMenu(pref, rdfServ, ccMan, &mMailviewMenu, container, kMailviewStaticPrefKey, decs, "charset.");
nsCStringArray decs; SetArrayFromEnumerator(decoders, decs);  res = AddFromPrefsToMenu(&mMailviewMenu, container, kMailviewStaticPrefKey, decs, "charset.");
nsresult nsCharsetMenu::RefreshMailviewMenu(){  nsresult res = NS_OK;  NS_WITH_SERVICE(nsIRDFService, rdfServ, kRDFServiceCID, &res);  if (NS_FAILED(res)) return res;  nsCOMPtr<nsIRDFContainer> container;  res = NewRDFContainer(mInner, kNC_MailviewCharsetMenuRoot, getter_AddRefs(container));  if (NS_FAILED(res)) return res;  // clean the menu  res = ClearMenu(rdfServ, container, &mMailviewMenu);  if (NS_FAILED(res)) return res;  // rebuild the menu  NS_WITH_SERVICE(nsICharsetConverterManager2, ccMan, kCharsetConverterManagerCID, &res);  if (NS_FAILED(res)) return res;  nsCOMPtr<nsISupportsArray> decs;  res = ccMan->GetDecoderList(getter_AddRefs(decs));  if (NS_FAILED(res)) return res;  NS_WITH_SERVICE(nsIPref, pref, NS_PREF_PROGID, &res);  if (NS_FAILED(res)) return res;  res = AddFromPrefsToMenu(pref, rdfServ, ccMan, &mMailviewMenu, container,     kMailviewStaticPrefKey, decs, "charset.");  NS_ASSERTION(NS_SUCCEEDED(res), "error initializing static charset menu from prefs");  // mark the end of the static area, the rest is cache  mMailviewCacheStart = mMailviewMenu.Count();  res = InitCacheMenu(rdfServ, ccMan, pref, decs, kNC_MailviewCharsetMenuRoot,     kMailviewCachePrefKey, &mMailviewMenu);  NS_ASSERTION(NS_SUCCEEDED(res), "error initializing mailview cache charset menu");  return res;}