Commit de62dd3a authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Begin to rationalize support for inverted and 3D references.

More renaming and movement name rationalization.
Some minor improvements in the function wizard.

2000-05-03  Jody Goldberg <jgoldberg@home.com>

	* EvalPosition -> EvalPos
	  ParsePosition -> ParsePos
	  new struct RangeRef used in ValueRange

	  eval_pos_init* -> position.[ch]
	  parse_pos_init*
	  cell_ref_{get,make}*

	* src/workbook.c : Reorder the toolbar a bit.
	(workbook_foreach_cell_in_range) : New function.
	(cb_autofunction) : New routine.
	(workbook_set_auto_expr) : DO NOT put real code into pre/post
	  conditions.  It will be removed when debugging is eventually
	  disabled.

	* src/position.c (range_ref_normalize) : New function.

	* src/ranges.c (range_normalize) : New function.

	* src/expr.c (expr_implicit_intersection) : Use range_ref_normalize.

	* src/eval.c (cell_eval_content) : No need to release the value.
	  cell_assign_value already does that.
	(dependency_range_ctor) : Use range_normalize.

	* src/auto-format.c (do_af_suggest) : Use workbook_foreach_cell_in_range.

	* src/cell.c (cell_set_expr_and_value) : link the new expression but
	  do not queue it for recalc.
	(cell_assign_value) : Release the old value.
	(cell_copy) : Init the value to empty.

	* src/func.c (function_iterate_do_value) : Use
	  workbook_foreach_cell_in_range.

	* src/dialogs/dialog-function-wizard.c (create_description) : Use
	  a label rather than a text entry widget.  It looks better.

	* src/functions/fn-string.c (gnumeric_expression) : range is already
	  absolute.

	* src/functions/fn-stat.c (gnumeric_linest) : Handle inverted ranges.
	(gnumeric_logest) : Ditto.

	* src/functions/fn-information.c (gnumeric_countblank) : Use
	workbook_foreach_cell_in_range.
	(gnumeric_{row,column}) : Handle inversions.

	* src/functions/fn-lookup.c (gnumeric_offset) : No need to make
	  absolute.  The marshaller already did that.

2000-05-02  Jody Goldberg <jgoldberg@home.com>

	* src/eval.c (dependency_range_ctor) : normalize the range.

	* src/xml-io.c (xml_write_cell_and_position) : Suppress warning.

	* src/pixmaps.h : Add function wizard and equal sign.
parent 3de60968
......@@ -5,13 +5,23 @@ and longer term bugs.
Release Critical
----------------
- gnumeric_countif
gnumeric_sumif : Comment and code do not agree, who is right.
- gnumeric_sumx2my2
gnumeric_sumx2py2
gnumeric_sumxmy2 : These do not handle blank cells.
- gnumeric_ftest : Needs auditing. All calls to eval_pos_init_cellref
are questionable.
Long term breakage
------------------
- The max row/col scroll size is still hard coded.
- Increase/Decrease precision toolbar buttons should look at the displayed
precision for the edit cell and assign the changed value to the entire
selection. Not individually adjusting each non-blank cells precision.
selection. Not individually adjusting each non-blank cell's precision.
- Auto resize needs to handle empty cells.
- Clearing a cell that stopped a span does not regenerate the span.
......
2000-05-03 Jody Goldberg <jgoldberg@home.com>
* EvalPosition -> EvalPos
ParsePosition -> ParsePos
new struct RangeRef used in ValueRange
eval_pos_init* -> position.[ch]
parse_pos_init*
cell_ref_{get,make}*
* src/workbook.c : Reorder the toolbar a bit.
(workbook_foreach_cell_in_range) : New function.
(cb_autofunction) : New routine.
(workbook_set_auto_expr) : DO NOT put real code into pre/post
conditions. It will be removed when debugging is eventually
disabled.
* src/position.c (range_ref_normalize) : New function.
* src/ranges.c (range_normalize) : New function.
* src/expr.c (expr_implicit_intersection) : Use range_ref_normalize.
* src/eval.c (cell_eval_content) : No need to release the value.
cell_assign_value already does that.
(dependency_range_ctor) : Use range_normalize.
* src/auto-format.c (do_af_suggest) : Use workbook_foreach_cell_in_range.
* src/cell.c (cell_set_expr_and_value) : link the new expression but
do not queue it for recalc.
(cell_assign_value) : Release the old value.
(cell_copy) : Init the value to empty.
* src/func.c (function_iterate_do_value) : Use
workbook_foreach_cell_in_range.
* src/dialogs/dialog-function-wizard.c (create_description) : Use
a label rather than a text entry widget. It looks better.
* src/functions/fn-string.c (gnumeric_expression) : range is already
absolute.
* src/functions/fn-stat.c (gnumeric_linest) : Handle inverted ranges.
(gnumeric_logest) : Ditto.
* src/functions/fn-information.c (gnumeric_countblank) : Use
workbook_foreach_cell_in_range.
(gnumeric_{row,column}) : Handle inversions.
* src/functions/fn-lookup.c (gnumeric_offset) : No need to make
absolute. The marshaller already did that.
2000-05-02 Jody Goldberg <jgoldberg@home.com>
* src/eval.c (dependency_range_ctor) : normalize the range.
* src/xml-io.c (xml_write_cell_and_position) : Suppress warning.
* src/pixmaps.h : Add function wizard and equal sign.
2000-05-03 Michael Meeks <michael@helixcode.com>
* doc/Dependencies.txt: update to reflect changes.
......
2000-05-03 Jody Goldberg <jgoldberg@home.com>
* EvalPosition -> EvalPos
ParsePosition -> ParsePos
new struct RangeRef used in ValueRange
eval_pos_init* -> position.[ch]
parse_pos_init*
cell_ref_{get,make}*
* src/workbook.c : Reorder the toolbar a bit.
(workbook_foreach_cell_in_range) : New function.
(cb_autofunction) : New routine.
(workbook_set_auto_expr) : DO NOT put real code into pre/post
conditions. It will be removed when debugging is eventually
disabled.
* src/position.c (range_ref_normalize) : New function.
* src/ranges.c (range_normalize) : New function.
* src/expr.c (expr_implicit_intersection) : Use range_ref_normalize.
* src/eval.c (cell_eval_content) : No need to release the value.
cell_assign_value already does that.
(dependency_range_ctor) : Use range_normalize.
* src/auto-format.c (do_af_suggest) : Use workbook_foreach_cell_in_range.
* src/cell.c (cell_set_expr_and_value) : link the new expression but
do not queue it for recalc.
(cell_assign_value) : Release the old value.
(cell_copy) : Init the value to empty.
* src/func.c (function_iterate_do_value) : Use
workbook_foreach_cell_in_range.
* src/dialogs/dialog-function-wizard.c (create_description) : Use
a label rather than a text entry widget. It looks better.
* src/functions/fn-string.c (gnumeric_expression) : range is already
absolute.
* src/functions/fn-stat.c (gnumeric_linest) : Handle inverted ranges.
(gnumeric_logest) : Ditto.
* src/functions/fn-information.c (gnumeric_countblank) : Use
workbook_foreach_cell_in_range.
(gnumeric_{row,column}) : Handle inversions.
* src/functions/fn-lookup.c (gnumeric_offset) : No need to make
absolute. The marshaller already did that.
2000-05-02 Jody Goldberg <jgoldberg@home.com>
* src/eval.c (dependency_range_ctor) : normalize the range.
* src/xml-io.c (xml_write_cell_and_position) : Suppress warning.
* src/pixmaps.h : Add function wizard and equal sign.
2000-05-03 Michael Meeks <michael@helixcode.com>
* doc/Dependencies.txt: update to reflect changes.
......
2000-05-03 Jody Goldberg <jgoldberg@home.com>
* EvalPosition -> EvalPos
ParsePosition -> ParsePos
new struct RangeRef used in ValueRange
eval_pos_init* -> position.[ch]
parse_pos_init*
cell_ref_{get,make}*
* src/workbook.c : Reorder the toolbar a bit.
(workbook_foreach_cell_in_range) : New function.
(cb_autofunction) : New routine.
(workbook_set_auto_expr) : DO NOT put real code into pre/post
conditions. It will be removed when debugging is eventually
disabled.
* src/position.c (range_ref_normalize) : New function.
* src/ranges.c (range_normalize) : New function.
* src/expr.c (expr_implicit_intersection) : Use range_ref_normalize.
* src/eval.c (cell_eval_content) : No need to release the value.
cell_assign_value already does that.
(dependency_range_ctor) : Use range_normalize.
* src/auto-format.c (do_af_suggest) : Use workbook_foreach_cell_in_range.
* src/cell.c (cell_set_expr_and_value) : link the new expression but
do not queue it for recalc.
(cell_assign_value) : Release the old value.
(cell_copy) : Init the value to empty.
* src/func.c (function_iterate_do_value) : Use
workbook_foreach_cell_in_range.
* src/dialogs/dialog-function-wizard.c (create_description) : Use
a label rather than a text entry widget. It looks better.
* src/functions/fn-string.c (gnumeric_expression) : range is already
absolute.
* src/functions/fn-stat.c (gnumeric_linest) : Handle inverted ranges.
(gnumeric_logest) : Ditto.
* src/functions/fn-information.c (gnumeric_countblank) : Use
workbook_foreach_cell_in_range.
(gnumeric_{row,column}) : Handle inversions.
* src/functions/fn-lookup.c (gnumeric_offset) : No need to make
absolute. The marshaller already did that.
2000-05-02 Jody Goldberg <jgoldberg@home.com>
* src/eval.c (dependency_range_ctor) : normalize the range.
* src/xml-io.c (xml_write_cell_and_position) : Suppress warning.
* src/pixmaps.h : Add function wizard and equal sign.
2000-05-03 Michael Meeks <michael@helixcode.com>
* doc/Dependencies.txt: update to reflect changes.
......
2000-05-03 Jody Goldberg <jgoldberg@home.com>
* EvalPosition -> EvalPos
ParsePosition -> ParsePos
new struct RangeRef used in ValueRange
eval_pos_init* -> position.[ch]
parse_pos_init*
cell_ref_{get,make}*
* src/workbook.c : Reorder the toolbar a bit.
(workbook_foreach_cell_in_range) : New function.
(cb_autofunction) : New routine.
(workbook_set_auto_expr) : DO NOT put real code into pre/post
conditions. It will be removed when debugging is eventually
disabled.
* src/position.c (range_ref_normalize) : New function.
* src/ranges.c (range_normalize) : New function.
* src/expr.c (expr_implicit_intersection) : Use range_ref_normalize.
* src/eval.c (cell_eval_content) : No need to release the value.
cell_assign_value already does that.
(dependency_range_ctor) : Use range_normalize.
* src/auto-format.c (do_af_suggest) : Use workbook_foreach_cell_in_range.
* src/cell.c (cell_set_expr_and_value) : link the new expression but
do not queue it for recalc.
(cell_assign_value) : Release the old value.
(cell_copy) : Init the value to empty.
* src/func.c (function_iterate_do_value) : Use
workbook_foreach_cell_in_range.
* src/dialogs/dialog-function-wizard.c (create_description) : Use
a label rather than a text entry widget. It looks better.
* src/functions/fn-string.c (gnumeric_expression) : range is already
absolute.
* src/functions/fn-stat.c (gnumeric_linest) : Handle inverted ranges.
(gnumeric_logest) : Ditto.
* src/functions/fn-information.c (gnumeric_countblank) : Use
workbook_foreach_cell_in_range.
(gnumeric_{row,column}) : Handle inversions.
* src/functions/fn-lookup.c (gnumeric_offset) : No need to make
absolute. The marshaller already did that.
2000-05-02 Jody Goldberg <jgoldberg@home.com>
* src/eval.c (dependency_range_ctor) : normalize the range.
* src/xml-io.c (xml_write_cell_and_position) : Suppress warning.
* src/pixmaps.h : Add function wizard and equal sign.
2000-05-03 Michael Meeks <michael@helixcode.com>
* doc/Dependencies.txt: update to reflect changes.
......
2000-05-03 Jody Goldberg <jgoldberg@home.com>
* EvalPosition -> EvalPos
ParsePosition -> ParsePos
new struct RangeRef used in ValueRange
eval_pos_init* -> position.[ch]
parse_pos_init*
cell_ref_{get,make}*
* src/workbook.c : Reorder the toolbar a bit.
(workbook_foreach_cell_in_range) : New function.
(cb_autofunction) : New routine.
(workbook_set_auto_expr) : DO NOT put real code into pre/post
conditions. It will be removed when debugging is eventually
disabled.
* src/position.c (range_ref_normalize) : New function.
* src/ranges.c (range_normalize) : New function.
* src/expr.c (expr_implicit_intersection) : Use range_ref_normalize.
* src/eval.c (cell_eval_content) : No need to release the value.
cell_assign_value already does that.
(dependency_range_ctor) : Use range_normalize.
* src/auto-format.c (do_af_suggest) : Use workbook_foreach_cell_in_range.
* src/cell.c (cell_set_expr_and_value) : link the new expression but
do not queue it for recalc.
(cell_assign_value) : Release the old value.
(cell_copy) : Init the value to empty.
* src/func.c (function_iterate_do_value) : Use
workbook_foreach_cell_in_range.
* src/dialogs/dialog-function-wizard.c (create_description) : Use
a label rather than a text entry widget. It looks better.
* src/functions/fn-string.c (gnumeric_expression) : range is already
absolute.
* src/functions/fn-stat.c (gnumeric_linest) : Handle inverted ranges.
(gnumeric_logest) : Ditto.
* src/functions/fn-information.c (gnumeric_countblank) : Use
workbook_foreach_cell_in_range.
(gnumeric_{row,column}) : Handle inversions.
* src/functions/fn-lookup.c (gnumeric_offset) : No need to make
absolute. The marshaller already did that.
2000-05-02 Jody Goldberg <jgoldberg@home.com>
* src/eval.c (dependency_range_ctor) : normalize the range.
* src/xml-io.c (xml_write_cell_and_position) : Suppress warning.
* src/pixmaps.h : Add function wizard and equal sign.
2000-05-03 Michael Meeks <michael@helixcode.com>
* doc/Dependencies.txt: update to reflect changes.
......
2000-05-03 Jody Goldberg <jgoldberg@home.com>
* EvalPosition -> EvalPos
ParsePosition -> ParsePos
new struct RangeRef used in ValueRange
eval_pos_init* -> position.[ch]
parse_pos_init*
cell_ref_{get,make}*
* src/workbook.c : Reorder the toolbar a bit.
(workbook_foreach_cell_in_range) : New function.
(cb_autofunction) : New routine.
(workbook_set_auto_expr) : DO NOT put real code into pre/post
conditions. It will be removed when debugging is eventually
disabled.
* src/position.c (range_ref_normalize) : New function.
* src/ranges.c (range_normalize) : New function.
* src/expr.c (expr_implicit_intersection) : Use range_ref_normalize.
* src/eval.c (cell_eval_content) : No need to release the value.
cell_assign_value already does that.
(dependency_range_ctor) : Use range_normalize.
* src/auto-format.c (do_af_suggest) : Use workbook_foreach_cell_in_range.
* src/cell.c (cell_set_expr_and_value) : link the new expression but
do not queue it for recalc.
(cell_assign_value) : Release the old value.
(cell_copy) : Init the value to empty.
* src/func.c (function_iterate_do_value) : Use
workbook_foreach_cell_in_range.
* src/dialogs/dialog-function-wizard.c (create_description) : Use
a label rather than a text entry widget. It looks better.
* src/functions/fn-string.c (gnumeric_expression) : range is already
absolute.
* src/functions/fn-stat.c (gnumeric_linest) : Handle inverted ranges.
(gnumeric_logest) : Ditto.
* src/functions/fn-information.c (gnumeric_countblank) : Use
workbook_foreach_cell_in_range.
(gnumeric_{row,column}) : Handle inversions.
* src/functions/fn-lookup.c (gnumeric_offset) : No need to make
absolute. The marshaller already did that.
2000-05-02 Jody Goldberg <jgoldberg@home.com>
* src/eval.c (dependency_range_ctor) : normalize the range.
* src/xml-io.c (xml_write_cell_and_position) : Suppress warning.
* src/pixmaps.h : Add function wizard and equal sign.
2000-05-03 Michael Meeks <michael@helixcode.com>
* doc/Dependencies.txt: update to reflect changes.
......
2000-05-03 Jody Goldberg <jgoldberg@home.com>
* EvalPosition -> EvalPos
ParsePosition -> ParsePos
new struct RangeRef used in ValueRange
eval_pos_init* -> position.[ch]
parse_pos_init*
cell_ref_{get,make}*
* src/workbook.c : Reorder the toolbar a bit.
(workbook_foreach_cell_in_range) : New function.
(cb_autofunction) : New routine.
(workbook_set_auto_expr) : DO NOT put real code into pre/post
conditions. It will be removed when debugging is eventually
disabled.
* src/position.c (range_ref_normalize) : New function.
* src/ranges.c (range_normalize) : New function.
* src/expr.c (expr_implicit_intersection) : Use range_ref_normalize.
* src/eval.c (cell_eval_content) : No need to release the value.
cell_assign_value already does that.
(dependency_range_ctor) : Use range_normalize.
* src/auto-format.c (do_af_suggest) : Use workbook_foreach_cell_in_range.
* src/cell.c (cell_set_expr_and_value) : link the new expression but
do not queue it for recalc.
(cell_assign_value) : Release the old value.
(cell_copy) : Init the value to empty.
* src/func.c (function_iterate_do_value) : Use
workbook_foreach_cell_in_range.
* src/dialogs/dialog-function-wizard.c (create_description) : Use
a label rather than a text entry widget. It looks better.
* src/functions/fn-string.c (gnumeric_expression) : range is already
absolute.
* src/functions/fn-stat.c (gnumeric_linest) : Handle inverted ranges.
(gnumeric_logest) : Ditto.
* src/functions/fn-information.c (gnumeric_countblank) : Use
workbook_foreach_cell_in_range.
(gnumeric_{row,column}) : Handle inversions.
* src/functions/fn-lookup.c (gnumeric_offset) : No need to make
absolute. The marshaller already did that.
2000-05-02 Jody Goldberg <jgoldberg@home.com>
* src/eval.c (dependency_range_ctor) : normalize the range.
* src/xml-io.c (xml_write_cell_and_position) : Suppress warning.
* src/pixmaps.h : Add function wizard and equal sign.
2000-05-03 Michael Meeks <michael@helixcode.com>
* doc/Dependencies.txt: update to reflect changes.
......
2000-05-03 Jody Goldberg <jgoldberg@home.com>
* ms-excel-write.c (write_cell) : Use parse_pos_init_cell.
* ms-excel-read.c (ms_excel_read_formula) : No need to manually
cleanout the old value. The various assignment routines take care
of that.
Honour the recalc flags for expressions. Array expressions are
still unconditionally recalced, but the common case is handled
correctly.
2000-04-24 Jody Goldberg <jgoldberg@home.com>
* ms-excel-read.c : format police.
......
......@@ -703,7 +703,7 @@ biff_name_data_get_name (ExcelSheet *sheet, int idx)
bnd->name);
#ifndef NO_DEBUG_EXCEL
else if (ms_excel_read_debug > 1) {
ParsePosition ep;
ParsePos ep;
parse_pos_init (&ep, NULL, sheet->gnum_sheet, 0, 0);
printf ("Parsed name : '%s' = '%s'\n",
bnd->name, tree
......@@ -1821,8 +1821,9 @@ ms_excel_read_formula (BiffQuery *q, ExcelSheet *sheet)
/* Pre-retrieve incase this is a string */
gboolean array_elem, is_string = FALSE;
guint16 const xf_index = EX_GETXF (q);
guint16 const col = EX_GETCOL (q);
guint16 const row = EX_GETROW (q);
guint16 const col = EX_GETCOL (q);
guint16 const row = EX_GETROW (q);
guint16 const options = MS_OLE_GET_GUINT16 (q->data+14);
Cell *cell;
ExprTree *expr;
Value *val = NULL;
......@@ -1881,7 +1882,7 @@ ms_excel_read_formula (BiffQuery *q, ExcelSheet *sheet)
case 2 : /* Error */
{
EvalPosition ep;
EvalPos ep;
guint8 const v = MS_OLE_GET_GUINT8 (q->data+8);
char const *const err_str =
biff_get_error_text (v);
......@@ -1915,9 +1916,6 @@ ms_excel_read_formula (BiffQuery *q, ExcelSheet *sheet)
};
}
/* Now try to parse the formula
* Flag any errors that arise
*/
expr = ms_excel_parse_formula (sheet->wb, sheet, (q->data + 22),
col, row,
FALSE, MS_OLE_GET_GUINT16 (q->data+20),
......@@ -1944,14 +1942,18 @@ ms_excel_read_formula (BiffQuery *q, ExcelSheet *sheet)
if (len > 0)
v = biff_get_text (q->data + 2, len, NULL);
else
v = g_strdup(""); /* Pre-Biff8 seems to use len=0 */
/*
* Pre-Biff8 seems to use len=0
* Should that be a string or an EMPTY?
*/
v = g_strdup("");
}
if (v) {
val = value_new_string (v);
g_free (v);
} else {
EvalPosition pos;
val = value_new_error (eval_pos_cell (&pos, cell), "INVALID STRING");
EvalPos pos;
val = value_new_error (eval_pos_init_cell (&pos, cell), "INVALID STRING");
g_warning ("EXCEL : invalid STRING record");
}
} else {
......@@ -1959,22 +1961,16 @@ ms_excel_read_formula (BiffQuery *q, ExcelSheet *sheet)
* Docs say that there should be a STRING
* record here
*/
EvalPosition pos;
val = value_new_error (eval_pos_cell (&pos, cell), "MISSING STRING");
EvalPos pos;
val = value_new_error (eval_pos_init_cell (&pos, cell), "MISSING STRING");
g_warning ("EXCEL : missing STRING record");
}
}
/* Some cells (array formulas) will have a value */
if (cell->value != NULL) {
value_release (cell->value);
cell->value = NULL;
}
/* We MUST have a value */
if (val == NULL) {
EvalPosition pos;
val = value_new_error (eval_pos_cell (&pos, cell), "MISSING Value");
EvalPos pos;
val = value_new_error (eval_pos_init_cell (&pos, cell), "MISSING Value");
g_warning ("EXCEL : Invalid state. Missing Value?");
}
......@@ -1986,11 +1982,12 @@ ms_excel_read_formula (BiffQuery *q, ExcelSheet *sheet)
*/
if (expr == NULL && !array_elem) {
g_warning ("EXCEL : How does cell %s%d have an array expression ?",
col_name(cell->col_info->pos), cell->row_info->pos);
col_name (cell->col_info->pos),
cell->row_info->pos);
cell_set_value (cell, val, NULL);
} else
cell_assign_value (cell, val, NULL);
} else if (!cell_has_expr(cell)) {
} else if (!cell_has_expr (cell)) {
cell_set_expr_and_value (cell, expr, val);
expr_tree_unref (expr);
} else {
......@@ -2001,6 +1998,13 @@ ms_excel_read_formula (BiffQuery *q, ExcelSheet *sheet)
g_warning ("EXCEL : Shared formula problems");
cell_set_value (cell, val, NULL);
}
/*
* 0x1 = AlwaysCalc
* 0x2 = CalcOnLoad
*/
if (options & 0x3)
cell_queue_recalc (cell);
}
BiffSharedFormula *
......
......@@ -32,6 +32,7 @@
#include "gnumeric.h"
#include "gnumeric-util.h"
#include "format.h"
#include "position.h"
#include "color.h"
#include "cell.h"
#include "sheet-object.h"
......@@ -2425,15 +2426,12 @@ write_cell (BiffPut *bp, ExcelSheet *sheet, const ExcelCell *cell)
#ifndef NO_DEBUG_EXCEL
if (ms_excel_write_debug > 2) {
ParsePosition tmp;
ParsePos tmp;
printf ("Writing cell at %s '%s' = '%s', xf = 0x%x\n",
cell_name (gnum_cell),
(cell_has_expr (gnum_cell) ?
expr_decode_tree (gnum_cell->u.expression,
parse_pos_init (&tmp,
NULL,
sheet->gnum_sheet,
col, row)) :
parse_pos_init_cell (&tmp, gnum_cell)) :
"none"),
(gnum_cell->value ?
value_get_as_string (gnum_cell->value) : "empty"),
......
......@@ -651,9 +651,11 @@ write_node (PolishData *pd, ExprTree *tree)
break;
case VALUE_CELLRANGE:
{ /* FIXME: Could be 3D ! */
write_area (pd, &v->v_range.cell_a,
&v->v_range.cell_b);
{
/* FIXME: Could be 3D ! */
/* FIXME: Could be inverted ! */
write_area (pd, &v->v_range.cell.a,
&v->v_range.cell.b);
break;
}
......
......@@ -104,7 +104,7 @@ criteria_test_greater_or_equal(Value *x, Value *y)
/* Finds a column index of a field.
*/
static int
find_column_of_field (const EvalPosition *ep, Value *database, Value *field)
find_column_of_field (const EvalPos *ep, Value *database, Value *field)
{
Sheet *sheet;
Cell *cell;
......@@ -112,8 +112,8 @@ find_column_of_field (const EvalPosition *ep, Value *database, Value *field)
int begin_col, end_col, row, n, column;
int offset;
offset = database->v_range.cell_b.col -
database->v_range.cell_a.col;
offset = database->v_range.cell.b.col -
database->v_range.cell.a.col;
if (field->type == VALUE_INTEGER)
return value_get_as_int (field) + offset - 1;
......@@ -121,14 +121,14 @@ find_column_of_field (const EvalPosition *ep, Value *database, Value *field)
if (field->type != VALUE_STRING)
return -1;
sheet = eval_sheet (database->v_range.cell_a.sheet, ep->sheet);
sheet = eval_sheet (database->v_range.cell.a.sheet, ep->sheet);
field_name = value_get_as_string (field);
column = -1;
/* find the column that is labeled after `field_name' */
begin_col = database->v_range.cell_a.col;
end_col = database->v_range.cell_b.col;
row = database->v_range.cell_a.row;
begin_col = database->v_range.cell.a.col;
end_col = database->v_range.cell.b.col;
row = database->v_range.cell.a.row;
for (n = begin_col; n <= end_col; n++) {
char *txt;
......@@ -271,7 +271,7 @@ parse_criteria_range(Sheet *sheet, int b_col, int b_row, int e_col, int e_row,
/* Parses the criteria cell range.
*/
static GSList *
parse_database_criteria (const EvalPosition *ep, Value *database,
parse_database_criteria (const EvalPos *ep, Value *database,
Value *criteria)
{
Sheet *sheet;
......@@ -282,11 +282,11 @@ parse_database_criteria (const EvalPosition *ep, Value *database,
int b_col, b_row, e_col, e_row;
int *field_ind;
sheet = eval_sheet (database->v_range.cell_a.sheet, ep->sheet);
b_col = criteria->v_range.cell_a.col;
b_row = criteria->v_range.cell_a.row;
e_col = criteria->v_range.cell_b.col;
e_row = criteria->v_range.cell_b.row;
sheet = eval_sheet (database->v_range.cell.a.sheet, ep->sheet);
b_col = criteria->v_range.cell.a.col;
b_row = criteria->v_range.cell.a.row;
e_col = criteria->v_range.cell.b.col;
e_row = criteria->v_range.cell.b.row;
field_ind = g_new(int, (e_col-b_col+1));
......@@ -318,9 +318,9 @@ find_cells_that_match (Sheet *sheet, Value *database,
{
GSList *current, *conditions, *cells;
int row, first_row, last_row, add_flag;
last_row = database->v_range.cell_b.row;
last_row = database->v_range.cell.b.row;
cells = NULL;
first_row = database->v_range.cell_a.row + 1;
first_row = database->v_range.cell.a.row + 1;
for (row=first_row; row<=last_row; row++) {
Cell *cell, *test_cell;
......@@ -527,7 +527,7 @@ gnumeric_daverage (FunctionEvalInfo *ei, Value **argv)
if (criterias == NULL)
return value_new_error (ei->pos, gnumeric_err_NUM);
sheet = eval_sheet (database->v_range.cell_a.sheet,