res = AddFromPrefsToMenu(NULL, container, kMaileditPrefKey, encs, NULL);
NS_WITH_SERVICE(nsIPref, pref, NS_PREF_PROGID, &res); if (NS_FAILED(res)) return res;  char * prefKey = "intl.charsetmenu.mailedit"; res = AddFromPrefsToMenu(pref, rdfServ, ccMan, NULL, container, prefKey, encs, NULL);
nsresult nsCharsetMenu::InitMaileditMenu() {  nsresult res = NS_OK;  nsCOMPtr<nsISupportsArray> encs;  res = mCCManager->GetEncoderList(getter_AddRefs(encs));  if (NS_FAILED(res)) return res;  nsCOMPtr<nsIRDFContainer> container;  res = NewRDFContainer(mInner, kNC_MaileditCharsetMenuRoot, getter_AddRefs(container));  if (NS_FAILED(res)) return res;  res = AddFromPrefsToMenu(NULL, container, kMaileditPrefKey, encs, NULL);  NS_ASSERTION(NS_SUCCEEDED(res), "error initializing mailedit charset menu from prefs");  // register prefs callback  res = mPrefService->AddObserver(kMaileditPrefKey, mCharsetMenuObserver);  return res;}