#include "gtksheet.h"
#include "gtkextra-marshal.h"
#include "gsheetmodel.h"
+#include <libpspp/misc.h>
/* sheet flags */
enum
break;
}
+
+ maximize_int (&new_row, 0);
+ maximize_int (&new_col, 0);
+
+ minimize_int (&new_row,
+ g_sheet_row_get_row_count (sheet->row_geometry) - 1);
+
+ minimize_int (&new_col,
+ g_sheet_column_get_column_count (sheet->column_geometry) - 1);
+
g_signal_emit (sheet, sheet_signals[TRAVERSE], 0,
current_row, current_col,
&new_row, &new_col, &forbidden);
*dest = src;
}
+
+/* Set *DEST to the lower of *DEST and SRC */
+static inline void
+minimize_int (int *dest, int src)
+{
+ if (src < *dest)
+ *dest = src;
+}
+
+
+/* Set *DEST to the greater of *DEST and SRC */
+static inline void
+maximize_int (int *dest, int src)
+{
+ if (src > *dest)
+ *dest = src;
+}
+
+
#endif /* libpspp/misc.h */