gedit r6064 - branches/printing/gedit



Author: pborelli
Date: Tue Jan  8 18:40:02 2008
New Revision: 6064
URL: http://svn.gnome.org/viewvc/gedit?rev=6064&view=rev

Log:
fix problem with MAX (and no, I am not sure why it happened)


Modified:
   branches/printing/gedit/gedit-print-preview.c

Modified: branches/printing/gedit/gedit-print-preview.c
==============================================================================
--- branches/printing/gedit/gedit-print-preview.c	(original)
+++ branches/printing/gedit/gedit-print-preview.c	Tue Jan  8 18:40:02 2008
@@ -163,6 +163,8 @@
 {
 	gchar c[32];
 
+	g_print ("move to page %d\n", page);
+
 	g_snprintf (c, 32, "%d", page + 1);
 	gtk_entry_set_text (GTK_ENTRY (preview->priv->page_entry), c);
 
@@ -185,15 +187,16 @@
 		     GeditPrintPreview *preview)
 {
 	GdkEvent *event;
+	gint page;
 
 	event = gtk_get_current_event ();
 
 	if (event->button.state & GDK_SHIFT_MASK)
-		goto_page (preview, 0);
+		page = 0;
 	else
-		goto_page (preview,
-			   MAX (preview->priv->cur_page - preview->priv->rows * preview->priv->cols,
-				0));
+		page = preview->priv->cur_page - preview->priv->rows * preview->priv->cols;
+
+ 	goto_page (preview, MAX (page, 0));
 
 	gdk_event_free (event);
 }
@@ -203,15 +206,16 @@
 		     GeditPrintPreview *preview)
 {
 	GdkEvent *event;
+	gint page;
 
 	event = gtk_get_current_event ();
 
 	if (event->button.state & GDK_SHIFT_MASK)
-		goto_page (preview, preview->priv->n_pages - 1);
+		page = preview->priv->n_pages - 1;
 	else
-		goto_page (preview,
-			   MIN (preview->priv->cur_page + preview->priv->rows * preview->priv->cols,
-			     	preview->priv->n_pages - 1));
+		page = preview->priv->cur_page + preview->priv->rows * preview->priv->cols;
+
+ 	goto_page (preview, MIN (page, preview->priv->n_pages - 1));
 
 	gdk_event_free (event);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]