rv = aPrefs->GetIntPref(aPrefStr, fontPixelSize);
rv = aPrefs->GetIntPref(aPrefStr.get(), fontPixelSize);
nsresult GetMailNewsFont(MimeObject *obj, PRBool styleFixed, char *fontName, PRUint32 nameBuffSize,                          PRInt32 *fontPixelSize, PRInt32 *fontSizePercentage){  nsresult rv = NS_OK;  nsIPref *aPrefs = GetPrefServiceManager(obj->options);  if (aPrefs) {    MimeInlineText  *text = (MimeInlineText *) obj;    nsCAutoString aCharset;    PRUnichar *unicode = nsnull;    nsCAutoString convertedStr;    nsCAutoString variableFontType;   // serif, sans-serif    // get a charset    if (!text->charset || !(*text->charset))      aCharset.Assign("us-ascii");    else      aCharset.Assign(text->charset);    // get variable font type    char* variable_font_type = nsnull;    rv = aPrefs->CopyCharPref("font.default", &variable_font_type);    if (NS_FAILED(rv))      return rv;    if (!variable_font_type)      return NS_ERROR_FAILURE;    variableFontType.Assign(variable_font_type);    PR_FREEIF(variable_font_type);    // if indicated by the pref, do language sensitive font selection    PRBool  languageSensitiveFont = PR_FALSE;    rv = aPrefs->GetBoolPref("mailnews.language_sensitive_font", &languageSensitiveFont);    if (NS_SUCCEEDED(rv) && languageSensitiveFont) {      nsCOMPtr<nsICharsetConverterManager> aCharSets;      nsCOMPtr<nsIAtom> aLangGroup;      const PRUnichar* langGroup = nsnull;      nsCAutoString aPrefStr;            if (styleFixed) {        aPrefStr.Assign("font.name.monospace.");      }      else {        aPrefStr.Assign("font.name.");        aPrefStr.Append(variableFontType);        aPrefStr.Append(".");      }      aCharset.ToLowerCase();      aCharSets = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID);      if (!aCharSets)        return NS_ERROR_FAILURE;              // get a language, e.g. x-western, ja      nsAutoString u;      u.AssignWithConversion(aCharset);      rv = aCharSets->GetCharsetLangGroup(&u, getter_AddRefs(aLangGroup));      if (NS_FAILED(rv))        return rv;      rv = aLangGroup->GetUnicode(&langGroup);      if (NS_FAILED(rv))        return rv;        // append the language to the pref string      aPrefStr.AppendWithConversion(langGroup);      // get a font name from pref, could be non ascii (need charset conversion)      // this is not necessary if we insert this tag after the message is converted to UTF-8      rv = aPrefs->CopyUnicharPref(aPrefStr, &unicode);      if (NS_FAILED(rv))        return rv;     nsAutoString familyname(unicode);#if defined(XP_UNIX)     // extract "courier" from "adobe-courier-iso8859-1"     nsAutoString tmp;     familyname.Right(tmp, familyname.Length()-familyname.FindChar(PRUnichar('-'))-1);     tmp.Left(familyname, tmp.FindChar(PRUnichar('-')));#endif      rv = nsMsgI18NConvertFromUnicode(nsCAutoString("UTF-8"), familyname, convertedStr);      PR_FREEIF(unicode);      if (NS_FAILED(rv))        return rv;      if (convertedStr.Length() >= nameBuffSize)        return NS_ERROR_FAILURE;      PL_strcpy(fontName, convertedStr.get());      // get a font size from pref      aPrefStr.Assign(!styleFixed ? "font.size.variable." : "font.size.fixed.");      aPrefStr.AppendWithConversion(langGroup);      rv = aPrefs->GetIntPref(aPrefStr, fontPixelSize);      if (NS_FAILED(rv))        return rv;      // get original font size      PRInt32 originalSize;      rv = aPrefs->GetDefaultIntPref(aPrefStr, &originalSize);      if (NS_FAILED(rv))        return rv;      // calculate percentage      *fontSizePercentage = (PRInt32)((float)*fontPixelSize / (float)originalSize * 100);    }    // otherwise, use the mailnews font setting from pref    else {      // get a font name from pref, could be non ascii (need charset conversion)      // this is not necessary if we insert this tag after the message is converted to UTF-8      rv = aPrefs->CopyUnicharPref(!styleFixed ? "mailnews.font.name.html" : "mailnews.font.name.plain", &unicode);      if (NS_FAILED(rv))        return rv;      rv = nsMsgI18NConvertFromUnicode(nsCAutoString("UTF-8"), nsAutoString(unicode), convertedStr);      PR_FREEIF(unicode);      if (NS_FAILED(rv))        return rv;      if (convertedStr.Length() >= nameBuffSize)        return NS_ERROR_FAILURE;      PL_strcpy(fontName, convertedStr.get());      // get a font size from pref      rv = aPrefs->GetIntPref(!styleFixed ? "mailnews.font.size.html" : "mailnews.font.size.plain", fontPixelSize);      if (NS_FAILED(rv))        return rv;    }  }  return NS_OK;}