gtk+ r21177 - in trunk: . gtk
- From: mkasik svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21177 - in trunk: . gtk
- Date: Thu, 21 Aug 2008 11:30:46 +0000 (UTC)
Author: mkasik
Date: Thu Aug 21 11:30:46 2008
New Revision: 21177
URL: http://svn.gnome.org/viewvc/gtk+?rev=21177&view=rev
Log:
2008-08-21 Marek Kasik <mkasik redhat com>
Bug 545875 â evo crashed when trying to print pages 6-7 of a 1 page
email
* gtk/gtkprintoperation.c: Clamp page ranges to correct ranges
Modified:
trunk/ChangeLog
trunk/gtk/gtkprintoperation.c
Modified: trunk/gtk/gtkprintoperation.c
==============================================================================
--- trunk/gtk/gtkprintoperation.c (original)
+++ trunk/gtk/gtkprintoperation.c Thu Aug 21 11:30:46 2008
@@ -1926,6 +1926,46 @@
}
}
+static void
+clamp_page_ranges (PrintPagesData *data)
+{
+ GtkPrintOperationPrivate *priv;
+ gint num_of_correct_ranges;
+ gint i;
+
+ priv = data->op->priv;
+
+ num_of_correct_ranges = 0;
+
+ for (i = 0; i < data->num_ranges; i++)
+ if ((data->ranges[i].start >= 0) &&
+ (data->ranges[i].start < priv->nr_of_pages) &&
+ (data->ranges[i].end >= 0) &&
+ (data->ranges[i].end < priv->nr_of_pages))
+ {
+ data->ranges[num_of_correct_ranges] = data->ranges[i];
+ num_of_correct_ranges++;
+ }
+ else if ((data->ranges[i].start >= 0) &&
+ (data->ranges[i].start < priv->nr_of_pages) &&
+ (data->ranges[i].end >= priv->nr_of_pages))
+ {
+ data->ranges[i].end = priv->nr_of_pages - 1;
+ data->ranges[num_of_correct_ranges] = data->ranges[i];
+ num_of_correct_ranges++;
+ }
+ else if ((data->ranges[i].end >= 0) &&
+ (data->ranges[i].end < priv->nr_of_pages) &&
+ (data->ranges[i].start < 0))
+ {
+ data->ranges[i].start = 0;
+ data->ranges[num_of_correct_ranges] = data->ranges[i];
+ num_of_correct_ranges++;
+ }
+
+ data->num_ranges = num_of_correct_ranges;
+}
+
static gboolean
increment_page_sequence (PrintPagesData *data)
{
@@ -2139,6 +2179,8 @@
data->ranges[0].end = priv->nr_of_pages - 1;
}
+ clamp_page_ranges (data);
+
if (priv->manual_reverse)
{
data->range = data->num_ranges - 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]