From 6cde624508affa75a530fd92a5d6d2af167e59be Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 21 Nov 2002 10:57:47 +0000 Subject: applied patches from http://bugzilla.ximian.com/show_bug.cgi?id=29588 svn path=/trunk/; revision=18877 --- mail/mail-display.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'mail/mail-display.c') diff --git a/mail/mail-display.c b/mail/mail-display.c index c74a0f7b37..8fcefc3604 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -1646,8 +1646,13 @@ mail_display_redisplay_when_loaded (MailDisplay *md, } void -mail_text_write (GtkHTML *html, GtkHTMLStream *stream, gboolean printing, const char *text) +mail_text_write (GtkHTML *html, GtkHTMLStream *stream, MailDisplay *md, CamelMimePart *part, gint idx, gboolean printing, const char *text) { + GByteArray *ba; + gchar *xed, *iframe; + gchar *btt = "\n"; + gchar *ett = "\n"; + guint flags; char *htmltext; @@ -1661,10 +1666,17 @@ mail_text_write (GtkHTML *html, GtkHTMLStream *stream, gboolean printing, const htmltext = e_text_to_html_full (text, flags, mail_config_get_citation_color ()); - gtk_html_write (html, stream, "", 4); - gtk_html_write (html, stream, htmltext, strlen (htmltext)); - gtk_html_write (html, stream, "", 5); + ba = g_byte_array_new (); + g_byte_array_append (ba, (const guint8 *) btt, strlen (btt) + 1); + g_byte_array_append (ba, (const guint8 *) htmltext, strlen (htmltext) + 1); + g_byte_array_append (ba, (const guint8 *) ett, strlen (ett) + 1); g_free (htmltext); + + xed = g_strdup_printf ("x-evolution-data:%p-%d", part, idx); + iframe = g_strdup_printf ("", xed, xed); + mail_display_add_url (md, "data_urls", xed, ba); + gtk_html_write (html, stream, iframe, strlen (iframe)); + g_free (iframe); } void @@ -1710,7 +1722,10 @@ mail_display_render (MailDisplay *md, GtkHTML *html, gboolean reset_scroll) "\n" "\n" "\n\n\n"); - mail_html_write (html, stream, "\n"); + if (md->current_message && md->display_style == MAIL_CONFIG_DISPLAY_SOURCE) + mail_html_write (html, stream, "\n"); + else + mail_html_write (html, stream, "\n"); flag = md->info ? camel_tag_get (&md->info->user_tags, "follow-up") : NULL; completed = md->info ? camel_tag_get (&md->info->user_tags, "completed-on") : NULL; -- cgit