aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-12-17 05:54:34 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-12-17 05:54:34 +0800
commit9bc309a2f559996e370b140dfe7c40ef9d9965e0 (patch)
tree37067214c06f21091e9ae3ac9425497a28340bc7
parent711982b8ecc41893a8de17d29c1a9436204c591b (diff)
downloadgsoc2013-evolution-9bc309a2f559996e370b140dfe7c40ef9d9965e0.tar.gz
gsoc2013-evolution-9bc309a2f559996e370b140dfe7c40ef9d9965e0.tar.zst
gsoc2013-evolution-9bc309a2f559996e370b140dfe7c40ef9d9965e0.zip
Wrap the content with a table so that text isn't fully left-justified.
2002-12-16 Jeffrey Stedfast <fejj@ximian.com> * mail-format.c #define a STANDARD_ISSUE_TABLE_OPEN string used for wrapping textual message parts to keep them being fully-left justified. (mail_format_raw_message): Wrap the content with a table so that text isn't fully left-justified. (write_hr): Use it here too. (handle_text_plain): And finally here. svn path=/trunk/; revision=19141
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/mail-format.c17
2 files changed, 20 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index cf0bf9a72a..482dad554e 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,15 @@
2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
+ * mail-format.c #define a STANDARD_ISSUE_TABLE_OPEN string used
+ for wrapping textual message parts to keep them being fully-left
+ justified.
+ (mail_format_raw_message): Wrap the content with a table so that
+ text isn't fully left-justified.
+ (write_hr): Use it here too.
+ (handle_text_plain): And finally here.
+
+2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
+
* mail-display.c (mail_error_printf): Use camel_text_to_html()
instead of e_text_to_html().
(mail_text_write): Write the content directly to gtkhtml through
diff --git a/mail/mail-format.c b/mail/mail-format.c
index 7b7eabd2ee..fd77b06a74 100644
--- a/mail/mail-format.c
+++ b/mail/mail-format.c
@@ -52,6 +52,8 @@
#include "mail-crypto.h"
+#define STANDARD_ISSUE_TABLE_OPEN "<table cellspacing=0 cellpadding=10 width=\"100%\">"
+
static ssize_t mail_format_data_wrapper_write_to_stream (CamelDataWrapper *wrapper,
MailDisplay *mail_display,
CamelStream *stream);
@@ -189,12 +191,12 @@ mail_format_raw_message (CamelMimeMessage *mime_message, MailDisplay *md,
camel_stream_filter_add (filtered_stream, html_filter);
camel_object_unref (html_filter);
- camel_stream_write ((CamelStream *) stream, "<tt>", 4);
+ camel_stream_write_string ((CamelStream *) stream, STANDARD_ISSUE_TABLE_OPEN "<tr><td><tt>");
mail_format_data_wrapper_write_to_stream (wrapper, md, (CamelStream *) filtered_stream);
camel_object_unref (filtered_stream);
- camel_stream_write ((CamelStream *) stream, "</tt>", 5);
+ camel_stream_write_string ((CamelStream *) stream, "</tt></td></tr></table>");
}
static const char *
@@ -1166,8 +1168,8 @@ mail_format_get_data_wrapper_text (CamelDataWrapper *wrapper, MailDisplay *mail_
static void
write_hr (MailDisplayStream *stream)
{
- camel_stream_write_string ((CamelStream *) stream, "<table cellspacing=0 cellpadding=10 "
- "width=\"100%\"><tr><td width=\"100%\"><hr noshadow size=1>"
+ camel_stream_write_string ((CamelStream *) stream, STANDARD_ISSUE_TABLE_OPEN
+ "<tr><td width=\"100%\"><hr noshadow size=1>"
"</td></tr></table>\n");
}
@@ -1199,19 +1201,20 @@ handle_text_plain (CamelMimePart *part, const char *mime_type,
type = camel_mime_part_get_content_type (part);
format = header_content_type_param (type, "format");
if (format && !strcasecmp (format, "flowed"))
- flags |= 0 /*CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED*/;
+ flags |= CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED;
html_filter = camel_mime_filter_tohtml_new (flags, colour);
filtered_stream = camel_stream_filter_new_with_stream ((CamelStream *) stream);
camel_stream_filter_add (filtered_stream, html_filter);
camel_object_unref (html_filter);
- camel_stream_write ((CamelStream *) stream, "<tt>\n", 5);
+ camel_stream_write_string ((CamelStream *) stream, STANDARD_ISSUE_TABLE_OPEN "<tr><td><tt>\n");
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
mail_format_data_wrapper_write_to_stream (wrapper, md, (CamelStream *) filtered_stream);
- camel_stream_write ((CamelStream *) stream, "</tt>\n", 6);
+ camel_stream_write_string ((CamelStream *) stream, "</tt></td></tr></table>\n");
+
camel_object_unref (filtered_stream);
return TRUE;