Commit 8bd8660b authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa

Do not pass negative numbers to item_grid_find_col and item_grid_find_row.

1998-12-02  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/item-cursor.c (item_cursor_autofill_event): Do not pass
	negative numbers to item_grid_find_col and item_grid_find_row.

	* src/item-grid.c (item_grid_find_row, item_grid_find_col): Check
	for possitive numbers. I think the right fix is to accept negative
	numbers and find the column even if the number is negative instead
	of this ugly restriction.
parent 4da53708
1998-12-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-cursor.c (item_cursor_autofill_event): Do not pass
negative numbers to item_grid_find_col and item_grid_find_row.
* src/item-grid.c (item_grid_find_row, item_grid_find_col): Check
for possitive numbers. I think the right fix is to accept negative
numbers and find the column even if the number is negative instead
of this ugly restriction.
1998-11-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet.c (cellref_name): Add more space.
1998-12-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* src/Makefile.am: make Gnumeric-impl.c dependend on Gnumeric.h to
......
1998-12-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-cursor.c (item_cursor_autofill_event): Do not pass
negative numbers to item_grid_find_col and item_grid_find_row.
* src/item-grid.c (item_grid_find_row, item_grid_find_col): Check
for possitive numbers. I think the right fix is to accept negative
numbers and find the column even if the number is negative instead
of this ugly restriction.
1998-11-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet.c (cellref_name): Add more space.
1998-12-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* src/Makefile.am: make Gnumeric-impl.c dependend on Gnumeric.h to
......
1998-12-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-cursor.c (item_cursor_autofill_event): Do not pass
negative numbers to item_grid_find_col and item_grid_find_row.
* src/item-grid.c (item_grid_find_row, item_grid_find_col): Check
for possitive numbers. I think the right fix is to accept negative
numbers and find the column even if the number is negative instead
of this ugly restriction.
1998-11-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet.c (cellref_name): Add more space.
1998-12-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* src/Makefile.am: make Gnumeric-impl.c dependend on Gnumeric.h to
......
1998-12-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-cursor.c (item_cursor_autofill_event): Do not pass
negative numbers to item_grid_find_col and item_grid_find_row.
* src/item-grid.c (item_grid_find_row, item_grid_find_col): Check
for possitive numbers. I think the right fix is to accept negative
numbers and find the column even if the number is negative instead
of this ugly restriction.
1998-11-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet.c (cellref_name): Add more space.
1998-12-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* src/Makefile.am: make Gnumeric-impl.c dependend on Gnumeric.h to
......
......@@ -173,6 +173,30 @@
</sect1>
<sect1>
<title>Formula storage</title>
<para>When a formula is encountered, Gnumeric parses the formula
into a tree structure. The tree structure is later used to
evaluate the expression at a given location (each cordinate in a
cell references is stored as either an absolute reference or a
relative reference to the cell position).</para>
<para>To speed up formula duplication, Gnumeric reference counts
the parsed expression, this allow for quick duplication of
expressions. It should be noted that some file formats (the
Excel file format) uses formula references, which can preserve
the memory saving features of reference counting.</para>
<para>Currently Gnumeric does not provide any way to keep these
references, a possible scheme for saving correctly these cells
would be to keep in a special list any formula being saved that
has a reference count bigger than one and keep track of these
duplicates and generate formula references in the output file
rather than outputing the actual formula.
<para>
</sect1>
<sect1>
<title>Resource management</title>
......
......@@ -173,6 +173,30 @@
</sect1>
<sect1>
<title>Formula storage</title>
<para>When a formula is encountered, Gnumeric parses the formula
into a tree structure. The tree structure is later used to
evaluate the expression at a given location (each cordinate in a
cell references is stored as either an absolute reference or a
relative reference to the cell position).</para>
<para>To speed up formula duplication, Gnumeric reference counts
the parsed expression, this allow for quick duplication of
expressions. It should be noted that some file formats (the
Excel file format) uses formula references, which can preserve
the memory saving features of reference counting.</para>
<para>Currently Gnumeric does not provide any way to keep these
references, a possible scheme for saving correctly these cells
would be to keep in a special list any formula being saved that
has a reference count bigger than one and keep track of these
duplicates and generate formula references in the output file
rather than outputing the actual formula.
<para>
</sect1>
<sect1>
<title>Resource management</title>
......
......@@ -709,6 +709,10 @@ item_cursor_autofill_event (GnomeCanvasItem *item, GdkEvent *event)
case GDK_MOTION_NOTIFY:
gnome_canvas_w2c (canvas, event->button.x, event->button.y, &x, &y);
if (x < 0)
x = 0;
if (y < 0)
y = 0;
col = item_grid_find_col (item_cursor->item_grid, x, NULL);
row = item_grid_find_row (item_cursor->item_grid, y, NULL);
......
......@@ -121,6 +121,13 @@ item_grid_find_col (ItemGrid *item_grid, int x, int *col_origin)
int col = item_grid->left_col;
int pixel = item_grid->left_offset;
/*
* FIXME: This should probably take negative numbers
* as well to provide sliding when moving backwards (look
* in item-cursor.c
*/
g_return_if_fail (x >= 0);
do {
ColRowInfo *ci = sheet_col_get_info (item_grid->sheet, col);
......@@ -143,6 +150,13 @@ item_grid_find_row (ItemGrid *item_grid, int y, int *row_origin)
int row = item_grid->top_row;
int pixel = item_grid->top_offset;
/*
* FIXME: This should probably take negative numbers
* as well to provide sliding when moving backwards (look
* in item-cursor.c
*/
g_return_if_fail (y >= 0);
do {
ColRowInfo *ri = sheet_row_get_info (item_grid->sheet, row);
......
......@@ -3151,7 +3151,7 @@ sheet_show_cursor (Sheet *sheet)
char *
cellref_name (CellRef *cell_ref, Sheet *eval_sheet, int eval_col, int eval_row)
{
static char buffer [sizeof (long) * 4];
static char buffer [sizeof (long) * 4 + 4];
char *p = buffer;
int col, row;
......
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