nsCOMPtr<nsIRDFContainer> container; res = NewRDFContainer(mInner, kNC_ComposerCharsetMenuRoot, getter_AddRefs(container));
NS_WITH_SERVICE(nsICharsetConverterManager2, ccMan, kCharsetConverterManagerCID, &res); if (NS_FAILED(res)) return res;  nsCOMPtr<nsISupportsArray> decs; res = ccMan->GetDecoderList(getter_AddRefs(decs));
nsresult nsCharsetMenu::InitComposerMenu() {  nsresult res = NS_OK;  nsCOMPtr<nsISupportsArray> decs;  res = mCCManager->GetDecoderList(getter_AddRefs(decs));  if (NS_FAILED(res)) return res;  nsCOMPtr<nsIRDFContainer> container;  res = NewRDFContainer(mInner, kNC_ComposerCharsetMenuRoot, getter_AddRefs(container));  if (NS_FAILED(res)) return res;  // even if we fail, the show must go on  res = InitStaticMenu(decs, kNC_ComposerCharsetMenuRoot,     kComposerStaticPrefKey, &mComposerMenu);  NS_ASSERTION(NS_SUCCEEDED(res), "error initializing composer static charset menu");  // mark the end of the static area, the rest is cache  mComposerCacheStart = mComposerMenu.Count();  mPrefService->GetIntPref(kComposerCacheSizePrefKey, &mComposerCacheSize);  // compute the position of the menu in the RDF container  res = container->GetCount(&mComposerMenuRDFPosition);  if (NS_FAILED(res)) return res;  // this "1" here is a correction necessary because the RDF container   // elements are numbered from 1 (why god, WHY?!?!?!)  mComposerMenuRDFPosition -= mComposerCacheStart - 1;  res = InitCacheMenu(decs, kNC_ComposerCharsetMenuRoot,     kComposerCachePrefKey, &mComposerMenu);  NS_ASSERTION(NS_SUCCEEDED(res), "error initializing composer cache charset menu");  return res;}