Commit f5b71727 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Use even_if_only_styles. (print_page) : Ditto. (print_sheet) : Ditto.


2001-02-15  Jody Goldberg <jgoldberg@home.com>

	* src/print.c (compute_sheet_pages) : Use even_if_only_styles.
	(print_page) : Ditto.
	(print_sheet) : Ditto.

	* src/xml-io.c (xml_write_print_info) : Support 'even_if_only_styles'
	(xml_read_print_info) : Ditto.
	* src/dialogs/dialog-printer-setup.c (do_fetch_page_info) : ditto.
	(do_setup_page_info) : Ditto.
	* src/print-info.c (print_info_copy) : ditto.
	(print_info_new) : ditto.
	(print_info_save) : ditto.
parent 6d53c227
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/print.c (compute_sheet_pages) : Use even_if_only_styles.
(print_page) : Ditto.
(print_sheet) : Ditto.
* src/xml-io.c (xml_write_print_info) : Support 'even_if_only_styles'
(xml_read_print_info) : Ditto.
* src/dialogs/dialog-printer-setup.c (do_fetch_page_info) : ditto.
(do_setup_page_info) : Ditto.
* src/print-info.c (print_info_copy) : ditto.
(print_info_new) : ditto.
(print_info_save) : ditto.
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/cell-draw.c (cell_draw) : Support indents for left/right
alignment.
* src/cellspan.c (cell_calc_span) : Support indents when calculating
spans.
* src/rendered-value.c (cell_rendered_offset) : new function
2001-02-15 Almer S. Tigelaar <almer1@dds.nl>
* preview-grid-controller.c
......
......@@ -12,6 +12,7 @@ Jody:
* Fix stupid memory corruption problem in the applix importer.
* Some mis-translations for spanish.
* Improve pixel matching of XL import.
* Add option to manage printing ranges with only styles.
Jon Kåre:
* Improve file save dialog.
......
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/print.c (compute_sheet_pages) : Use even_if_only_styles.
(print_page) : Ditto.
(print_sheet) : Ditto.
* src/xml-io.c (xml_write_print_info) : Support 'even_if_only_styles'
(xml_read_print_info) : Ditto.
* src/dialogs/dialog-printer-setup.c (do_fetch_page_info) : ditto.
(do_setup_page_info) : Ditto.
* src/print-info.c (print_info_copy) : ditto.
(print_info_new) : ditto.
(print_info_save) : ditto.
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/cell-draw.c (cell_draw) : Support indents for left/right
alignment.
* src/cellspan.c (cell_calc_span) : Support indents when calculating
spans.
* src/rendered-value.c (cell_rendered_offset) : new function
2001-02-15 Almer S. Tigelaar <almer1@dds.nl>
* preview-grid-controller.c
......
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/print.c (compute_sheet_pages) : Use even_if_only_styles.
(print_page) : Ditto.
(print_sheet) : Ditto.
* src/xml-io.c (xml_write_print_info) : Support 'even_if_only_styles'
(xml_read_print_info) : Ditto.
* src/dialogs/dialog-printer-setup.c (do_fetch_page_info) : ditto.
(do_setup_page_info) : Ditto.
* src/print-info.c (print_info_copy) : ditto.
(print_info_new) : ditto.
(print_info_save) : ditto.
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/cell-draw.c (cell_draw) : Support indents for left/right
alignment.
* src/cellspan.c (cell_calc_span) : Support indents when calculating
spans.
* src/rendered-value.c (cell_rendered_offset) : new function
2001-02-15 Almer S. Tigelaar <almer1@dds.nl>
* preview-grid-controller.c
......
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/print.c (compute_sheet_pages) : Use even_if_only_styles.
(print_page) : Ditto.
(print_sheet) : Ditto.
* src/xml-io.c (xml_write_print_info) : Support 'even_if_only_styles'
(xml_read_print_info) : Ditto.
* src/dialogs/dialog-printer-setup.c (do_fetch_page_info) : ditto.
(do_setup_page_info) : Ditto.
* src/print-info.c (print_info_copy) : ditto.
(print_info_new) : ditto.
(print_info_save) : ditto.
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/cell-draw.c (cell_draw) : Support indents for left/right
alignment.
* src/cellspan.c (cell_calc_span) : Support indents when calculating
spans.
* src/rendered-value.c (cell_rendered_offset) : new function
2001-02-15 Almer S. Tigelaar <almer1@dds.nl>
* preview-grid-controller.c
......
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/print.c (compute_sheet_pages) : Use even_if_only_styles.
(print_page) : Ditto.
(print_sheet) : Ditto.
* src/xml-io.c (xml_write_print_info) : Support 'even_if_only_styles'
(xml_read_print_info) : Ditto.
* src/dialogs/dialog-printer-setup.c (do_fetch_page_info) : ditto.
(do_setup_page_info) : Ditto.
* src/print-info.c (print_info_copy) : ditto.
(print_info_new) : ditto.
(print_info_save) : ditto.
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/cell-draw.c (cell_draw) : Support indents for left/right
alignment.
* src/cellspan.c (cell_calc_span) : Support indents when calculating
spans.
* src/rendered-value.c (cell_rendered_offset) : new function
2001-02-15 Almer S. Tigelaar <almer1@dds.nl>
* preview-grid-controller.c
......
......@@ -3522,7 +3522,7 @@ ms_excel_read_sheet (BiffQuery *q, ExcelWorkbook *wb, WorkbookView *wb_view,
break;
case BIFF_PRINTGRIDLINES :
pi->print_line_divisions = (MS_OLE_GET_GUINT16 (q->data) == 1);
pi->print_grid_lines = (MS_OLE_GET_GUINT16 (q->data) == 1);
break;
case BIFF_GRIDSET:
......
......@@ -2913,7 +2913,7 @@ write_sheet_bools (BiffPut *bp, ExcelSheet *sheet)
/* See: S59DCF.HTM */
data = ms_biff_put_len_next (bp, BIFF_PRINTGRIDLINES, 2);
MS_OLE_SET_GUINT16 (data, pi->print_line_divisions);
MS_OLE_SET_GUINT16 (data, pi->print_grid_lines);
ms_biff_put_commit (bp);
/* See: S59D91.HTM */
......
......@@ -272,7 +272,7 @@ cell_draw (Cell const *cell, MStyle const *mstyle,
halign = cell_default_halign (cell, mstyle);
if (halign != HALIGN_JUSTIFY && valign != VALIGN_JUSTIFY &&
!mstyle_get_fit_in_cell (mstyle)) {
int x, total, len = cell_width_pixel;
int x, offset, len = cell_width_pixel;
switch (halign) {
case HALIGN_FILL:
......@@ -280,11 +280,12 @@ cell_draw (Cell const *cell, MStyle const *mstyle,
/* fall through */
case HALIGN_LEFT:
x = rect.x;
x = rect.x + cell_rendered_offset (cell);
break;
case HALIGN_RIGHT:
x = rect.x + rect.width - 1 - cell_width_pixel;
x = rect.x + rect.width - 1 - cell_width_pixel -
cell_rendered_offset (cell);
break;
case HALIGN_CENTER:
......@@ -297,7 +298,6 @@ cell_draw (Cell const *cell, MStyle const *mstyle,
x = rect.x;
}
total = 0;
draw_text (drawable, font, gc, x, text_base,
text, strlen (text), len, line_offset, num_lines);
} else {
......
......@@ -90,6 +90,7 @@ void cell_set_format (Cell *cell, char const *format);
void cell_render_value (Cell *cell, gboolean dynamic_width);
int cell_rendered_width (Cell const * cell);
int cell_rendered_offset (Cell const * cell);
int cell_rendered_height (Cell const * cell);
char * cell_get_rendered_text (Cell const * cell);
char * cell_get_entered_text (Cell const * cell);
......
......@@ -245,7 +245,8 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
case HALIGN_LEFT:
*col1 = *col2 = cell->pos.col;
pos = cell->pos.col + 1;
left = cell_width_pixel - COL_INTERNAL_WIDTH (cell->col_info);
left = cell_width_pixel + cell_rendered_offset (cell) -
COL_INTERNAL_WIDTH (cell->col_info);
margin = cell->col_info->margin_b;
for (; left > 0 && pos < max_col; pos++){
......@@ -270,7 +271,8 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
case HALIGN_RIGHT:
*col1 = *col2 = cell->pos.col;
pos = cell->pos.col - 1;
left = cell_width_pixel - COL_INTERNAL_WIDTH (cell->col_info);
left = cell_width_pixel + cell_rendered_offset (cell) -
COL_INTERNAL_WIDTH (cell->col_info);
margin = cell->col_info->margin_a;
for (; left > 0 && pos >= min_col; pos--){
......
......@@ -824,14 +824,13 @@
<class>GtkLabel</class>
<name>label50</name>
<sensitive>False</sensitive>
<label>Left _Indent</label>
<label>_Indent</label>
<justify>GTK_JUSTIFY_RIGHT</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>16</xpad>
<ypad>0</ypad>
<focus_target>halign_left_indent</focus_target>
<child>
<padding>0</padding>
<expand>False</expand>
......@@ -855,7 +854,7 @@
<widget>
<class>GtkSpinButton</class>
<name>halign_left_indent</name>
<name>halign_indent</name>
<can_focus>True</can_focus>
<climb_rate>1</climb_rate>
<digits>0</digits>
......@@ -1027,6 +1026,19 @@
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>align_merge</name>
<can_focus>True</can_focus>
<label>_Merge</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</widget>
......
......@@ -35,7 +35,7 @@ gchar *s = N_("_Center");
gchar *s = N_("_Left");
gchar *s = N_("_General");
gchar *s = N_("Center _across selection");
gchar *s = N_("Left _Indent");
gchar *s = N_("_Indent");
gchar *s = N_("Vertical Alignment");
gchar *s = N_("_Top");
gchar *s = N_("C_enter");
......@@ -44,7 +44,7 @@ gchar *s = N_("J_ustify");
gchar *s = N_("Control");
gchar *s = N_("_Wrap text");
gchar *s = N_("Shrin_k to fit");
gchar *s = N_("_Merge Cells");
gchar *s = N_("_Merge");
gchar *s = N_("Orientation");
gchar *s = N_("Unfinished");
gchar *s = N_("Alignment");
......
......@@ -1021,7 +1021,8 @@ display_order_icon (GtkToggleButton *toggle, PrinterSetupState *state)
static void
do_setup_page_info (PrinterSetupState *state)
{
GtkWidget *divisions = glade_xml_get_widget (state->gui, "check-print-divisions");
GtkWidget *gridlines = glade_xml_get_widget (state->gui, "check-grid-lines");
GtkWidget *onlystyles= glade_xml_get_widget (state->gui, "check-only-styles");
GtkWidget *bw = glade_xml_get_widget (state->gui, "check-black-white");
GtkWidget *titles = glade_xml_get_widget (state->gui, "check-print-titles");
GtkWidget *order_rd = glade_xml_get_widget (state->gui, "radio-order-right");
......@@ -1046,8 +1047,11 @@ do_setup_page_info (PrinterSetupState *state)
gtk_signal_connect (GTK_OBJECT (order_rd), "toggled", GTK_SIGNAL_FUNC (display_order_icon), state);
if (state->pi->print_line_divisions)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (divisions), TRUE);
if (state->pi->print_grid_lines)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gridlines), TRUE);
if (state->pi->print_even_if_only_styles)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (onlystyles), TRUE);
if (state->pi->print_black_and_white)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (bw), TRUE);
......@@ -1416,8 +1420,11 @@ do_fetch_page_info (PrinterSetupState *state)
Value *top_range, *left_range;
GtkEntry *entry_top, *entry_left;
t = GTK_TOGGLE_BUTTON (glade_xml_get_widget (state->gui, "check-print-divisions"));
state->pi->print_line_divisions = t->active;
t = GTK_TOGGLE_BUTTON (glade_xml_get_widget (state->gui, "check-grid-lines"));
state->pi->print_grid_lines = t->active;
t = GTK_TOGGLE_BUTTON (glade_xml_get_widget (state->gui, "check-only-styles"));
state->pi->print_even_if_only_styles = t->active;
t = GTK_TOGGLE_BUTTON (glade_xml_get_widget (state->gui, "check-black-white"));
state->pi->print_black_and_white = t->active;
......
......@@ -1804,7 +1804,7 @@ In
<widget>
<class>GtkCheckButton</class>
<name>check-print-divisions</name>
<name>check-grid-lines</name>
<can_focus>True</can_focus>
<label>_Grid lines</label>
<active>False</active>
......
......@@ -413,6 +413,7 @@ print_cell (Cell const *cell, MStyle const *mstyle, GnomePrintContext *context,
if (mstyle_get_font_strike (mstyle))
line_offset[num_lines++] = font_ascent/-2;
/* FIXME : This will be wrong for JUSTIFIED halignments */
cell_width_pts = gnome_font_get_width_string (print_font, text);
/* if a number overflows, do special drawing */
......@@ -591,7 +592,7 @@ print_cell_background (GnomePrintContext *context,
* segments that are selected.
*/
static void
print_merged_range (GnomePrintContext *context, Sheet *sheet,
print_merged_range (GnomePrintContext *context, Sheet const *sheet,
double start_x, double start_y,
Range const *view, Range const *range)
{
......@@ -655,7 +656,7 @@ merged_col_cmp (Range const *a, Range const *b)
void
print_cell_range (GnomePrintContext *context,
Sheet *sheet,
Sheet const *sheet,
int start_col, int start_row,
int end_col, int end_row,
double base_x, double base_y,
......
......@@ -2,7 +2,7 @@
#define GNUMERIC_PRINT_CELL_H
void print_cell_range (GnomePrintContext *context,
Sheet *sheet,
Sheet const *sheet,
int start_col, int start_row,
int end_col, int end_row,
double base_x, double base_y,
......
......@@ -285,11 +285,12 @@ print_info_new (void)
pi->paper = gnome_paper_with_name (gnome_paper_name_default ());
g_free (s);
pi->center_horizontally = gnome_config_get_bool ("center_horizontally=false");
pi->center_vertically = gnome_config_get_bool ("center_vertically=false");
pi->print_line_divisions = gnome_config_get_bool ("print_divisions=false");
pi->print_black_and_white = gnome_config_get_bool ("print_black_and_white=false");
pi->print_titles = gnome_config_get_bool ("print_titles=false");
pi->center_horizontally = gnome_config_get_bool ("center_horizontally=false");
pi->center_vertically = gnome_config_get_bool ("center_vertically=false");
pi->print_grid_lines = gnome_config_get_bool ("print_grid_lines=false");
pi->print_even_if_only_styles = gnome_config_get_bool ("print_even_if_only_styles=true");
pi->print_black_and_white = gnome_config_get_bool ("print_black_and_white=false");
pi->print_titles = gnome_config_get_bool ("print_titles=false");
if (gnome_config_get_bool ("order_right=true"))
pi->print_order = PRINT_ORDER_RIGHT_THEN_DOWN;
......@@ -418,7 +419,8 @@ print_info_save (PrintInformation *pi)
gnome_config_set_bool ("center_horizontally", pi->center_horizontally);
gnome_config_set_bool ("center_vertically", pi->center_vertically);
gnome_config_set_bool ("print_divisions", pi->print_line_divisions);
gnome_config_set_bool ("print_grid_lines", pi->print_grid_lines);
gnome_config_set_bool ("print_even_if_only_styles", pi->print_even_if_only_styles);
gnome_config_set_bool ("print_black_and_white", pi->print_black_and_white);
gnome_config_set_bool ("print_titles", pi->print_titles);
gnome_config_set_bool ("order_right", pi->print_order);
......@@ -746,13 +748,14 @@ print_info_copy (PrintInformation *src_pi)
print_info_margin_copy (&src_pi->margins.footer, &dst_pi->margins.footer);
/* Booleans */
dst_pi->center_vertically = src_pi->center_vertically;
dst_pi->center_horizontally = src_pi->center_horizontally;
dst_pi->print_line_divisions = src_pi->print_line_divisions;
dst_pi->print_black_and_white = src_pi->print_black_and_white;
dst_pi->print_as_draft = src_pi->print_as_draft;
dst_pi->print_titles = src_pi->print_titles;
dst_pi->print_order = src_pi->print_order;
dst_pi->center_vertically = src_pi->center_vertically;
dst_pi->center_horizontally = src_pi->center_horizontally;
dst_pi->print_grid_lines = src_pi->print_grid_lines;
dst_pi->print_even_if_only_styles = src_pi->print_even_if_only_styles;
dst_pi->print_black_and_white = src_pi->print_black_and_white;
dst_pi->print_as_draft = src_pi->print_as_draft;
dst_pi->print_titles = src_pi->print_titles;
dst_pi->print_order = src_pi->print_order;
/* Headers & Footers */
print_hf_free (dst_pi->header);
......
......@@ -74,7 +74,8 @@ struct _PrintInformation {
unsigned int center_vertically:1;
unsigned int center_horizontally:1;
unsigned int print_line_divisions:1;
unsigned int print_grid_lines:1;
unsigned int print_even_if_only_styles:1;
unsigned int print_black_and_white:1;
unsigned int print_as_draft:1;
unsigned int print_titles:1;
......@@ -99,7 +100,7 @@ typedef enum {
} HFRenderType;
typedef struct {
Sheet *sheet;
Sheet const *sheet;
int page;
int pages;
Value *date_time;
......
......@@ -119,13 +119,13 @@ typedef struct {
} PrintJobInfo;
static void
print_titles (Sheet *sheet, int start_col, int start_row, int end_col, int end_row,
print_titles (Sheet const *sheet, int start_col, int start_row, int end_col, int end_row,
double base_x, double base_y, PrintJobInfo *pj)
{
}
static void
print_page_cells (Sheet *sheet,
print_page_cells (Sheet const *sheet,
int start_col, int start_row, int end_col, int end_row,
double base_x, double base_y,
PrintJobInfo *pj)
......@@ -134,7 +134,7 @@ print_page_cells (Sheet *sheet,
print_cell_range (pj->print_context, sheet,
start_col, start_row,
end_col, end_row,
base_x, base_y, pj->pi->print_line_divisions);
base_x, base_y, pj->pi->print_grid_lines);
}
/*
......@@ -144,7 +144,7 @@ print_page_cells (Sheet *sheet,
* the page.
*/
static void
print_page_repeated_rows (Sheet *sheet,
print_page_repeated_rows (Sheet const *sheet,
int start_col, int end_col,
double base_x, double base_y,
PrintJobInfo *pj)
......@@ -165,7 +165,7 @@ print_page_repeated_rows (Sheet *sheet,
* on the page.
*/
static void
print_page_repeated_cols (Sheet *sheet,
print_page_repeated_cols (Sheet const *sheet,
int start_row, int end_row,
double base_x, double base_y,
PrintJobInfo *pj)
......@@ -188,7 +188,7 @@ print_page_repeated_cols (Sheet *sheet,
* from the rows, whether order is row and column major. We do the same.
*/
static void
print_page_repeated_intersect (Sheet *sheet,
print_page_repeated_intersect (Sheet const *sheet,
double base_x, double base_y,
double print_width, double print_height,
PrintJobInfo *pj)
......@@ -202,7 +202,7 @@ print_page_repeated_intersect (Sheet *sheet,
#ifdef ENABLE_BONOBO
static void
print_page_object (Sheet *sheet, SheetObjectPrintInfo *pi,
print_page_object (Sheet const *sheet, SheetObjectPrintInfo *pi,
int start_col, int start_row,
double base_x, double base_y, PrintJobInfo *pj)
{
......@@ -445,7 +445,7 @@ cb_range_empty (Sheet *sheet, int col, int row, Cell *cell, gpointer flags)
* regular flow.
*/
static int
print_page (Sheet *sheet, int start_col, int start_row, int end_col, int end_row,
print_page (Sheet const *sheet, int start_col, int start_row, int end_col, int end_row,
PrintJobInfo *pj, gboolean output)
{
PrintMargins *margins = &pj->pi->margins;
......@@ -480,7 +480,7 @@ print_page (Sheet *sheet, int start_col, int start_row, int end_col, int end_row
repeat_cols_used_x = 0;
/* If there are no cells in the area check for spans */
printed = (NULL != sheet_foreach_cell_in_range (sheet, TRUE,
printed = (NULL != sheet_foreach_cell_in_range ((Sheet *)sheet, TRUE,
start_col, start_row,
end_col, end_row,
cb_range_empty, NULL));
......@@ -496,7 +496,7 @@ print_page (Sheet *sheet, int start_col, int start_row, int end_col, int end_row
}
}
}
if (!printed) {
if (!printed && pj->pi->print_even_if_only_styles) {
Range r;
printed = sheet_style_has_visible_content (sheet,
range_init (&r, start_col, start_row,
......@@ -645,14 +645,14 @@ print_page (Sheet *sheet, int start_col, int start_row, int end_col, int end_row
* at index @start and limited to index @end
*/
static int
compute_group (Sheet *sheet, int start, int end, int usable,
ColRowInfo *(get_info)(Sheet const *sheet, int const p))
compute_group (Sheet const *sheet, int start, int end, int usable,
ColRowInfo *(get_info)(Sheet const *sheet, int const p))
{
float size_pts = 1.; /* The initial grid line */
int idx, count = 0;
for (idx = start; idx < end; idx++, count++) {
ColRowInfo *info;
ColRowInfo const *info;
info = (*get_info) (sheet, idx);
......@@ -716,7 +716,7 @@ render_sheet_objects (Sheet *sheet, PrintJobInfo *pj)
#define ROW_FIT(row) (row >= SHEET_MAX_ROWS ? (SHEET_MAX_ROWS-1) : row)
static int
print_range_down_then_right (Sheet *sheet, Range r, PrintJobInfo *pj,
print_range_down_then_right (Sheet const *sheet, Range r, PrintJobInfo *pj,
gboolean output)
{
int usable_x, usable_x_initial, usable_x_repeating;
......@@ -780,7 +780,7 @@ print_range_down_then_right (Sheet *sheet, Range r, PrintJobInfo *pj,
}
static int
print_range_right_then_down (Sheet *sheet, Range r, PrintJobInfo *pj,
print_range_right_then_down (Sheet const *sheet, Range r, PrintJobInfo *pj,
gboolean output)
{
int usable_x, usable_x_initial, usable_x_repeating;
......@@ -857,7 +857,7 @@ print_range_right_then_down (Sheet *sheet, Range r, PrintJobInfo *pj,
* Return value: the number of pages printed.
*/
static int
print_sheet_range (Sheet *sheet, Range r, PrintJobInfo *pj, gboolean output)
print_sheet_range (Sheet const *sheet, Range r, PrintJobInfo *pj, gboolean output)
{
int pages;
......@@ -889,7 +889,8 @@ print_sheet_range (Sheet *sheet, Range r, PrintJobInfo *pj, gboolean output)
}
static double
print_range_used_units (Sheet *sheet, gboolean compute_rows, PrintRepeatRange *range)
print_range_used_units (Sheet const *sheet, gboolean compute_rows,
PrintRepeatRange const *range)
{
ValueRange const *cell_range = &range->range;
CellRef const *cell_a = &cell_range->cell.a;
......@@ -904,7 +905,7 @@ print_range_used_units (Sheet *sheet, gboolean compute_rows, PrintRepeatRange *r
}
static void
print_job_info_init_sheet (Sheet *sheet, PrintJobInfo *pj)
print_job_info_init_sheet (Sheet const *sheet, PrintJobInfo *pj)
{
/*
* This should be set in print_job_info_get, but we need
......@@ -946,7 +947,7 @@ compute_sheet_pages (gpointer value, gpointer user_data)
{
PageCountInfo *pc = user_data;
PrintJobInfo *pj = pc->pj;
Sheet *sheet = value;
Sheet const *sheet = value;
Range r;
/* only count pages we are printing */
......@@ -958,14 +959,16 @@ compute_sheet_pages (gpointer value, gpointer user_data)
}
print_job_info_init_sheet (sheet, pj);
if (pj->range == PRINT_SHEET_SELECTION) {
r = pc->r;
} else {
if (pj->range != PRINT_SHEET_SELECTION) {
r = sheet_get_extent (sheet);
sheet_style_get_extent (sheet, &r);
if (pj->pi->print_even_if_only_styles)
sheet_style_get_extent (sheet, &r);
/* FIXME : print_range should be inclusive */
r.end.col++;
r.end.row++;
}
} else
r = pc->r;
/* Find out how many pages actually contain data */
pc->pages = print_sheet_range (sheet, r, pj, FALSE);
......@@ -1016,7 +1019,10 @@ print_sheet (gpointer value, gpointer user_data)
print_job_info_init_sheet (sheet, pj);
extent = sheet_get_extent (sheet);