Added mail/news font setting by prefs (no UI yet) to libmime, bug 26182.
git-svn-id: svn://10.0.0.236/trunk@66306 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1808,13 +1808,16 @@ done:
|
||||
PR_FREEIF(unicode);
|
||||
PR_FREEIF(fontName);
|
||||
}
|
||||
// if nothing has been written then write out just "<div>" to match with "</div>"
|
||||
if (status == -1)
|
||||
status = MimeObject_write(obj, "<div>\n", 6, PR_FALSE);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int EndMailNewsFont(MimeObject *obj)
|
||||
{
|
||||
char buf[] = "</div>";
|
||||
char buf[] = "</div>\n";
|
||||
return MimeObject_write(obj, buf, nsCRT::strlen(buf), PR_FALSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "prlog.h"
|
||||
#include "msgCore.h"
|
||||
#include "nsMimeStringResources.h"
|
||||
#include "mimemoz2.h"
|
||||
|
||||
#define MIME_SUPERCLASS mimeInlineTextClass
|
||||
MimeDefClass(MimeInlineTextHTML, MimeInlineTextHTMLClass,
|
||||
@@ -55,6 +56,10 @@ MimeInlineTextHTML_parse_begin (MimeObject *obj)
|
||||
|
||||
if (!obj->output_p) return 0;
|
||||
|
||||
if (nsMimeOutput::nsMimeMessageBodyDisplay == obj->options->format_out ||
|
||||
nsMimeOutput::nsMimeMessagePrintOutput == obj->options->format_out)
|
||||
status = BeginMailNewsFont(obj, "mailnews.font.name.serif", "mailnews.size.variable");
|
||||
|
||||
MimeInlineTextHTML *textHTML = (MimeInlineTextHTML *) obj;
|
||||
|
||||
textHTML->charset = nsnull;
|
||||
@@ -206,6 +211,10 @@ MimeInlineTextHTML_parse_eof (MimeObject *obj, PRBool abort_p)
|
||||
status = ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_eof(obj, abort_p);
|
||||
if (status < 0) return status;
|
||||
|
||||
if (nsMimeOutput::nsMimeMessageBodyDisplay == obj->options->format_out ||
|
||||
nsMimeOutput::nsMimeMessagePrintOutput == obj->options->format_out)
|
||||
status = EndMailNewsFont(obj);
|
||||
|
||||
if (obj->output_p &&
|
||||
obj->options &&
|
||||
obj->options->write_html_p &&
|
||||
|
||||
@@ -73,6 +73,10 @@ MimeInlineTextPlainFlowed_parse_begin (MimeObject *obj)
|
||||
status = MimeObject_write(obj, s, 0, PR_TRUE); /* force out any separators... */
|
||||
if(status<0) return status;
|
||||
|
||||
if (nsMimeOutput::nsMimeMessageBodyDisplay == obj->options->format_out ||
|
||||
nsMimeOutput::nsMimeMessagePrintOutput == obj->options->format_out)
|
||||
status = BeginMailNewsFont(obj, "mailnews.font.name.mono", "mailnews.size.fixed");
|
||||
|
||||
// Setup the data structure that is connected to the actual document
|
||||
// Saved in a linked list in case this is called with several documents
|
||||
// at the same time.
|
||||
@@ -194,6 +198,10 @@ MimeInlineTextPlainFlowed_parse_eof (MimeObject *obj, PRBool abort_p)
|
||||
#endif
|
||||
}
|
||||
|
||||
if (nsMimeOutput::nsMimeMessageBodyDisplay == obj->options->format_out ||
|
||||
nsMimeOutput::nsMimeMessagePrintOutput == obj->options->format_out)
|
||||
status = EndMailNewsFont(obj);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,10 @@ MimeInlineTextPlain_parse_begin (MimeObject *obj)
|
||||
|
||||
if (!obj->output_p) return 0;
|
||||
|
||||
if (nsMimeOutput::nsMimeMessageBodyDisplay == obj->options->format_out ||
|
||||
nsMimeOutput::nsMimeMessagePrintOutput == obj->options->format_out)
|
||||
status = BeginMailNewsFont(obj, "mailnews.font.name.mono", "mailnews.size.fixed");
|
||||
|
||||
if (obj->options &&
|
||||
obj->options->write_html_p &&
|
||||
obj->options->output_fn)
|
||||
@@ -213,6 +217,10 @@ MimeInlineTextPlain_parse_eof (MimeObject *obj, PRBool abort_p)
|
||||
if (status < 0) return status;
|
||||
}
|
||||
|
||||
if (nsMimeOutput::nsMimeMessageBodyDisplay == obj->options->format_out ||
|
||||
nsMimeOutput::nsMimeMessagePrintOutput == obj->options->format_out)
|
||||
status = EndMailNewsFont(obj);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user