Index: ChangeLog =================================================================== RCS file: /cvs/gnome/gnumeric/ChangeLog,v retrieving revision 1.3666 diff -u -I'$Id.*$' -u -p -r1.3666 ChangeLog --- ChangeLog 20 Nov 2004 06:10:35 -0000 1.3666 +++ ChangeLog 20 Nov 2004 12:06:07 -0000 @@ -1,3 +1,17 @@ +2004-11-20 J.H.M. Dassen (Ray) + + * src/print-info.h: Add "paper_width" and "paper_height" to struct + PrintInformation, to support paper sizes for which gnome-print doesn't + have a name. + * src/print-info.c (print_info_make_config): Use paper_width and + paper_height when there is no paper name. + * src/print-info.c (print_info_set_paper_width, + print_info_set_paper_height, print_info_get_paper_width, + print_info_get_paper_height): New, get and set functions for + paper_width and paper_height. + * src/print-info.c (print_info_free, print_info_new, print_info_dup): + Extended to handle the two fields added to struct PrintInformation. + 2004-11-19 Jody Goldberg * configure.in : Add ssindex but leave it disabled by default because Index: plugins/excel/ChangeLog =================================================================== RCS file: /cvs/gnome/gnumeric/plugins/excel/ChangeLog,v retrieving revision 1.902 diff -u -I'$Id.*$' -u -p -r1.902 ChangeLog --- plugins/excel/ChangeLog 19 Nov 2004 17:39:43 -0000 1.902 +++ plugins/excel/ChangeLog 20 Nov 2004 12:06:09 -0000 @@ -1,3 +1,8 @@ +2004-11-20 J.H.M. Dassen (Ray) + + * ms-excel-read.c (excel_read_SETUP): Also import paper sizes for which + gnome-print doesn't have names. + 2004-11-19 Emmanuel Pacaud * ms-chart.c (BC_R(radararea)): type of area radar is Index: plugins/excel/ms-excel-read.c =================================================================== RCS file: /cvs/gnome/gnumeric/plugins/excel/ms-excel-read.c,v retrieving revision 1.627 diff -u -I'$Id.*$' -u -p -r1.627 ms-excel-read.c --- plugins/excel/ms-excel-read.c 16 Nov 2004 04:19:19 -0000 1.627 +++ plugins/excel/ms-excel-read.c 20 Nov 2004 12:06:09 -0000 @@ -3969,11 +3969,12 @@ excel_read_SETUP (BiffQuery *q, ExcelRea if (papersize < PAPER_NAMES_LEN) { guchar *paper_name = (guchar *)paper_size_table[papersize].gp_name; guchar *paper_width = (guchar *)paper_size_table[papersize].gp_width; - guchar *paper_height = (guchar *)paper_size_table[papersize].gp_width; + guchar *paper_height = (guchar *)paper_size_table[papersize].gp_height; if (paper_name != NULL) { print_info_set_paper (pi, paper_name); } else if ((paper_width != NULL) && (paper_height != NULL)) { - g_warning ("No gnome-print name for paper size %s x %s - ignoring", paper_width, paper_height); + print_info_set_paper_width(pi, paper_width); + print_info_set_paper_height(pi, paper_height); } } } Index: src/print-info.c =================================================================== RCS file: /cvs/gnome/gnumeric/src/print-info.c,v retrieving revision 1.101 diff -u -I'$Id.*$' -u -p -r1.101 print-info.c --- src/print-info.c 19 Oct 2004 17:00:57 -0000 1.101 +++ src/print-info.c 20 Nov 2004 12:06:11 -0000 @@ -121,6 +121,8 @@ print_info_free (PrintInformation *pi) print_hf_free (pi->footer); g_free (pi->paper); + g_free (pi->paper_width); + g_free (pi->paper_height); g_free (pi->gp_config_str); g_free (pi); } @@ -267,6 +269,8 @@ print_info_new (void) pi->n_copies = 1; pi->gp_config_str = NULL; pi->paper = NULL; + pi->paper_width = NULL; + pi->paper_height = NULL; return pi; } @@ -629,6 +633,10 @@ print_info_dup (PrintInformation const * dst_pi->gp_config_str = g_strdup (src_pi->gp_config_str); g_free (dst_pi->paper); dst_pi->paper = g_strdup (src_pi->paper); + g_free (dst_pi->paper_width); + dst_pi->paper_width = g_strdup (src_pi->paper_width); + g_free (dst_pi->paper_height); + dst_pi->paper_height = g_strdup (src_pi->paper_height); return dst_pi; } @@ -703,12 +711,38 @@ print_info_set_paper (PrintInformation * g_free (pi->paper); pi->paper = g_strdup (paper); } +void +print_info_set_paper_width (PrintInformation *pi, char const *paper_width) +{ + g_return_if_fail (pi != NULL); + g_free (pi->paper_width); + pi->paper_width = g_strdup (paper_width); +} +void +print_info_set_paper_height (PrintInformation *pi, char const *paper_height) +{ + g_return_if_fail (pi != NULL); + g_free (pi->paper_height); + pi->paper_height = g_strdup (paper_height); +} char const * print_info_get_paper (PrintInformation const *pi) { g_return_val_if_fail (pi != NULL, "A4"); return pi->paper; } +char const * +print_info_get_paper_width (PrintInformation const *pi) +{ + g_return_val_if_fail (pi != NULL, "210mm"); + return pi->paper_width; +} +char const * +print_info_get_paper_height (PrintInformation const *pi) +{ + g_return_val_if_fail (pi != NULL, "297mm"); + return pi->paper_height; +} void print_info_set_orientation (PrintInformation *pi, PrintOrientation orient) @@ -732,8 +766,15 @@ print_info_make_config (PrintInformation ? gnome_print_config_from_string (gnm_app_prefs->printer_config, 0) : gnome_print_config_default ()); - if (NULL != pi->paper) + if (NULL != pi->paper) { gnome_print_config_set (res, GNOME_PRINT_KEY_PAPER_SIZE, pi->paper); + } else { + if ((NULL != pi->paper_width) && (NULL != pi->paper_height)) { + gnome_print_config_set (res, GNOME_PRINT_KEY_PAPER_SIZE, "Custom"); + gnome_print_config_set (res, GNOME_PRINT_KEY_PAPER_WIDTH, pi->paper_width); + gnome_print_config_set (res, GNOME_PRINT_KEY_PAPER_HEIGHT, pi->paper_height); + } + } gnome_print_config_set_length (res, GNOME_PRINT_KEY_PAGE_MARGIN_TOP, pi->margins.header, GNOME_PRINT_PS_UNIT); gnome_print_config_set_length (res, GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM, Index: src/print-info.h =================================================================== RCS file: /cvs/gnome/gnumeric/src/print-info.h,v retrieving revision 1.37 diff -u -I'$Id.*$' -u -p -r1.37 print-info.h --- src/print-info.h 17 Oct 2004 00:33:48 -0000 1.37 +++ src/print-info.h 20 Nov 2004 12:06:11 -0000 @@ -90,6 +90,7 @@ struct _PrintInformation { int n_copies; char *gp_config_str; char *paper; + char *paper_width, *paper_height; }; typedef enum { @@ -135,7 +136,11 @@ void print_shutdown (vo void print_info_set_n_copies (PrintInformation *pi, int copies); guint print_info_get_n_copies (PrintInformation const *pi); void print_info_set_paper (PrintInformation *pi, char const *paper); +void print_info_set_paper_width (PrintInformation *pi, char const *paper_width); +void print_info_set_paper_height (PrintInformation *pi, char const *paper_height); char const *print_info_get_paper (PrintInformation const *pi); +char const *print_info_get_paper_width (PrintInformation const *pi); +char const *print_info_get_paper_height (PrintInformation const *pi); void print_info_get_margins (PrintInformation const *pi, double *header, double *footer, double *left, double *right); void print_info_set_margins (PrintInformation *pi,