on_column_boundary (const GtkSheet *sheet, gint x, gint *column)
{
gint col;
+ gint pixel;
x += sheet->hadjustment->value;
+ if ( x < 0)
+ return FALSE;
+
col = column_from_xpixel (sheet, x);
- if ( column_from_xpixel (sheet, x - DRAG_WIDTH / 2) < col )
+ pixel = x - DRAG_WIDTH / 2;
+ if (pixel < 0)
+ pixel = 0;
+
+ if ( column_from_xpixel (sheet, pixel) < col )
{
*column = col - 1;
return TRUE;
on_row_boundary (const GtkSheet *sheet, gint y, gint *row)
{
gint r;
+ gint pixel;
y += sheet->vadjustment->value;
+ if ( y < 0)
+ return FALSE;
+
r = row_from_ypixel (sheet, y);
- if ( row_from_ypixel (sheet, y - DRAG_WIDTH / 2) < r )
+ pixel = y - DRAG_WIDTH / 2;
+ if (pixel < 0)
+ pixel = 0;
+
+ if ( row_from_ypixel (sheet, pixel) < r )
{
*row = r - 1;
return TRUE;
sheet->range.rowi = row;
sheet->range.coli = psppire_axis_unit_count (sheet->haxis) - 1;
sheet->active_cell.row = row;
- sheet->active_cell.col = 0;
g_signal_emit (sheet, sheet_signals[SELECT_ROW], 0, row);
gtk_sheet_real_select_range (sheet, NULL);
sheet->range.col0 = column;
sheet->range.rowi = psppire_axis_unit_count (sheet->vaxis) - 1;
sheet->range.coli = column;
- sheet->active_cell.row = 0;
sheet->active_cell.col = column;
g_signal_emit (sheet, sheet_signals[SELECT_COLUMN], 0, column);
col >= psppire_axis_unit_count (sheet->haxis))
return;
- sheet->active_cell.row = row;
- sheet->active_cell.col = col;
-
if (!GTK_WIDGET_REALIZED (GTK_WIDGET (sheet)))
return;
if (column < 0 || column >= psppire_axis_unit_count (sheet->haxis))
return;
+ if ( width <= 0)
+ return;
+
psppire_axis_resize (sheet->haxis, column, width);
if (GTK_WIDGET_REALIZED (GTK_WIDGET (sheet)))
if (row < 0 || row >= psppire_axis_unit_count (sheet->vaxis))
return;
+ if (height <= 0)
+ return;
+
psppire_axis_resize (sheet->vaxis, row, height);
if (GTK_WIDGET_REALIZED (GTK_WIDGET (sheet)) )