]> git.sur5r.net Git - glabels/commitdiff
Fixed calculation of number of pages when printing merge jobs
authorJim Evins <evins@snaught.com>
Sat, 8 Sep 2012 01:35:22 +0000 (21:35 -0400)
committerJim Evins <evins@snaught.com>
Sat, 8 Sep 2012 01:43:21 +0000 (21:43 -0400)
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.

src/print-op-dialog.c

index fdcc45a74e367d7ea527de18e172361413151ef3..df6cc256a6cb285f8187d5c82ace06f401518e93 100644 (file)
@@ -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));