[evolution-patches] patch for 316280: evolution contact print use fixed page size, print to A5 or toher size will fail



Sushma Rai,
It's a patch for bug 316280, pls review it and apply it to 2.4 and 1.4.6.

As the bug described, if user select a A5 paper, some info will be missed because of the size of pager is incorrect.

Regards.

-Steven Zhang.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.2003
diff -u -r1.2003 ChangeLog
--- ChangeLog	22 Oct 2005 09:11:04 -0000	1.2003
+++ ChangeLog	24 Oct 2005 12:14:51 -0000
@@ -1,3 +1,13 @@
+2005-10-24 Evan Yan <evan yan sun com>
+
+	* pinting/e-contact-print.c (e_contact_build_style):
+	Add a config argument to get the actual page size and set it to style.
+	(e_contact_print_response): modify the call to e_contact_build_style
+	accordingly.
+	(e_contact_print_preview): modify the call to e_contact_build_style
+	accordingly.
+	Fixes # 316280
+
 2005-10-22  Sushma Rai  <rsushma novell com>
 
 	* gui/widgets/eab-gui-util.c (eab_send_contact_list_as_attachment): 
Index: printing/e-contact-print.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/printing/e-contact-print.c,v
retrieving revision 1.51
diff -u -r1.51 e-contact-print.c
--- printing/e-contact-print.c	3 Oct 2005 08:56:20 -0000	1.51
+++ printing/e-contact-print.c	24 Oct 2005 12:15:00 -0000
@@ -34,6 +34,8 @@
 #include <libgnome/gnome-i18n.h>
 #include <libgnomeui/gnome-dialog.h>
 #include <libgnomeprint/gnome-print.h>
+#include <libgnomeprint/gnome-print-unit.h>
+#include <libgnomeprint/gnome-print-config.h>
 #include <libgnomeprint/gnome-font.h>
 #include <libgnomeprint/gnome-print-job.h>
 #include <libgnomeprintui/gnome-print-dialog.h>
@@ -714,10 +716,11 @@
 
 
 static void
-e_contact_build_style(EContactPrintStyle *style)
+e_contact_build_style(EContactPrintStyle *style, GnomePrintConfig *config)
 {
 	xmlDocPtr styledoc;
 	gchar *filename;
+	gdouble page_height, page_width;
 
 	style->title = g_strdup("");
 	style->type = E_CONTACT_PRINT_TYPE_CARDS;
@@ -845,6 +848,15 @@
 		}
 		xmlFreeDoc(styledoc);
 	}
+
+	/*
+	 * get paper size and set it to the print style
+	 */
+	gnome_print_config_get_page_size(config, &page_width, &page_height);
+	gnome_print_convert_distance(&page_width, gnome_print_unit_get_default(), gnome_print_unit_get_by_name("Inches"));
+	gnome_print_convert_distance(&page_height, gnome_print_unit_get_default(), gnome_print_unit_get_by_name("Inches"));
+	style->page_height = page_height;
+	style->page_width = page_width;
 }
 
 static gint
@@ -896,7 +908,7 @@
 		config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG(dialog));
 		master = gnome_print_job_new( config );
 		pc = gnome_print_job_get_context( master );
-		e_contact_build_style(style);
+		e_contact_build_style(style, config);
 		
 		ctxt->x = 0;
 		ctxt->y = 0;
@@ -942,7 +954,7 @@
 		config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG(dialog));
 		master = gnome_print_job_new( config );
 		pc = gnome_print_job_get_context( master );
-		e_contact_build_style(style);
+		e_contact_build_style(style, config);
 		
 		ctxt->x = 0;
 		ctxt->y = 0;
@@ -1048,7 +1060,7 @@
 	config = e_print_load_config ();
 	master = gnome_print_job_new (config);
 	pc = gnome_print_job_get_context (master);
-	e_contact_build_style (style);
+	e_contact_build_style (style, config);
 
 	if (list == NULL) {
 		uses_book = TRUE;


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