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

Handle blanks as 0. (callback_function_make_list) : Ditto.


2000-08-07  Jody Goldberg <jgoldberg@home.com>

	* src/functions/fn-stat.c (callback_function_stat) : Handle blanks as 0.
	(callback_function_make_list) : Ditto.
	(callback_function_ttest) : Ditto.
	(gnumeric_mode) : Explicitly ignore blanks.
	(gnumeric_count) : Ditto.
	(gnumeric_ztest) : Ditto.
	(gnumeric_counta) : Ditto.
	(gnumeric_percentile) : Ditto.
	(gnumeric_quartile) : Ditto.
	(gnumeric_prob) : DO NOT IGNORE BLANKS.
	(gnumeric_ftest) : Ditto.
	(gnumeric_ttest) : Ditto.
	(gnumeric_frequency) : Ditto.

	* src/functions/fn-logical.c (gnumeric_and) : Handle
	  changes to function_iterate_argument_values.
	(gnumeric_or) : Ditto.
	* src/functions/fn-math.c (gnumeric_lcm) : Ditto.
	(gnumeric_multinomial) : Ditto.
	(gnumeric_seriessum) : Ditto.

	* src/functions/fn-financial.c (gnumeric_mirr) : Use the old
	  behavior of ignoring blanks.
	(gnumeric_irr) : Ditto.
	(gnumeric_npv) : Ditto.

	* src/functions/fn-eng.c (gnumeric_improduct) : Handle
	  changes to function_iterate_argument_values.
	(gnumeric_imsum) : Ditto.

	* src/func.c (function_iterate_argument_values) : Add ignore_blank
	  flag.

	* src/collect.c (callback_function_collect) : Support new collect flag
	  COLLECT_IGNORE_BLANKS.
	(collect_floats) : change to function_iterate_argument_values.
	(float_range_function2) : Use COLLECT_IGNORE_BLANKS.

2000-08-01  Jody Goldberg <jgoldberg@home.com>

	* src/sheet-autofill.c (fill_item_new) : It is legal to have 'D' and 'M'
	  for day or month fields.

2000-08-01  Jody Goldberg <jgoldberg@home.com>
	For : John N S Gill <bmrg@gofree.indigo.ie>

	* src/item-cursor.c (item_cursor_autofill_event) : Implement support
	  for double click on autofill button.
parent eeacb4bb
......@@ -4,16 +4,18 @@ and longer term bugs.
Release Critical
----------------
- Amny of the Valye -> date routines do not handle error arguments properly.
- Many of the Value -> date routines do not handle error arguments properly.
- expressions -> strings loose the format used to parse values.
- saving the entered_text then parsing in locale C on restore is broken.
- We should save per row/col maximums.
- Changing the size of all rows/cols creates big xml files.
- Changing the size of all rows/cols creates big xml files, and slows
calculations to a crawl
- Saving xml should not rely on changing the textdomain to disable translation
of TRUE/FALSE.
Long term breakage
------------------
- Check the autofill code for defaulting to years vs days.
- Changing an expression name that is in use does not recalc, or regen depends
correctly.
- The max row/col canvas scroll size is still hard coded.
......
2000-08-07 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c (callback_function_stat) : Handle blanks as 0.
(callback_function_make_list) : Ditto.
(callback_function_ttest) : Ditto.
(gnumeric_mode) : Explicitly ignore blanks.
(gnumeric_count) : Ditto.
(gnumeric_ztest) : Ditto.
(gnumeric_counta) : Ditto.
(gnumeric_percentile) : Ditto.
(gnumeric_quartile) : Ditto.
(gnumeric_prob) : DO NOT IGNORE BLANKS.
(gnumeric_ftest) : Ditto.
(gnumeric_ttest) : Ditto.
(gnumeric_frequency) : Ditto.
* src/functions/fn-logical.c (gnumeric_and) : Handle
changes to function_iterate_argument_values.
(gnumeric_or) : Ditto.
* src/functions/fn-math.c (gnumeric_lcm) : Ditto.
(gnumeric_multinomial) : Ditto.
(gnumeric_seriessum) : Ditto.
* src/functions/fn-financial.c (gnumeric_mirr) : Use the old
behavior of ignoring blanks.
(gnumeric_irr) : Ditto.
(gnumeric_npv) : Ditto.
* src/functions/fn-eng.c (gnumeric_improduct) : Handle
changes to function_iterate_argument_values.
(gnumeric_imsum) : Ditto.
* src/func.c (function_iterate_argument_values) : Add ignore_blank
flag.
* src/collect.c (callback_function_collect) : Support new collect flag
COLLECT_IGNORE_BLANKS.
(collect_floats) : change to function_iterate_argument_values.
(float_range_function2) : Use COLLECT_IGNORE_BLANKS.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
* src/sheet-autofill.c (fill_item_new) : It is legal to have 'D' and 'M'
for day or month fields.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
For : John N S Gill <bmrg@gofree.indigo.ie>
* src/item-cursor.c (item_cursor_autofill_event) : Implement support
for double click on autofill button.
2000-08-02 Michael Meeks <michael@helixcode.com>
* configure.in: update for BonoboX
......
2000-08-07 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c (callback_function_stat) : Handle blanks as 0.
(callback_function_make_list) : Ditto.
(callback_function_ttest) : Ditto.
(gnumeric_mode) : Explicitly ignore blanks.
(gnumeric_count) : Ditto.
(gnumeric_ztest) : Ditto.
(gnumeric_counta) : Ditto.
(gnumeric_percentile) : Ditto.
(gnumeric_quartile) : Ditto.
(gnumeric_prob) : DO NOT IGNORE BLANKS.
(gnumeric_ftest) : Ditto.
(gnumeric_ttest) : Ditto.
(gnumeric_frequency) : Ditto.
* src/functions/fn-logical.c (gnumeric_and) : Handle
changes to function_iterate_argument_values.
(gnumeric_or) : Ditto.
* src/functions/fn-math.c (gnumeric_lcm) : Ditto.
(gnumeric_multinomial) : Ditto.
(gnumeric_seriessum) : Ditto.
* src/functions/fn-financial.c (gnumeric_mirr) : Use the old
behavior of ignoring blanks.
(gnumeric_irr) : Ditto.
(gnumeric_npv) : Ditto.
* src/functions/fn-eng.c (gnumeric_improduct) : Handle
changes to function_iterate_argument_values.
(gnumeric_imsum) : Ditto.
* src/func.c (function_iterate_argument_values) : Add ignore_blank
flag.
* src/collect.c (callback_function_collect) : Support new collect flag
COLLECT_IGNORE_BLANKS.
(collect_floats) : change to function_iterate_argument_values.
(float_range_function2) : Use COLLECT_IGNORE_BLANKS.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
* src/sheet-autofill.c (fill_item_new) : It is legal to have 'D' and 'M'
for day or month fields.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
For : John N S Gill <bmrg@gofree.indigo.ie>
* src/item-cursor.c (item_cursor_autofill_event) : Implement support
for double click on autofill button.
2000-08-02 Michael Meeks <michael@helixcode.com>
* configure.in: update for BonoboX
......
......@@ -9,6 +9,10 @@ Jody:
* Improve support for named expressions.
* Name and Graph gurus support range selection.
* Deadkey support.
* Fix XIRR and friends.
John Gill:
* Double click fill support.
JPR:
* Put more effort into reverse engineering MATCH (and friends)
......
2000-08-07 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c (callback_function_stat) : Handle blanks as 0.
(callback_function_make_list) : Ditto.
(callback_function_ttest) : Ditto.
(gnumeric_mode) : Explicitly ignore blanks.
(gnumeric_count) : Ditto.
(gnumeric_ztest) : Ditto.
(gnumeric_counta) : Ditto.
(gnumeric_percentile) : Ditto.
(gnumeric_quartile) : Ditto.
(gnumeric_prob) : DO NOT IGNORE BLANKS.
(gnumeric_ftest) : Ditto.
(gnumeric_ttest) : Ditto.
(gnumeric_frequency) : Ditto.
* src/functions/fn-logical.c (gnumeric_and) : Handle
changes to function_iterate_argument_values.
(gnumeric_or) : Ditto.
* src/functions/fn-math.c (gnumeric_lcm) : Ditto.
(gnumeric_multinomial) : Ditto.
(gnumeric_seriessum) : Ditto.
* src/functions/fn-financial.c (gnumeric_mirr) : Use the old
behavior of ignoring blanks.
(gnumeric_irr) : Ditto.
(gnumeric_npv) : Ditto.
* src/functions/fn-eng.c (gnumeric_improduct) : Handle
changes to function_iterate_argument_values.
(gnumeric_imsum) : Ditto.
* src/func.c (function_iterate_argument_values) : Add ignore_blank
flag.
* src/collect.c (callback_function_collect) : Support new collect flag
COLLECT_IGNORE_BLANKS.
(collect_floats) : change to function_iterate_argument_values.
(float_range_function2) : Use COLLECT_IGNORE_BLANKS.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
* src/sheet-autofill.c (fill_item_new) : It is legal to have 'D' and 'M'
for day or month fields.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
For : John N S Gill <bmrg@gofree.indigo.ie>
* src/item-cursor.c (item_cursor_autofill_event) : Implement support
for double click on autofill button.
2000-08-02 Michael Meeks <michael@helixcode.com>
* configure.in: update for BonoboX
......
2000-08-07 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c (callback_function_stat) : Handle blanks as 0.
(callback_function_make_list) : Ditto.
(callback_function_ttest) : Ditto.
(gnumeric_mode) : Explicitly ignore blanks.
(gnumeric_count) : Ditto.
(gnumeric_ztest) : Ditto.
(gnumeric_counta) : Ditto.
(gnumeric_percentile) : Ditto.
(gnumeric_quartile) : Ditto.
(gnumeric_prob) : DO NOT IGNORE BLANKS.
(gnumeric_ftest) : Ditto.
(gnumeric_ttest) : Ditto.
(gnumeric_frequency) : Ditto.
* src/functions/fn-logical.c (gnumeric_and) : Handle
changes to function_iterate_argument_values.
(gnumeric_or) : Ditto.
* src/functions/fn-math.c (gnumeric_lcm) : Ditto.
(gnumeric_multinomial) : Ditto.
(gnumeric_seriessum) : Ditto.
* src/functions/fn-financial.c (gnumeric_mirr) : Use the old
behavior of ignoring blanks.
(gnumeric_irr) : Ditto.
(gnumeric_npv) : Ditto.
* src/functions/fn-eng.c (gnumeric_improduct) : Handle
changes to function_iterate_argument_values.
(gnumeric_imsum) : Ditto.
* src/func.c (function_iterate_argument_values) : Add ignore_blank
flag.
* src/collect.c (callback_function_collect) : Support new collect flag
COLLECT_IGNORE_BLANKS.
(collect_floats) : change to function_iterate_argument_values.
(float_range_function2) : Use COLLECT_IGNORE_BLANKS.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
* src/sheet-autofill.c (fill_item_new) : It is legal to have 'D' and 'M'
for day or month fields.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
For : John N S Gill <bmrg@gofree.indigo.ie>
* src/item-cursor.c (item_cursor_autofill_event) : Implement support
for double click on autofill button.
2000-08-02 Michael Meeks <michael@helixcode.com>
* configure.in: update for BonoboX
......
2000-08-07 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c (callback_function_stat) : Handle blanks as 0.
(callback_function_make_list) : Ditto.
(callback_function_ttest) : Ditto.
(gnumeric_mode) : Explicitly ignore blanks.
(gnumeric_count) : Ditto.
(gnumeric_ztest) : Ditto.
(gnumeric_counta) : Ditto.
(gnumeric_percentile) : Ditto.
(gnumeric_quartile) : Ditto.
(gnumeric_prob) : DO NOT IGNORE BLANKS.
(gnumeric_ftest) : Ditto.
(gnumeric_ttest) : Ditto.
(gnumeric_frequency) : Ditto.
* src/functions/fn-logical.c (gnumeric_and) : Handle
changes to function_iterate_argument_values.
(gnumeric_or) : Ditto.
* src/functions/fn-math.c (gnumeric_lcm) : Ditto.
(gnumeric_multinomial) : Ditto.
(gnumeric_seriessum) : Ditto.
* src/functions/fn-financial.c (gnumeric_mirr) : Use the old
behavior of ignoring blanks.
(gnumeric_irr) : Ditto.
(gnumeric_npv) : Ditto.
* src/functions/fn-eng.c (gnumeric_improduct) : Handle
changes to function_iterate_argument_values.
(gnumeric_imsum) : Ditto.
* src/func.c (function_iterate_argument_values) : Add ignore_blank
flag.
* src/collect.c (callback_function_collect) : Support new collect flag
COLLECT_IGNORE_BLANKS.
(collect_floats) : change to function_iterate_argument_values.
(float_range_function2) : Use COLLECT_IGNORE_BLANKS.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
* src/sheet-autofill.c (fill_item_new) : It is legal to have 'D' and 'M'
for day or month fields.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
For : John N S Gill <bmrg@gofree.indigo.ie>
* src/item-cursor.c (item_cursor_autofill_event) : Implement support
for double click on autofill button.
2000-08-02 Michael Meeks <michael@helixcode.com>
* configure.in: update for BonoboX
......
2000-08-07 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c (callback_function_stat) : Handle blanks as 0.
(callback_function_make_list) : Ditto.
(callback_function_ttest) : Ditto.
(gnumeric_mode) : Explicitly ignore blanks.
(gnumeric_count) : Ditto.
(gnumeric_ztest) : Ditto.
(gnumeric_counta) : Ditto.
(gnumeric_percentile) : Ditto.
(gnumeric_quartile) : Ditto.
(gnumeric_prob) : DO NOT IGNORE BLANKS.
(gnumeric_ftest) : Ditto.
(gnumeric_ttest) : Ditto.
(gnumeric_frequency) : Ditto.
* src/functions/fn-logical.c (gnumeric_and) : Handle
changes to function_iterate_argument_values.
(gnumeric_or) : Ditto.
* src/functions/fn-math.c (gnumeric_lcm) : Ditto.
(gnumeric_multinomial) : Ditto.
(gnumeric_seriessum) : Ditto.
* src/functions/fn-financial.c (gnumeric_mirr) : Use the old
behavior of ignoring blanks.
(gnumeric_irr) : Ditto.
(gnumeric_npv) : Ditto.
* src/functions/fn-eng.c (gnumeric_improduct) : Handle
changes to function_iterate_argument_values.
(gnumeric_imsum) : Ditto.
* src/func.c (function_iterate_argument_values) : Add ignore_blank
flag.
* src/collect.c (callback_function_collect) : Support new collect flag
COLLECT_IGNORE_BLANKS.
(collect_floats) : change to function_iterate_argument_values.
(float_range_function2) : Use COLLECT_IGNORE_BLANKS.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
* src/sheet-autofill.c (fill_item_new) : It is legal to have 'D' and 'M'
for day or month fields.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
For : John N S Gill <bmrg@gofree.indigo.ie>
* src/item-cursor.c (item_cursor_autofill_event) : Implement support
for double click on autofill button.
2000-08-02 Michael Meeks <michael@helixcode.com>
* configure.in: update for BonoboX
......
2000-08-07 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c (callback_function_stat) : Handle blanks as 0.
(callback_function_make_list) : Ditto.
(callback_function_ttest) : Ditto.
(gnumeric_mode) : Explicitly ignore blanks.
(gnumeric_count) : Ditto.
(gnumeric_ztest) : Ditto.
(gnumeric_counta) : Ditto.
(gnumeric_percentile) : Ditto.
(gnumeric_quartile) : Ditto.
(gnumeric_prob) : DO NOT IGNORE BLANKS.
(gnumeric_ftest) : Ditto.
(gnumeric_ttest) : Ditto.
(gnumeric_frequency) : Ditto.
* src/functions/fn-logical.c (gnumeric_and) : Handle
changes to function_iterate_argument_values.
(gnumeric_or) : Ditto.
* src/functions/fn-math.c (gnumeric_lcm) : Ditto.
(gnumeric_multinomial) : Ditto.
(gnumeric_seriessum) : Ditto.
* src/functions/fn-financial.c (gnumeric_mirr) : Use the old
behavior of ignoring blanks.
(gnumeric_irr) : Ditto.
(gnumeric_npv) : Ditto.
* src/functions/fn-eng.c (gnumeric_improduct) : Handle
changes to function_iterate_argument_values.
(gnumeric_imsum) : Ditto.
* src/func.c (function_iterate_argument_values) : Add ignore_blank
flag.
* src/collect.c (callback_function_collect) : Support new collect flag
COLLECT_IGNORE_BLANKS.
(collect_floats) : change to function_iterate_argument_values.
(float_range_function2) : Use COLLECT_IGNORE_BLANKS.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
* src/sheet-autofill.c (fill_item_new) : It is legal to have 'D' and 'M'
for day or month fields.
2000-08-01 Jody Goldberg <jgoldberg@home.com>
For : John N S Gill <bmrg@gofree.indigo.ie>
* src/item-cursor.c (item_cursor_autofill_event) : Implement support
for double click on autofill button.
2000-08-02 Michael Meeks <michael@helixcode.com>
* configure.in: update for BonoboX
......
......@@ -1218,7 +1218,7 @@ gnumeric_improduct (FunctionEvalInfo *ei, GList *expr_node_list)
if ((v = function_iterate_argument_values (ei->pos,
&callback_function_imoper,
&p, expr_node_list,
TRUE)) != NULL)
TRUE, TRUE)) != NULL)
return v;
return value_new_complex (&p.res, p.imunit);
......@@ -1252,7 +1252,7 @@ gnumeric_imsum (FunctionEvalInfo *ei, GList *expr_node_list)
if ((v = function_iterate_argument_values (ei->pos,
callback_function_imoper,
&p, expr_node_list,
TRUE)) != NULL)
TRUE, TRUE)) != NULL)
return v;
return value_new_complex (&p.res, p.imunit);
......
......@@ -1366,7 +1366,8 @@ gnumeric_mirr (FunctionEvalInfo *ei, Value **argv)
rrate = value_get_as_float (argv[2]);
values = collect_floats_value (argv[0], ei->pos,
COLLECT_IGNORE_STRINGS,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BLANKS,
&n, &result);
if (result)
goto out;
......@@ -1709,7 +1710,8 @@ gnumeric_irr (FunctionEvalInfo *ei, Value **argv)
rate0 = argv[1] ? value_get_as_float (argv[1]) : 0.1;
p.values = collect_floats_value (argv[0], ei->pos,
COLLECT_IGNORE_STRINGS,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BLANKS,
&n, &result);
if (result != NULL) {
g_free (p.values);
......@@ -1820,7 +1822,7 @@ gnumeric_npv (FunctionEvalInfo *ei, GList *nodes)
p.num = 0;
v = function_iterate_argument_values (ei->pos, callback_function_npv,
&p, nodes, TRUE);
&p, nodes, TRUE, TRUE);
return (v != NULL) ? v : value_new_float (p.sum);
}
......
......@@ -65,7 +65,8 @@ gnumeric_and (FunctionEvalInfo *ei, GList *nodes)
/* Yes, AND is actually strict. */
Value *v = function_iterate_argument_values (ei->pos,
callback_function_and,
&result, nodes, TRUE);
&result, nodes,
TRUE, TRUE);
if (v != NULL)
return v;
......@@ -148,7 +149,8 @@ gnumeric_or (FunctionEvalInfo *ei, GList *nodes)
/* Yes, OR is actually strict. */
Value *v = function_iterate_argument_values (ei->pos,
callback_function_or,
&result, nodes, TRUE);
&result, nodes,
TRUE, TRUE);
if (v != NULL)
return v;
......
......@@ -212,7 +212,8 @@ gnumeric_lcm (FunctionEvalInfo *ei, GList *nodes)
Value *result = value_new_int (1);
if (function_iterate_argument_values (ei->pos, callback_function_lcm,
result, nodes, TRUE) != NULL)
result, nodes,
TRUE, TRUE) != NULL)
return value_new_error (ei->pos, gnumeric_err_NUM);
return result;
......@@ -1583,7 +1584,7 @@ gnumeric_multinomial (FunctionEvalInfo *ei, GList *nodes)
if (function_iterate_argument_values (ei->pos,
callback_function_multinomial,
&p, nodes,
TRUE) != NULL)
TRUE, TRUE) != NULL)
return value_new_error (ei->pos, gnumeric_err_VALUE);
return value_new_float (fact(p.sum) / p.product);
......@@ -2962,7 +2963,7 @@ gnumeric_seriessum (FunctionEvalInfo *ei, GList *nodes)
if (function_iterate_argument_values (ei->pos,
callback_function_seriessum,
&p, nodes,
TRUE) != NULL)
TRUE, TRUE) != NULL)
return value_new_error (ei->pos, gnumeric_err_VALUE);
return value_new_float (p.sum);
......
......@@ -59,7 +59,7 @@ callback_function_stat (const EvalPos *ep, Value *value, void *closure)
stat_closure_t *mm = closure;
float_t x, dx, dm;
if (VALUE_IS_NUMBER (value))
if (value != NULL && VALUE_IS_NUMBER (value))
x = value_get_as_float (value);
else {
if (mm->afun_flag)
......@@ -95,10 +95,10 @@ callback_function_make_list (const EvalPos *ep, Value *value,
float_t x;
gpointer p;
if (VALUE_IS_NUMBER (value))
if (value != NULL && VALUE_IS_NUMBER (value))
x = value_get_as_float (value);
else
x = 0;
x = 0.;
p = g_new (float_t, 1);
*((float_t *) p) = x;
......@@ -721,9 +721,9 @@ gnumeric_mode (FunctionEvalInfo *ei, GList *expr_node_list)
pr.mode = 0.0;
pr.count = 0;
/* FIXME what about blanks ? */
function_iterate_argument_values (ei->pos, callback_function_mode,
&pr, expr_node_list, TRUE);
&pr, expr_node_list,
TRUE, TRUE);
g_hash_table_destroy (pr.hash_table);
tmp = pr.items;
......@@ -841,7 +841,8 @@ gnumeric_count (FunctionEvalInfo *ei, GList *expr_node_list)
result = value_new_int (0);
function_iterate_argument_values (ei->pos, callback_function_count,
result, expr_node_list, FALSE);
result, expr_node_list,
FALSE, TRUE);
return result;
}
......@@ -883,7 +884,8 @@ gnumeric_counta (FunctionEvalInfo *ei, GList *expr_node_list)
result = value_new_int (0);
function_iterate_argument_values (ei->pos, callback_function_counta,
result, expr_node_list, FALSE);
result, expr_node_list,
FALSE, TRUE);
return result;
}
......@@ -2542,7 +2544,7 @@ gnumeric_prob (FunctionEvalInfo *ei, Value **argv)
err = function_iterate_argument_values
(eval_pos_init(&ep, ei->pos->sheet, &ei->pos->eval),
&callback_function_make_list, &x_cl, expr_node_list,
TRUE);
TRUE, FALSE);
if (err != NULL)
return value_new_error (ei->pos, gnumeric_err_NA);
......@@ -2556,7 +2558,7 @@ gnumeric_prob (FunctionEvalInfo *ei, Value **argv)
err = function_iterate_argument_values
(eval_pos_init(&ep, ei->pos->sheet, &ei->pos->eval),
&callback_function_make_list, &prob_cl, expr_node_list,
TRUE);
TRUE, FALSE);
if (err != NULL)
return value_new_error (ei->pos, gnumeric_err_NA);
......@@ -2838,7 +2840,7 @@ gnumeric_ztest (FunctionEvalInfo *ei, GList *expr_node_list)
status = function_iterate_argument_values (ei->pos,
callback_function_ztest,
&p, expr_node_list, TRUE);
&p, expr_node_list, TRUE, TRUE);
if (status != NULL)
return status;
......@@ -3243,7 +3245,8 @@ gnumeric_percentile (FunctionEvalInfo *ei, Value **argv)
data = collect_floats_value (argv[0], ei->pos,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
&n, &result);
if (result)
goto out;
......@@ -3314,7 +3317,8 @@ gnumeric_quartile (FunctionEvalInfo *ei, Value **argv)
data = collect_floats_value (argv[0], ei->pos,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
&n, &result);
if (result) {
/* Nothing. */
......@@ -3381,7 +3385,7 @@ gnumeric_ftest (FunctionEvalInfo *ei, Value *argv[])
err = function_iterate_argument_values
(eval_pos_init_cellref (&ep, ei->pos, &argv[0]->v_range.cell.a),
&callback_function_stat, &cl, expr_node_list, TRUE);
&callback_function_stat, &cl, expr_node_list, TRUE, FALSE);
if (err != NULL)
return value_new_error (ei->pos, gnumeric_err_VALUE);
......@@ -3402,7 +3406,7 @@ gnumeric_ftest (FunctionEvalInfo *ei, Value *argv[])
err = function_iterate_argument_values
(eval_pos_init_cellref (&ep, ei->pos, &argv[1]->v_range.cell.a),
&callback_function_stat, &cl, expr_node_list, TRUE);
&callback_function_stat, &cl, expr_node_list, TRUE, FALSE);
if (err != NULL)
return value_new_error (ei->pos, gnumeric_err_VALUE);
......@@ -3475,7 +3479,7 @@ callback_function_ttest (const EvalPos *ep, Value *value, void *closure)
stat_ttest_t *mm = closure;
float_t x;
if (VALUE_IS_NUMBER (value))
if (value != NULL && VALUE_IS_NUMBER (value))
x = value_get_as_float (value);
else
x = 0;
......@@ -3528,7 +3532,7 @@ gnumeric_ttest (FunctionEvalInfo *ei, Value *argv[])
err = function_iterate_argument_values
(eval_pos_init_cellref (&ep, ei->pos, &argv[0]->v_range.cell.a),
&callback_function_ttest, &t_cl, expr_node_list, TRUE);
&callback_function_ttest, &t_cl, expr_node_list, TRUE, FALSE);
if (err != NULL)
return value_new_error (&ep, gnumeric_err_VALUE);
......@@ -3543,7 +3547,7 @@ gnumeric_ttest (FunctionEvalInfo *ei, Value *argv[])
err = function_iterate_argument_values
(eval_pos_init_cellref (&ep, ei->pos, &argv[1]->v_range.cell.a),
&callback_function_ttest, &t_cl, expr_node_list, TRUE);
&callback_function_ttest, &t_cl, expr_node_list, TRUE, FALSE);
if (err != NULL)
return value_new_error (&ep, gnumeric_err_VALUE);
......@@ -3591,7 +3595,7 @@ gnumeric_ttest (FunctionEvalInfo *ei, Value *argv[])
err = function_iterate_argument_values
(eval_pos_init_cellref (&ep, ei->pos, &argv[0]->v_range.cell.a),
&callback_function_stat, &cl, expr_node_list, TRUE);
&callback_function_stat, &cl, expr_node_list, TRUE, FALSE);
if (err != NULL)
return value_new_error (ei->pos, gnumeric_err_VALUE);
......@@ -3615,7 +3619,7 @@ gnumeric_ttest (FunctionEvalInfo *ei, Value *argv[])
(eval_pos_init_cellref (&ep, ei->pos, &argv[1]->v_range.cell.a),
&callback_function_stat,
&cl, expr_node_list,
TRUE);
TRUE, FALSE);
if (err != NULL)
return value_new_error (ei->pos, gnumeric_err_VALUE);
......@@ -3692,7 +3696,7 @@ gnumeric_frequency (FunctionEvalInfo *ei, Value *argv[])
err = function_iterate_argument_values
(eval_pos_init(&ep, ei->pos->sheet, &ei->pos->eval),
&callback_function_make_list, &data_cl, expr_node_list, TRUE);
&callback_function_make_list, &data_cl, expr_node_list, TRUE, FALSE);
if (err != NULL)
return value_new_error (ei->pos, gnumeric_err_NA);
......@@ -3705,7 +3709,7 @@ gnumeric_frequency (FunctionEvalInfo *ei, Value *argv[])
err = function_iterate_argument_values
(eval_pos_init(&ep, ei->pos->sheet, &ei->pos->eval),
&callback_function_make_list, &bin_cl, expr_node_list, TRUE);
&callback_function_make_list, &bin_cl, expr_node_list, TRUE, FALSE);
if (err != NULL)
return value_new_error (ei->pos, gnumeric_err_NA);
......
......@@ -26,12 +26,16 @@ callback_function_collect (const EvalPos *ep, Value *value, void *closure)
float_t x;
collect_floats_t *cl = (collect_floats_t *)closure;
if (!value)
return NULL;
switch (value->type) {
if (value == NULL) {
if (cl->flags & COLLECT_IGNORE_BLANKS)
return NULL;
x = 0.;
} else switch (value->type) {
case VALUE_EMPTY:
return NULL;
if (cl->flags & COLLECT_IGNORE_BLANKS)
return NULL;
x = 0.;
break;
case VALUE_BOOLEAN:
if (cl->flags & COLLECT_IGNORE_BOOLS)
......@@ -123,7 +127,8 @@ collect_floats (GList *exprlist, const EvalPos *ep, CollectFlags flags,
cl.flags = flags;
err = function_iterate_argument_values (ep, &callback_function_collect,
&cl, exprlist, TRUE);
&cl, exprlist, TRUE,
flags&COLLECT_IGNORE_BLANKS);
if (err) {
g_assert (err->type == VALUE_ERROR);
......@@ -200,13 +205,13 @@ float_range_function2 (Value *val0, Value *val1, FunctionEvalInfo *ei,
Value *res;
vals0 = collect_floats_value (val0, ei->pos,
COLLECT_IGNORE_STRINGS | COLLECT_IGNORE_BOOLS,
COLLECT_IGNORE_STRINGS | COLLECT_IGNORE_BOOLS | COLLECT_IGNORE_BLANKS,
&n0, &error);
if (error)
return error;
vals1 = collect_floats_value (val1, ei->pos,
COLLECT_IGNORE_STRINGS | COLLECT_IGNORE_BOOLS,
COLLECT_IGNORE_STRINGS | COLLECT_IGNORE_BOOLS | COLLECT_IGNORE_BLANKS,
&n1, &error);
if (error) {
g_free (vals0);
......
......@@ -13,7 +13,9 @@ typedef enum {
COLLECT_IGNORE_ERRORS = 0x100,
COLLECT_ZERO_ERRORS = 0x200,
COLLECT_DATES = 0x1000,
COLLECT_IGNORE_BLANKS = 0x1000,
COLLECT_DATES = 0x2000,
} CollectFlags;
......
......@@ -733,15 +733,16 @@ function_iterate_do_value (EvalPos const *ep,
/*
* function_iterate_argument_values
*
* fp: The position in a workbook at which to evaluate
* callback: The routine to be invoked for every value computed
* callback_closure: Closure for the callback.
* expr_node_list: a GList of ExprTrees (what a Gnumeric function would get).
* strict: If TRUE, the function is considered "strict". This means
* @fp: The position in a workbook at which to evaluate