Commit 94d91805 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Force clean after post load recalc.


2000-04-10  Jody Goldberg <jgoldberg@home.com>

	* src/file.c (workbook_read) : Force clean after post load recalc.

	* src/sheet-view.c (sheet_view_col_selection_changed) : keep the
	  moving col visible.
	(sheet_view_row_selection_changed) : Keep the moving row visible.

	* src/item-grid.c (item_grid_find_col) : Tune iteration bounds to
	  improve speed and allow for scrolling back to the first col/row.

	* src/item-cursor.c (item_cursor_autofill_event) : Pass the coords of
	  the cell we want to keep visible rather than the top left corner.
	(item_cursor_set_bounds_visibly) : Rename the parameters to reflect
	  their real purpose.
parent ec3afe63
2000-04-10 Jody Goldberg <jgoldberg@home.com>
* src/file.c (workbook_read) : Force clean after post load recalc.
* src/sheet-view.c (sheet_view_col_selection_changed) : keep the
moving col visible.
(sheet_view_row_selection_changed) : Keep the moving row visible.
* src/item-grid.c (item_grid_find_col) : Tune iteration bounds to
improve speed and allow for scrolling back to the first col/row.
* src/item-cursor.c (item_cursor_autofill_event) : Pass the coords of
the cell we want to keep visible rather than the top left corner.
(item_cursor_set_bounds_visibly) : Rename the parameters to reflect
their real purpose.
2000-04-09 Morten Welinder <terra@diku.dk>
* configure.in (gnome-print): Need 0.17.
......
2000-04-10 Jody Goldberg <jgoldberg@home.com>
* src/file.c (workbook_read) : Force clean after post load recalc.
* src/sheet-view.c (sheet_view_col_selection_changed) : keep the
moving col visible.
(sheet_view_row_selection_changed) : Keep the moving row visible.
* src/item-grid.c (item_grid_find_col) : Tune iteration bounds to
improve speed and allow for scrolling back to the first col/row.
* src/item-cursor.c (item_cursor_autofill_event) : Pass the coords of
the cell we want to keep visible rather than the top left corner.
(item_cursor_set_bounds_visibly) : Rename the parameters to reflect
their real purpose.
2000-04-09 Morten Welinder <terra@diku.dk>
* configure.in (gnome-print): Need 0.17.
......
2000-04-10 Jody Goldberg <jgoldberg@home.com>
* src/file.c (workbook_read) : Force clean after post load recalc.
* src/sheet-view.c (sheet_view_col_selection_changed) : keep the
moving col visible.
(sheet_view_row_selection_changed) : Keep the moving row visible.
* src/item-grid.c (item_grid_find_col) : Tune iteration bounds to
improve speed and allow for scrolling back to the first col/row.
* src/item-cursor.c (item_cursor_autofill_event) : Pass the coords of
the cell we want to keep visible rather than the top left corner.
(item_cursor_set_bounds_visibly) : Rename the parameters to reflect
their real purpose.
2000-04-09 Morten Welinder <terra@diku.dk>
* configure.in (gnome-print): Need 0.17.
......
2000-04-10 Jody Goldberg <jgoldberg@home.com>
* src/file.c (workbook_read) : Force clean after post load recalc.
* src/sheet-view.c (sheet_view_col_selection_changed) : keep the
moving col visible.
(sheet_view_row_selection_changed) : Keep the moving row visible.
* src/item-grid.c (item_grid_find_col) : Tune iteration bounds to
improve speed and allow for scrolling back to the first col/row.
* src/item-cursor.c (item_cursor_autofill_event) : Pass the coords of
the cell we want to keep visible rather than the top left corner.
(item_cursor_set_bounds_visibly) : Rename the parameters to reflect
their real purpose.
2000-04-09 Morten Welinder <terra@diku.dk>
* configure.in (gnome-print): Need 0.17.
......
2000-04-10 Jody Goldberg <jgoldberg@home.com>
* src/file.c (workbook_read) : Force clean after post load recalc.
* src/sheet-view.c (sheet_view_col_selection_changed) : keep the
moving col visible.
(sheet_view_row_selection_changed) : Keep the moving row visible.
* src/item-grid.c (item_grid_find_col) : Tune iteration bounds to
improve speed and allow for scrolling back to the first col/row.
* src/item-cursor.c (item_cursor_autofill_event) : Pass the coords of
the cell we want to keep visible rather than the top left corner.
(item_cursor_set_bounds_visibly) : Rename the parameters to reflect
their real purpose.
2000-04-09 Morten Welinder <terra@diku.dk>
* configure.in (gnome-print): Need 0.17.
......
2000-04-10 Jody Goldberg <jgoldberg@home.com>
* src/file.c (workbook_read) : Force clean after post load recalc.
* src/sheet-view.c (sheet_view_col_selection_changed) : keep the
moving col visible.
(sheet_view_row_selection_changed) : Keep the moving row visible.
* src/item-grid.c (item_grid_find_col) : Tune iteration bounds to
improve speed and allow for scrolling back to the first col/row.
* src/item-cursor.c (item_cursor_autofill_event) : Pass the coords of
the cell we want to keep visible rather than the top left corner.
(item_cursor_set_bounds_visibly) : Rename the parameters to reflect
their real purpose.
2000-04-09 Morten Welinder <terra@diku.dk>
* configure.in (gnome-print): Need 0.17.
......
2000-04-10 Jody Goldberg <jgoldberg@home.com>
* src/file.c (workbook_read) : Force clean after post load recalc.
* src/sheet-view.c (sheet_view_col_selection_changed) : keep the
moving col visible.
(sheet_view_row_selection_changed) : Keep the moving row visible.
* src/item-grid.c (item_grid_find_col) : Tune iteration bounds to
improve speed and allow for scrolling back to the first col/row.
* src/item-cursor.c (item_cursor_autofill_event) : Pass the coords of
the cell we want to keep visible rather than the top left corner.
(item_cursor_set_bounds_visibly) : Rename the parameters to reflect
their real purpose.
2000-04-09 Morten Welinder <terra@diku.dk>
* configure.in (gnome-print): Need 0.17.
......
......@@ -96,6 +96,8 @@ function_select_row (GtkCList *clist, gint row, gint col,
gtk_label_set_text (state->func_name,
tokenized_help_find (state->func_help, "SYNTAX"));
/* TODO : Fix 'descriptions' to be simple paragraphs */
gtk_label_set_text (state->description, "");
}
......
......@@ -273,9 +273,10 @@ workbook_read (CommandContext *context, const char *filename)
cell_deep_thaw_redraws ();
if (wb != NULL) {
/* TODO : Add preference to toggle this */
/* workbook_recalc (wb); */
/* FIXME : This should not be needed */
workbook_recalc (wb);
sheet_update (wb->current_sheet);
workbook_mark_clean (wb);
}
return wb;
......
......@@ -776,7 +776,7 @@ item_cursor_do_drop (ItemCursor *item_cursor, GdkEventButton *event)
static void
item_cursor_set_bounds_visibly (ItemCursor *item_cursor,
int const base_col, int const base_row,
int const visible_col, int const visible_row,
int const start_col, int const start_row,
int const end_col, int const end_row)
{
......@@ -785,7 +785,8 @@ item_cursor_set_bounds_visibly (ItemCursor *item_cursor,
item_cursor_set_bounds (item_cursor, start_col, start_row, end_col, end_row);
gnumeric_sheet_make_cell_visible (gsheet, base_col, base_row, FALSE);
gnumeric_sheet_make_cell_visible (gsheet,
visible_col, visible_row, FALSE);
gnome_canvas_update_now (GNOME_CANVAS (gsheet));
}
......@@ -964,29 +965,30 @@ item_cursor_autofill_event (GnomeCanvasItem *item, GdkEvent *event)
col = item_grid_find_col (item_cursor->item_grid, x, NULL);
row = item_grid_find_row (item_cursor->item_grid, y, NULL);
if (col < item_cursor->base_col || col > SHEET_MAX_COLS-1)
col = item_cursor->base_col;
/* Autofill by row or by col, NOT both. */
if ((item_cursor->base_x - x) > (item_cursor->base_y - y)){
if (row < item_cursor->base_row || row > SHEET_MAX_ROWS-1)
row = item_cursor->base_row;
/* FIXME : We do not support inverted auto-fill */
int bound = item_cursor->base_row + item_cursor->base_rows;
if (row > bound)
bound = row;
if ((item_cursor->base_x - x) > (item_cursor->base_y - y)){
item_cursor_set_bounds_visibly (
item_cursor,
item_cursor->base_col,
item_cursor->base_row,
item_cursor->base_col,
item_cursor->base_row,
item_cursor, col, row,
item_cursor->base_col, item_cursor->base_row,
item_cursor->base_col + item_cursor->base_cols,
row);
bound);
} else {
/* FIXME : We do not support inverted auto-fill */
int bound = item_cursor->base_col + item_cursor->base_cols;
if (col > bound)
bound = col;
item_cursor_set_bounds_visibly (
item_cursor,
item_cursor->base_col,
item_cursor->base_row,
item_cursor->base_col,
item_cursor->base_row,
col,
item_cursor, col, row,
item_cursor->base_col, item_cursor->base_row,
bound,
item_cursor->base_row + item_cursor->base_rows);
}
return TRUE;
......
......@@ -150,19 +150,19 @@ item_grid_find_col (ItemGrid *item_grid, int x, int *col_origin)
int pixel = gsheet->col_offset.first;
if (x < pixel) {
do {
ColRowInfo *ci = sheet_col_get_info (sheet, col);
while (col >= 0) {
ColRowInfo *ci = sheet_col_get_info (sheet, --col);
if (ci->visible) {
pixel -= ci->size_pixels;
if (pixel <= x) {
if (x >= pixel) {
if (col_origin)
*col_origin = pixel;
return col;
}
}
} while (--col >= 0);
};
if (col_origin)
*col_origin = 1;
*col_origin = 1; /* there is a 1 pixel edge at the left */
return 0;
}
......@@ -178,10 +178,8 @@ item_grid_find_col (ItemGrid *item_grid, int x, int *col_origin)
pixel += tmp;
}
} while (++col < SHEET_MAX_COLS);
if (col_origin) {
g_warning ("What goes here ?");
if (col_origin)
*col_origin = pixel;
}
return SHEET_MAX_COLS-1;
}
......@@ -198,20 +196,19 @@ item_grid_find_row (ItemGrid *item_grid, int y, int *row_origin)
int pixel = gsheet->row_offset.first;
if (y < pixel) {
do {
ColRowInfo *ri = sheet_row_get_info (sheet, row);
while (row >= 0) {
ColRowInfo *ri = sheet_row_get_info (sheet, --row);
if (ri->visible) {
int const tmp = ri->size_pixels;
if (pixel <= y && y <= pixel + tmp) {
pixel -= ri->size_pixels;
if (y >= pixel) {
if (row_origin)
*row_origin = pixel;
return row;
}
pixel -= tmp;
}
} while (--row >= 0);
};
if (row_origin)
*row_origin = 1;
*row_origin = 1; /* there is a 1 pixel edge on top */
return 0;
}
......@@ -227,10 +224,8 @@ item_grid_find_row (ItemGrid *item_grid, int y, int *row_origin)
pixel += tmp;
}
} while (++row < SHEET_MAX_ROWS);
if (row_origin) {
g_warning ("What goes here ?");
if (row_origin)
*row_origin = pixel;
}
return SHEET_MAX_ROWS-1;
}
......
......@@ -355,9 +355,6 @@ sheet_view_col_selection_changed (ItemBar *item_bar, int col, int modifiers, She
Sheet *sheet = sheet_view->sheet;
GnumericSheet *gsheet = GNUMERIC_SHEET (sheet_view->sheet_view);
/* Ensure that the col exists, ignore result */
sheet_col_fetch (sheet, col);
if (modifiers){
if ((modifiers & GDK_SHIFT_MASK) && sheet->selections){
SheetSelection *ss = sheet->selections->data;
......@@ -380,8 +377,10 @@ sheet_view_col_selection_changed (ItemBar *item_bar, int col, int modifiers, She
col, gsheet->row.first,
col, 0,
col, SHEET_MAX_ROWS-1);
} else
} else {
sheet_selection_extend_to (sheet, col, SHEET_MAX_ROWS - 1);
gnumeric_sheet_make_cell_visible (gsheet, col, gsheet->row.first, FALSE);
}
}
static void
......@@ -420,9 +419,6 @@ sheet_view_row_selection_changed (ItemBar *item_bar, int row, int modifiers, She
Sheet *sheet = sheet_view->sheet;
GnumericSheet *gsheet = GNUMERIC_SHEET (sheet_view->sheet_view);
/* Ensure that the row exists, ignore result */
sheet_row_fetch (sheet, row);
if (modifiers){
if ((modifiers & GDK_SHIFT_MASK) && sheet->selections){
SheetSelection *ss = sheet->selections->data;
......@@ -445,8 +441,10 @@ sheet_view_row_selection_changed (ItemBar *item_bar, int row, int modifiers, She
gsheet->col.first, row,
0, row,
SHEET_MAX_COLS-1, row);
} else
} else {
sheet_selection_extend_to (sheet, SHEET_MAX_COLS-1, row);
gnumeric_sheet_make_cell_visible (gsheet, gsheet->col.first, row, FALSE);
}
}
static void
......
......@@ -355,9 +355,6 @@ sheet_view_col_selection_changed (ItemBar *item_bar, int col, int modifiers, She
Sheet *sheet = sheet_view->sheet;
GnumericSheet *gsheet = GNUMERIC_SHEET (sheet_view->sheet_view);
/* Ensure that the col exists, ignore result */
sheet_col_fetch (sheet, col);
if (modifiers){
if ((modifiers & GDK_SHIFT_MASK) && sheet->selections){
SheetSelection *ss = sheet->selections->data;
......@@ -380,8 +377,10 @@ sheet_view_col_selection_changed (ItemBar *item_bar, int col, int modifiers, She
col, gsheet->row.first,
col, 0,
col, SHEET_MAX_ROWS-1);
} else
} else {
sheet_selection_extend_to (sheet, col, SHEET_MAX_ROWS - 1);
gnumeric_sheet_make_cell_visible (gsheet, col, gsheet->row.first, FALSE);
}
}
static void
......@@ -420,9 +419,6 @@ sheet_view_row_selection_changed (ItemBar *item_bar, int row, int modifiers, She
Sheet *sheet = sheet_view->sheet;
GnumericSheet *gsheet = GNUMERIC_SHEET (sheet_view->sheet_view);
/* Ensure that the row exists, ignore result */
sheet_row_fetch (sheet, row);
if (modifiers){
if ((modifiers & GDK_SHIFT_MASK) && sheet->selections){
SheetSelection *ss = sheet->selections->data;
......@@ -445,8 +441,10 @@ sheet_view_row_selection_changed (ItemBar *item_bar, int row, int modifiers, She
gsheet->col.first, row,
0, row,
SHEET_MAX_COLS-1, row);
} else
} else {
sheet_selection_extend_to (sheet, SHEET_MAX_COLS-1, row);
gnumeric_sheet_make_cell_visible (gsheet, gsheet->col.first, row, FALSE);
}
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment