NS_WITH_SERVICE(nsIRDFService, rdfServ, kRDFServiceCID, &res); if (NS_FAILED(res)) return res;
nsresult nsCharsetMenu::SetCharsetCheckmark(nsString * aCharset,                                             PRBool aValue){  nsresult res = NS_OK;  nsCOMPtr<nsIRDFContainer> container;  nsCOMPtr<nsIRDFResource> node;  NS_WITH_SERVICE(nsIRDFService, rdfServ, kRDFServiceCID, &res);  if (NS_FAILED(res)) return res;  res = NewRDFContainer(mInner, kNC_BrowserCharsetMenuRoot, getter_AddRefs(container));  if (NS_FAILED(res)) return res;  // find RDF node for given charset  char csID[256];  aCharset->ToCString(csID, sizeof(csID));  res = rdfServ->GetResource(csID, getter_AddRefs(node));  if (NS_FAILED(res)) return res;  // set checkmark value  nsCOMPtr<nsIRDFLiteral> checkedLiteral;  nsAutoString checked((aValue == PR_TRUE) ? "true" : "false");  res = rdfServ->GetLiteral(checked.GetUnicode(), getter_AddRefs(checkedLiteral));  if (NS_FAILED(res)) return res;  res = Assert(node, kNC_Checked, checkedLiteral, PR_TRUE);  if (NS_FAILED(res)) return res;  return res;}