summaryrefslogtreecommitdiffstats
path: root/print.c
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-03-10 14:50:02 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-03-10 09:22:34 -0700
commitcb30d6d864d893468b405de7821be1e96cd13e94 (patch)
tree0f6ba307ba2366b32406afb4782fe5e9a9caf971 /print.c
parente8d582dbd44c375d06ff8cbc91fcb21f07a5963b (diff)
downloadsubsurface-cb30d6d864d893468b405de7821be1e96cd13e94.tar.gz
Table print: Ignore a dive instead of breaking the dive loop
draw_table(): When get_dive_for_printing() returns NULL, instead of breaking, we should 'continue' trough the entire loop. Otherwise the paginate() handler will be called dive_table.nr times, until it returns TRUE. Fixes a bug where, for example one selected dive can end up allocating dive_table.nr pages for printing. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'print.c')
-rw-r--r--print.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/print.c b/print.c
index 2d2476fef..61d4a9dc4 100644
--- a/print.c
+++ b/print.c
@@ -802,7 +802,7 @@ static void draw_table(GtkPrintOperation *operation, GtkPrintContext *context, g
for (i = 0; i < dive_table.nr - nr; i++) {
dive = get_dive_for_printing(nr+i);
if (!dive)
- break;
+ continue;
/* Write the dive data and get the max. height of the row */
max_ext = show_dive_table(dive, cr, layout, w*2, delta_y / 4 / PANGO_SCALE, paginate);
/* Draw a frame for each row */