nsresult rv = NS_ERROR_FAILURE;  nsCOMPtr<nsIPref> prefs (do_GetService(NS_PREF_CONTRACTID)); if (prefs) { rv = prefs->GetIntPref("mailnews.reply_header_type", reply_header_type); if (NS_FAILED(rv)) *reply_header_type = 1;  rv = prefs->CopyUnicharPref("mailnews.reply_header_locale", reply_header_locale); if (NS_FAILED(rv) || !*reply_header_locale) *reply_header_locale = nsCRT::strdup(EmptyString().get());  rv = prefs->GetLocalizedUnicharPref("mailnews.reply_header_authorwrote", reply_header_authorwrote); if (NS_FAILED(rv) || !*reply_header_authorwrote) *reply_header_authorwrote = nsCRT::strdup(NS_LITERAL_STRING("%s wrote").get());  rv = prefs->GetLocalizedUnicharPref("mailnews.reply_header_ondate", reply_header_ondate); if (NS_FAILED(rv) || !*reply_header_ondate) *reply_header_ondate = nsCRT::strdup(NS_LITERAL_STRING("On %s").get());  rv = prefs->CopyUnicharPref("mailnews.reply_header_separator", reply_header_separator); if (NS_FAILED(rv) || !*reply_header_separator) *reply_header_separator = nsCRT::strdup(NS_LITERAL_STRING(", ").get());  rv = prefs->CopyUnicharPref("mailnews.reply_header_colon", reply_header_colon); if (NS_FAILED(rv) || !*reply_header_colon) *reply_header_colon = nsCRT::strdup(NS_LITERAL_STRING(":").get());  rv = prefs->GetLocalizedUnicharPref("mailnews.reply_header_originalmessage", reply_header_originalmessage); if (NS_FAILED(rv) || !*reply_header_originalmessage) *reply_header_originalmessage = nsCRT::strdup(NS_LITERAL_STRING("--- Original Message ---").get());
nsresult  rv; nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));  *reply_header_type = 1; if(NS_SUCCEEDED(rv)) { prefBranch->GetIntPref("mailnews.reply_header_type", reply_header_type);  NS_GetUnicharPreferenceWithDefault(prefBranch, "mailnews.reply_header_locale", EmptyString(), reply_header_locale); NS_GetLocalizedUnicharPreferenceWithDefault(prefBranch, "mailnews.reply_header_authorwrote", NS_LITERAL_STRING("%s wrote"), reply_header_authorwrote); NS_GetLocalizedUnicharPreferenceWithDefault(prefBranch, "mailnews.reply_header_ondate", NS_LITERAL_STRING("On %s"), reply_header_ondate); NS_GetUnicharPreferenceWithDefault(prefBranch, "mailnews.reply_header_separator", NS_LITERAL_STRING(", "), reply_header_separator); NS_GetUnicharPreferenceWithDefault(prefBranch, "mailnews.reply_header_colon", NS_LITERAL_STRING(":"), reply_header_colon); NS_GetLocalizedUnicharPreferenceWithDefault(prefBranch, "mailnews.reply_header_originalmessage", NS_LITERAL_STRING("--- Original Message ---"), reply_header_originalmessage);
static nsresult GetReplyHeaderInfo(PRInt32* reply_header_type,                                    PRUnichar** reply_header_locale,                                   PRUnichar** reply_header_authorwrote,                                   PRUnichar** reply_header_ondate,                                   PRUnichar** reply_header_separator,                                   PRUnichar** reply_header_colon,                                   PRUnichar** reply_header_originalmessage){  nsresult rv = NS_ERROR_FAILURE;  nsCOMPtr<nsIPref> prefs (do_GetService(NS_PREF_CONTRACTID));  if (prefs) {    rv = prefs->GetIntPref("mailnews.reply_header_type", reply_header_type);    if (NS_FAILED(rv))      *reply_header_type = 1;    rv = prefs->CopyUnicharPref("mailnews.reply_header_locale", reply_header_locale);    if (NS_FAILED(rv) || !*reply_header_locale)      *reply_header_locale = nsCRT::strdup(EmptyString().get());    rv = prefs->GetLocalizedUnicharPref("mailnews.reply_header_authorwrote", reply_header_authorwrote);    if (NS_FAILED(rv) || !*reply_header_authorwrote)      *reply_header_authorwrote = nsCRT::strdup(NS_LITERAL_STRING("%s wrote").get());    rv = prefs->GetLocalizedUnicharPref("mailnews.reply_header_ondate", reply_header_ondate);    if (NS_FAILED(rv) || !*reply_header_ondate)      *reply_header_ondate = nsCRT::strdup(NS_LITERAL_STRING("On %s").get());    rv = prefs->CopyUnicharPref("mailnews.reply_header_separator", reply_header_separator);    if (NS_FAILED(rv) || !*reply_header_separator)      *reply_header_separator = nsCRT::strdup(NS_LITERAL_STRING(", ").get());    rv = prefs->CopyUnicharPref("mailnews.reply_header_colon", reply_header_colon);    if (NS_FAILED(rv) || !*reply_header_colon)      *reply_header_colon = nsCRT::strdup(NS_LITERAL_STRING(":").get());    rv = prefs->GetLocalizedUnicharPref("mailnews.reply_header_originalmessage", reply_header_originalmessage);    if (NS_FAILED(rv) || !*reply_header_originalmessage)      *reply_header_originalmessage = nsCRT::strdup(NS_LITERAL_STRING("--- Original Message ---").get());  }  return rv;}