diff options
author | Jim Evins <evins@snaught.com> | 2012-09-07 21:35:22 -0400 |
---|---|---|
committer | Jim Evins <evins@snaught.com> | 2012-09-07 21:50:01 -0400 |
commit | 0bf9aa6a1022b981dad8b718ec50f466d56743bc (patch) | |
tree | a47c5a6a91176be87b1fd2f49c3de584b0f7fe78 | |
parent | f07b8360fd82befbd06642b0f646325c291d5597 (diff) |
Fixed calculation of number of pages when printing merge jobs
Fixes bug #680585. Poorly placed parenthesis caused the calculation of the
number of sheets to be wrong whenever starting on any label other than the
first one on a page.
-rw-r--r-- | src/print-op-dialog.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/print-op-dialog.c b/src/print-op-dialog.c index fdcc45a..df6cc25 100644 --- a/src/print-op-dialog.c +++ b/src/print-op-dialog.c @@ -478,7 +478,11 @@ custom_widget_apply_cb (GtkPrintOperation *operation, gl_print_op_set_collate_flag (GL_PRINT_OP (op), collate_flag); n_records = gl_merge_get_record_count (merge); - n_sheets = ceil (first - 1 + (n_copies * n_records)/(double)op->priv->labels_per_sheet); + n_sheets = ceil ((first - 1 + n_copies*n_records)/(double)op->priv->labels_per_sheet); + if ( n_sheets < 1 ) + { + n_sheets = 1; + } gl_print_op_set_n_sheets (GL_PRINT_OP (op), n_sheets); g_object_unref (G_OBJECT(merge)); |