[gnumeric] 2009-04-20 Jean Brefort <jean brefort normalesup org>



commit 1a42afaac12e230c06711b09c3569e4c8848fceb
Author: Jean Brefort <jean acer fbx proxad net>
Date:   Mon Apr 20 15:42:55 2009 +0200

    2009-04-20  Jean Brefort  <jean brefort normalesup org>
    
    	* configure.in: check for gtk_adjustment_configure.
    	* src/commands.c (cmd_so_set_adjustment_adj): add defines for missing gtk
    	functions in gtk+-2.12 and earlier (see #114098).
---
 ChangeLog      |    6 ++++++
 configure.in   |    2 +-
 src/commands.c |   29 +++++++++++++++++++++--------
 3 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b106d41..8474dcd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-20  Jean Brefort  <jean brefort normalesup org>
+
+	* configure.in: check for gtk_adjustment_configure.
+	* src/commands.c (cmd_so_set_adjustment_adj): add defines for missing gtk
+	functions in gtk+-2.12 and earlier (see #114098).
+
 2009-04-19  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* src/gnm-so-filled.c (gnm_so_filled_draw_cairo): print text if
diff --git a/configure.in b/configure.in
index d3e77a5..8e314ec 100644
--- a/configure.in
+++ b/configure.in
@@ -654,7 +654,7 @@ SAVE_CFLAGS=$CFLAGS
 SAVE_LIBS=$LIBS
 CFLAGS="$CFLAGS $GNUMERIC_CFLAGS"
 LIBS="$GNUMERIC_LIBS $LIBS"
-AC_CHECK_FUNCS(g_date_set_time_t g_slice_alloc pango_font_map_create_context gtk_recent_manager_get_default gtk_orientable_set_orientation gsf_open_pkg_foreach_rel gsf_infile_msvba_steal_modules)
+AC_CHECK_FUNCS(g_date_set_time_t g_slice_alloc pango_font_map_create_context gtk_recent_manager_get_default gtk_orientable_set_orientation gtk_adjustment_configure gsf_open_pkg_foreach_rel gsf_infile_msvba_steal_modules)
 CFLAGS=$SAVE_CFLAGS
 LIBS=$SAVE_LIBS
 
diff --git a/src/commands.c b/src/commands.c
index ec3e43c..d281eda 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -7206,15 +7206,28 @@ cmd_so_set_checkbox (WorkbookControl *wbc,
 #define CMD_SO_SET_ADJUSTMENT_TYPE (cmd_so_set_adjustment_get_type ())
 #define CMD_SO_SET_ADJUSTMENT(o)   (G_TYPE_CHECK_INSTANCE_CAST ((o), CMD_SO_SET_ADJUSTMENT_TYPE, CmdSOSetAdjustment))
 
+#ifndef HAVE_GTK_ADJUSTMENT_CONFIGURE
+#       define gtk_adjustment_configure(adjustment,value,lower,upper,step_increment,page_increment,page_size) \
+		g_object_set (G_OBJECT (adjustment), "value", (double) value, "lower", (double) lower, "upper", (double) upper, \
+				"step-increment", (double) step_increment, "page-increment", (double) page_increment, \
+				"page-size", (double) page_size, NULL)
+#       define gtk_adjustment_get_value(adjustment)     adjustment->value
+#       define gtk_adjustment_get_lower(adjustment)     adjustment->lower
+#       define gtk_adjustment_get_upper(adjustment)     adjustment->upper
+#       define gtk_adjustment_get_step_increment(adjustment)     adjustment->step_increment
+#       define gtk_adjustment_get_page_increment(adjustment)     adjustment->page_increment
+#       define gtk_adjustment_get_page_size(adjustment)     adjustment->page_size
+#endif
+
 typedef struct {
 	GnmCommand cmd;
 	SheetObject *so;
 	GnmExprTop const *new_link;
 	GnmExprTop const *old_link;
-	int old_lower;
-	int old_upper;
-	int old_step;
-	int old_page;
+	double old_lower;
+	double old_upper;
+	double old_step;
+	double old_page;
 } CmdSOSetAdjustment;
 
 MAKE_GNM_COMMAND (CmdSOSetAdjustment, cmd_so_set_adjustment, NULL)
@@ -7224,10 +7237,10 @@ cmd_so_set_adjustment_adj (CmdSOSetAdjustment *me)
 {
 	GtkAdjustment *adj = sheet_widget_adjustment_get_adjustment (me->so);
 
-	int old_lower = gtk_adjustment_get_lower (adj);
-	int old_upper = gtk_adjustment_get_upper (adj);
-	int old_step = gtk_adjustment_get_step_increment (adj);
-	int old_page = gtk_adjustment_get_page_increment (adj);
+	double old_lower = gtk_adjustment_get_lower (adj);
+	double old_upper = gtk_adjustment_get_upper (adj);
+	double old_step = gtk_adjustment_get_step_increment (adj);
+	double old_page = gtk_adjustment_get_page_increment (adj);
 
 	gtk_adjustment_configure (adj, 
 				  gtk_adjustment_get_value (adj),



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