Commit 5ba47b54 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Make code match comment. We can safely ignore blanks. (gnumeric_sumif) :


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

	* src/functions/fn-math.c (gnumeric_countif) :
	    Make code match comment.  We can safely ignore blanks.
	(gnumeric_sumif) : Code was correct.  Add a larger comment explaining
	  rationale.
	(gnumeric_sumx2my2) : Code was wrong.  We can not skip blank cells
	  if there are multiple ranges that need to be kept in sync.
	(gnumeric_sumx2py2) : Ditto.
	(gnumeric_sumxmy2) : Ditto.
parent 3d2ca74e
......@@ -4,14 +4,6 @@ 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.
......@@ -27,8 +19,7 @@ Long term breakage
- Clearing a cell that stopped a span does not regenerate the span.
- changing col/row sizes does not have undo support.
- The implication of mixed mode references ($B$2:C3)
is large. We need to validate references when pasting a
copy to check for inversion.
is large. All accesses to a RangeRef need to be normalized.
- Copy with destination larger than source does not duplicate the styles.
......
2000-05-05 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-math.c (gnumeric_countif) :
Make code match comment. We can safely ignore blanks.
(gnumeric_sumif) : Code was correct. Add a larger comment explaining
rationale.
(gnumeric_sumx2my2) : Code was wrong. We can not skip blank cells
if there are multiple ranges that need to be kept in sync.
(gnumeric_sumx2py2) : Ditto.
(gnumeric_sumxmy2) : Ditto.
2000-05-05 Tuomas Kuosmanen <tigert@tigert.gimp.org>
* src/pixmaps/function_selector.xpm: Made the ()'s a bit higher
......
2000-05-05 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-math.c (gnumeric_countif) :
Make code match comment. We can safely ignore blanks.
(gnumeric_sumif) : Code was correct. Add a larger comment explaining
rationale.
(gnumeric_sumx2my2) : Code was wrong. We can not skip blank cells
if there are multiple ranges that need to be kept in sync.
(gnumeric_sumx2py2) : Ditto.
(gnumeric_sumxmy2) : Ditto.
2000-05-05 Tuomas Kuosmanen <tigert@tigert.gimp.org>
* src/pixmaps/function_selector.xpm: Made the ()'s a bit higher
......
2000-05-05 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-math.c (gnumeric_countif) :
Make code match comment. We can safely ignore blanks.
(gnumeric_sumif) : Code was correct. Add a larger comment explaining
rationale.
(gnumeric_sumx2my2) : Code was wrong. We can not skip blank cells
if there are multiple ranges that need to be kept in sync.
(gnumeric_sumx2py2) : Ditto.
(gnumeric_sumxmy2) : Ditto.
2000-05-05 Tuomas Kuosmanen <tigert@tigert.gimp.org>
* src/pixmaps/function_selector.xpm: Made the ()'s a bit higher
......
2000-05-05 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-math.c (gnumeric_countif) :
Make code match comment. We can safely ignore blanks.
(gnumeric_sumif) : Code was correct. Add a larger comment explaining
rationale.
(gnumeric_sumx2my2) : Code was wrong. We can not skip blank cells
if there are multiple ranges that need to be kept in sync.
(gnumeric_sumx2py2) : Ditto.
(gnumeric_sumxmy2) : Ditto.
2000-05-05 Tuomas Kuosmanen <tigert@tigert.gimp.org>
* src/pixmaps/function_selector.xpm: Made the ()'s a bit higher
......
2000-05-05 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-math.c (gnumeric_countif) :
Make code match comment. We can safely ignore blanks.
(gnumeric_sumif) : Code was correct. Add a larger comment explaining
rationale.
(gnumeric_sumx2my2) : Code was wrong. We can not skip blank cells
if there are multiple ranges that need to be kept in sync.
(gnumeric_sumx2py2) : Ditto.
(gnumeric_sumxmy2) : Ditto.
2000-05-05 Tuomas Kuosmanen <tigert@tigert.gimp.org>
* src/pixmaps/function_selector.xpm: Made the ()'s a bit higher
......
2000-05-05 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-math.c (gnumeric_countif) :
Make code match comment. We can safely ignore blanks.
(gnumeric_sumif) : Code was correct. Add a larger comment explaining
rationale.
(gnumeric_sumx2my2) : Code was wrong. We can not skip blank cells
if there are multiple ranges that need to be kept in sync.
(gnumeric_sumx2py2) : Ditto.
(gnumeric_sumxmy2) : Ditto.
2000-05-05 Tuomas Kuosmanen <tigert@tigert.gimp.org>
* src/pixmaps/function_selector.xpm: Made the ()'s a bit higher
......
2000-05-05 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-math.c (gnumeric_countif) :
Make code match comment. We can safely ignore blanks.
(gnumeric_sumif) : Code was correct. Add a larger comment explaining
rationale.
(gnumeric_sumx2my2) : Code was wrong. We can not skip blank cells
if there are multiple ranges that need to be kept in sync.
(gnumeric_sumx2py2) : Ditto.
(gnumeric_sumxmy2) : Ditto.
2000-05-05 Tuomas Kuosmanen <tigert@tigert.gimp.org>
* src/pixmaps/function_selector.xpm: Made the ()'s a bit higher
......
......@@ -524,11 +524,8 @@ gnumeric_countif (FunctionEvalInfo *ei, Value **argv)
}
sheet = eval_sheet (range->v_range.cell.a.sheet, ei->pos->sheet);
/* FIXME : The comment is wrong. TRUE would ignore empties.
* is the code wrong ?
*/
ret = sheet_cell_foreach_range ( sheet,
FALSE, /* Ignore empty cells */
ret = sheet_cell_foreach_range (sheet,
TRUE, /* Ignore empty cells */
range->v_range.cell.a.col,
range->v_range.cell.a.row,
range->v_range.cell.b.col,
......@@ -661,12 +658,13 @@ gnumeric_sumif (FunctionEvalInfo *ei, Value **argv)
else
items.actual_range = FALSE;
/* FIXME : The comment is wrong. TRUE would ignore empties.
* is the code wrong ?
*/
ret = sheet_cell_foreach_range (
eval_sheet (range->v_range.cell.a.sheet, ei->pos->sheet),
/* Do not ignore empty cells if there is an actual range */
/*
* Do not ignore empty cells if there is a
* target range. We need the orders of the source values to
* line up with the values of the target range.
*/
actual_range == NULL,
range->v_range.cell.a.col,
......@@ -697,11 +695,9 @@ gnumeric_sumif (FunctionEvalInfo *ei, Value **argv)
} else {
items.current = items.list;
items.sum = items.total_num = 0;
/* FIXME : The comment is wrong. TRUE would ignore empties.
* is the code wrong ?
*/
ret = sheet_cell_foreach_range (
eval_sheet (actual_range->v_range.cell.a.sheet, ei->pos->sheet),
eval_sheet (actual_range->v_range.cell.a.sheet,
ei->pos->sheet),
/* Empty cells too. Criteria and results must align */
FALSE,
......@@ -2545,13 +2541,9 @@ gnumeric_sumx2my2 (FunctionEvalInfo *ei, Value **argv)
items_y.num = 0;
items_y.list = NULL;
/*
* FIXME : if either lists has a blank things get out of line
* This seems a rather poor way of doing this.
*/
if (values_x->type == VALUE_CELLRANGE) {
ret = sheet_cell_foreach_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), TRUE,
eval_sheet (ei->pos->sheet, ei->pos->sheet), FALSE,
values_x->v_range.cell.a.col,
values_x->v_range.cell.a.row,
values_x->v_range.cell.b.col,
......@@ -2567,7 +2559,7 @@ gnumeric_sumx2my2 (FunctionEvalInfo *ei, Value **argv)
if (values_y->type == VALUE_CELLRANGE) {
ret = sheet_cell_foreach_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), TRUE,
eval_sheet (ei->pos->sheet, ei->pos->sheet), FALSE,
values_y->v_range.cell.a.col,
values_y->v_range.cell.a.row,
values_y->v_range.cell.b.col,
......@@ -2647,13 +2639,10 @@ gnumeric_sumx2py2 (FunctionEvalInfo *ei, Value **argv)
items_y.num = 0;
items_y.list = NULL;
/*
* FIXME : if either lists has a blank things get out of line
* This seems a rather poor way of doing this.
*/
if (values_x->type == VALUE_CELLRANGE) {
ret = sheet_cell_foreach_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), TRUE,
eval_sheet (ei->pos->sheet, ei->pos->sheet),
FALSE, /* include empties so that the lists align */
values_x->v_range.cell.a.col,
values_x->v_range.cell.a.row,
values_x->v_range.cell.b.col,
......@@ -2668,7 +2657,8 @@ gnumeric_sumx2py2 (FunctionEvalInfo *ei, Value **argv)
if (values_y->type == VALUE_CELLRANGE) {
ret = sheet_cell_foreach_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), TRUE,
eval_sheet (ei->pos->sheet, ei->pos->sheet),
FALSE, /* include empties so that the lists align */
values_y->v_range.cell.a.col,
values_y->v_range.cell.a.row,
values_y->v_range.cell.b.col,
......@@ -2746,13 +2736,10 @@ gnumeric_sumxmy2 (FunctionEvalInfo *ei, Value **argv)
items_y.num = 0;
items_y.list = NULL;
/*
* FIXME : if either lists has a blank things get out of line
* This seems a rather poor way of doing this.
*/
if (values_x->type == VALUE_CELLRANGE) {
ret = sheet_cell_foreach_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), TRUE,
eval_sheet (ei->pos->sheet, ei->pos->sheet),
FALSE, /* include empties so that the lists align */
values_x->v_range.cell.a.col,
values_x->v_range.cell.a.row,
values_x->v_range.cell.b.col,
......@@ -2767,7 +2754,8 @@ gnumeric_sumxmy2 (FunctionEvalInfo *ei, Value **argv)
if (values_y->type == VALUE_CELLRANGE) {
ret = sheet_cell_foreach_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), TRUE,
eval_sheet (ei->pos->sheet, ei->pos->sheet),
FALSE, /* include empties so that the lists align */
values_y->v_range.cell.a.col,
values_y->v_range.cell.a.row,
values_y->v_range.cell.b.col,
......
......@@ -235,6 +235,8 @@ command_redo (CommandContext *context, Workbook *wb)
* with a list of commands.
*
* @cmd_list : The set of commands to free.
*
* NOTE : remember to NULL the list when you are done.
*/
void
command_list_release (GSList *cmd_list)
......
......@@ -524,11 +524,8 @@ gnumeric_countif (FunctionEvalInfo *ei, Value **argv)
}
sheet = eval_sheet (range->v_range.cell.a.sheet, ei->pos->sheet);
/* FIXME : The comment is wrong. TRUE would ignore empties.
* is the code wrong ?
*/
ret = sheet_cell_foreach_range ( sheet,
FALSE, /* Ignore empty cells */
ret = sheet_cell_foreach_range (sheet,
TRUE, /* Ignore empty cells */
range->v_range.cell.a.col,
range->v_range.cell.a.row,
range->v_range.cell.b.col,
......@@ -661,12 +658,13 @@ gnumeric_sumif (FunctionEvalInfo *ei, Value **argv)
else
items.actual_range = FALSE;
/* FIXME : The comment is wrong. TRUE would ignore empties.
* is the code wrong ?
*/
ret = sheet_cell_foreach_range (
eval_sheet (range->v_range.cell.a.sheet, ei->pos->sheet),
/* Do not ignore empty cells if there is an actual range */
/*
* Do not ignore empty cells if there is a
* target range. We need the orders of the source values to
* line up with the values of the target range.
*/
actual_range == NULL,
range->v_range.cell.a.col,
......@@ -697,11 +695,9 @@ gnumeric_sumif (FunctionEvalInfo *ei, Value **argv)
} else {
items.current = items.list;
items.sum = items.total_num = 0;
/* FIXME : The comment is wrong. TRUE would ignore empties.
* is the code wrong ?
*/
ret = sheet_cell_foreach_range (
eval_sheet (actual_range->v_range.cell.a.sheet, ei->pos->sheet),
eval_sheet (actual_range->v_range.cell.a.sheet,
ei->pos->sheet),
/* Empty cells too. Criteria and results must align */
FALSE,
......@@ -2545,13 +2541,9 @@ gnumeric_sumx2my2 (FunctionEvalInfo *ei, Value **argv)
items_y.num = 0;
items_y.list = NULL;
/*
* FIXME : if either lists has a blank things get out of line
* This seems a rather poor way of doing this.
*/
if (values_x->type == VALUE_CELLRANGE) {
ret = sheet_cell_foreach_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), TRUE,
eval_sheet (ei->pos->sheet, ei->pos->sheet), FALSE,
values_x->v_range.cell.a.col,
values_x->v_range.cell.a.row,
values_x->v_range.cell.b.col,
......@@ -2567,7 +2559,7 @@ gnumeric_sumx2my2 (FunctionEvalInfo *ei, Value **argv)
if (values_y->type == VALUE_CELLRANGE) {
ret = sheet_cell_foreach_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), TRUE,
eval_sheet (ei->pos->sheet, ei->pos->sheet), FALSE,
values_y->v_range.cell.a.col,
values_y->v_range.cell.a.row,
values_y->v_range.cell.b.col,
......@@ -2647,13 +2639,10 @@ gnumeric_sumx2py2 (FunctionEvalInfo *ei, Value **argv)
items_y.num = 0;
items_y.list = NULL;
/*
* FIXME : if either lists has a blank things get out of line
* This seems a rather poor way of doing this.
*/
if (values_x->type == VALUE_CELLRANGE) {
ret = sheet_cell_foreach_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), TRUE,
eval_sheet (ei->pos->sheet, ei->pos->sheet),
FALSE, /* include empties so that the lists align */
values_x->v_range.cell.a.col,
values_x->v_range.cell.a.row,
values_x->v_range.cell.b.col,
......@@ -2668,7 +2657,8 @@ gnumeric_sumx2py2 (FunctionEvalInfo *ei, Value **argv)
if (values_y->type == VALUE_CELLRANGE) {
ret = sheet_cell_foreach_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), TRUE,
eval_sheet (ei->pos->sheet, ei->pos->sheet),
FALSE, /* include empties so that the lists align */
values_y->v_range.cell.a.col,
values_y->v_range.cell.a.row,
values_y->v_range.cell.b.col,
......@@ -2746,13 +2736,10 @@ gnumeric_sumxmy2 (FunctionEvalInfo *ei, Value **argv)
items_y.num = 0;
items_y.list = NULL;
/*
* FIXME : if either lists has a blank things get out of line
* This seems a rather poor way of doing this.
*/
if (values_x->type == VALUE_CELLRANGE) {
ret = sheet_cell_foreach_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), TRUE,
eval_sheet (ei->pos->sheet, ei->pos->sheet),
FALSE, /* include empties so that the lists align */
values_x->v_range.cell.a.col,
values_x->v_range.cell.a.row,
values_x->v_range.cell.b.col,
......@@ -2767,7 +2754,8 @@ gnumeric_sumxmy2 (FunctionEvalInfo *ei, Value **argv)
if (values_y->type == VALUE_CELLRANGE) {
ret = sheet_cell_foreach_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), TRUE,
eval_sheet (ei->pos->sheet, ei->pos->sheet),
FALSE, /* include empties so that the lists align */
values_y->v_range.cell.a.col,
values_y->v_range.cell.a.row,
values_y->v_range.cell.b.col,
......
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