[evolution-patches] Fix for bug #48290:Selecting inverse theme causes text to be printed white-on-white



Hello All,

Please review my two patchs for bug #48290? The first one is apply to trunk and the second one is apply to 1.4 branch.

My patch will set the default text color before gtkhtml create object tree for printing preview, then gtkhtml will use the color to create text object, rather than using the default text color of gtk style. In inverse theme, the default text color of gtk style is white.

Bug summary:
       Selecting inverse theme causes text to be printed white-on-white
Bug link:
       http://bugzilla.ximian.com/show_bug.cgi?id=48290

Thanks
Antonio Xu
Index: mail/mail-display.c =================================================================== RCS file: /cvs/gnome/evolution/mail/mail-display.c,v retrieving revision 1.293 diff -p -u -r1.293 mail-display.c --- mail/mail-display.c 26 Aug 2003 18:17:57 -0000 1.293 +++ mail/mail-display.c 10 Sep 2003 08:02:47 -0000 @@ -1929,6 +1929,7 @@ mail_display_render (MailDisplay *md, Gt const char *flag, *completed; GtkHTMLStream *html_stream; MailDisplayStream *stream; + char *body; g_return_if_fail (IS_MAIL_DISPLAY (md)); g_return_if_fail (GTK_IS_HTML (html)); @@ -1947,10 +1948,14 @@ mail_display_render (MailDisplay *md, Gt gtk_html_stream_write (html_stream, HTML_HEADER, sizeof (HTML_HEADER) - 1); if (md->current_message && md->display_style == MAIL_CONFIG_DISPLAY_SOURCE) - gtk_html_stream_write (html_stream, "\n", 7); + body = g_strdup_printf("%s%s%s", "printing ? " text=\"#000000\"" : "", ">\n"); else - gtk_html_stream_write (html_stream, "\n", 36); + body = g_strdup_printf("%s%s%s", "printing ? " text=\"#000000\"" : "", ">\n"); + gtk_html_stream_write (html_stream, body, strlen(body)); + g_free(body); 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; if ((flag && *flag) && !(completed && *completed)) { Index: mail/ChangeLog =================================================================== RCS file: /cvs/gnome/evolution/mail/ChangeLog,v retrieving revision 1.2798 diff -p -u -p -r1.2798 ChangeLog --- mail/ChangeLog 26 Aug 2003 18:17:56 -0000 1.2798 +++ mail/ChangeLog 10 Sep 2003 08:04:44 -0000 @@ -1,3 +1,8 @@ +2003-09-10 Antonio Xu + + * mail-display.c (mail_display_render): Set default text color as + black in body when doing printing preview. Fixs bug #48290. + 2003-08-22 Not Zed * mail-format.c (write_date): translate the local time format.
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.2761.2.17
diff -u -p -r1.2761.2.17 ChangeLog
--- mail/ChangeLog	28 Aug 2003 18:20:09 -0000	1.2761.2.17
+++ mail/ChangeLog	10 Sep 2003 07:54:58 -0000
@@ -1,3 +1,8 @@
+2003-09-10  Antonio Xu  <antonio xu sun com>
+
+	* mail-display.c (mail_display_render): Set default text color as
+	black in body when doing printing preview. Fixs bug #48290.
+
 2003-08-28  Jeffrey Stedfast  <fejj ximian com>
 
 	* mail-display.c (on_link_clicked): Don't pass cid: nor
Index: mail/mail-display.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-display.c,v
retrieving revision 1.282.4.6
diff -u -p -r1.282.4.6 mail-display.c
--- mail/mail-display.c	28 Aug 2003 18:20:10 -0000	1.282.4.6
+++ mail/mail-display.c	10 Sep 2003 07:55:07 -0000
@@ -1801,6 +1801,7 @@ mail_display_render (MailDisplay *md, Gt
 	const char *flag, *completed;
 	GtkHTMLStream *html_stream;
 	MailDisplayStream *stream;
+	char *body;
 
 	g_return_if_fail (IS_MAIL_DISPLAY (md));
 	g_return_if_fail (GTK_IS_HTML (html));
@@ -1819,10 +1820,14 @@ mail_display_render (MailDisplay *md, Gt
 	gtk_html_stream_write (html_stream, HTML_HEADER, sizeof (HTML_HEADER) - 1);
 	
 	if (md->current_message && md->display_style == MAIL_CONFIG_DISPLAY_SOURCE)
-		gtk_html_stream_write (html_stream, "<body>\n", 7);
+		body = g_strdup_printf("%s%s%s", "<body",
+                                                  md->printing ? " text=\"#000000\"" : "", ">\n");
 	else
-		gtk_html_stream_write (html_stream, "<body marginwidth=0 marginheight=0>\n", 36);
+		body = g_strdup_printf("%s%s%s", "<body marginwidth=0 marginheight=0",
+                                                  md->printing ? " text=\"#000000\"" : "", ">\n");
 	
+	gtk_html_stream_write (html_stream, body, strlen(body));
+	g_free(body);
 	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;
 	if ((flag && *flag) && !(completed && *completed)) {


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