evolution r35650 - in trunk: . mail



Author: mcrha
Date: Wed Jun 18 16:43:02 2008
New Revision: 35650
URL: http://svn.gnome.org/viewvc/evolution?rev=35650&view=rev

Log:
2008-06-18  Milan Crha  <mcrha redhat com>

	** Fix for bug #423395

	* configure.in: Requires newer GtkHTML, 3.23.5.

	* mail/em-format-html.c: (efh_init), (efh_text_plain), (efh_text_enriched),
	(efh_text_html), (efh_message_deliverystatus): Put the anchor where
	the message body begins and let GtkHTML know the anchor name to place
	the cursor there in caret mode on the first focus.



Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/mail/ChangeLog
   trunk/mail/em-format-html.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Wed Jun 18 16:43:02 2008
@@ -17,7 +17,7 @@
 m4_define([gnome_icon_theme_minimum_version], [2.19.91])
 m4_define([libbonobo_minimum_version], [2.20.3])
 m4_define([libbonoboui_minimum_version], [2.4.2])
-m4_define([libgtkhtml_minimum_version], [3.19.1])
+m4_define([libgtkhtml_minimum_version], [3.23.5])
 m4_define([gconf_minimum_version], [2.0.0])             # XXX Just a Guess
 m4_define([libglade_minimum_version], [2.0.0])          # XXX Just a Guess
 m4_define([libgnomecanvas_minimum_version], [2.0.0])    # XXX Just a Guess

Modified: trunk/mail/em-format-html.c
==============================================================================
--- trunk/mail/em-format-html.c	(original)
+++ trunk/mail/em-format-html.c	Wed Jun 18 16:43:02 2008
@@ -85,6 +85,8 @@
 #define d(x)
 
 #define EFH_TABLE_OPEN "<table>"
+#define EFM_MESSAGE_START_ANAME "evolution#message#start"
+#define EFH_MESSAGE_START "<A name=\"" EFM_MESSAGE_START_ANAME "\"></A>"
 
 struct _EMFormatHTMLCache {
 	CamelMultipart *textmp;
@@ -153,6 +155,7 @@
 
 	efh->html = (GtkHTML *)gtk_html_new();
 	gtk_html_set_blocking(efh->html, FALSE);
+	gtk_html_set_caret_first_focus_anchor (efh->html, EFM_MESSAGE_START_ANAME);
 	g_object_ref_sink(efh->html);
 
 	gtk_html_set_default_content_type(efh->html, "text/html; charset=utf-8");
@@ -799,7 +802,7 @@
 			camel_stream_printf (stream,
    					"<div style=\"border: solid #%06x 1px; background-color: #%06x; padding: 10px; color: #%06x;\">\n",
 					     efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff, efh->text_colour & 0xffffff);
-			camel_stream_write_string(stream, "<tt>\n");
+			camel_stream_write_string(stream, "<tt>\n" EFH_MESSAGE_START);
 			em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, (CamelDataWrapper *)newpart);
 			camel_stream_flush((CamelStream *)filtered_stream);
 			camel_stream_write_string(stream, "</tt>\n");
@@ -837,7 +840,7 @@
 	camel_object_unref(enriched);
 
 	camel_stream_printf (stream,
-			     "<div style=\"border: solid #%06x 1px; background-color: #%06x; padding: 10px; color: #%06x;\">\n",
+			     "<div style=\"border: solid #%06x 1px; background-color: #%06x; padding: 10px; color: #%06x;\">\n" EFH_MESSAGE_START,
 			     efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff, efh->text_colour & 0xffffff);
 
 	em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, (CamelDataWrapper *)part);
@@ -875,7 +878,7 @@
 
 	camel_stream_printf (stream,
 			     "<div style=\"border: solid #%06x 1px; background-color: #%06x; color: #%06x;\">\n"
-			     "<!-- text/html -->\n",
+			     "<!-- text/html -->\n" EFH_MESSAGE_START,
 			     efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff, efh->text_colour & 0xffffff);
 
 	/* TODO: perhaps we don't need to calculate this anymore now base is handled better */
@@ -1022,7 +1025,7 @@
 	camel_stream_filter_add(filtered_stream, html_filter);
 	camel_object_unref(html_filter);
 
-	camel_stream_write_string(stream, "<tt>\n");
+	camel_stream_write_string(stream, "<tt>\n" EFH_MESSAGE_START);
 	em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, (CamelDataWrapper *)part);
 	camel_stream_flush((CamelStream *)filtered_stream);
 	camel_stream_write_string(stream, "</tt>\n");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]