Commit d878dc8e1ad82bbdf5838ffab804d05c93e48352

  • avatar
  • Marek Kasik <mkasik @red…at.com>
  • Mon Aug 10 11:37:32 CEST 2009
Increment page sequence before print of the page, not after

When printing, increment page sequence before rendering of the page,
not after (#590084).
In opposite case it runs "end_page" function with wrong parameters when
drawing a page in another thread.
  
20972097 GtkPrintOperationPrivate *priv = data->op->priv;
20982098 gint inc;
20992099
2100 if (data->total == -1)
2101 {
2102 data->total = 0;
2103 return;
2104 }
2105
21002106 /* check whether we reached last position */
21012107 if (priv->page_position == data->last_position &&
21022108 !(data->collated_copies > 1 && data->collated < (data->collated_copies - 1)))
22362236 text = g_strdup (_("Preparing"));
22372237 }
22382238 else if (priv->status == GTK_PRINT_STATUS_GENERATING_DATA)
2239 text = g_strdup_printf (_("Printing %d"), data->total - 1);
2239 text = g_strdup_printf (_("Printing %d"), data->total);
22402240
22412241 if (text)
22422242 {
26662666 counter++;
26672667 }
26682668
2669 data->total = 0;
2669 data->total = -1;
26702670 data->collated = 0;
26712671 data->uncollated = 0;
26722672
27642764 goto out;
27652765 }
27662766
2767 increment_page_sequence (data);
2768
27672769 if (!data->done)
2768 {
2769 common_render_page (data->op, data->page);
2770 increment_page_sequence (data);
2771 }
2770 common_render_page (data->op, data->page);
27722771 else
27732772 done = priv->page_drawing_state == GTK_PAGE_DRAWING_STATE_READY;
27742773