Commit 7627f07e authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

fix 3d handling, and convert.


2002-07-13  Jody Goldberg <jody@gnome.org>

	* src/workbook.c (workbook_foreach_cell_in_range) : fix 3d handling,
	  and convert.

	* src/sheet.c (sheet_foreach_cell_in_range) : convert from boolean to
	  bit flags and support only_visible in addition to only existing.
	(sheet_col_size_fit_pixels) : Only fit visible cells.
	(sheet_row_size_fit_pixels) : ditto.

2002-07-12  Jody Goldberg <jody@gnome.org>

	* src/sheet.c (cb_max_cell_width) : leave merged cells out of the
	  running.

	http://bugzilla.gnome.org/show_bug.cgi?id=87987
	(sheet_range_bounding_box) : nice catch, thankfully it is a new bug.
parent bcf8d25b
2002-07-13 Jody Goldberg <jody@gnome.org>
* src/workbook.c (workbook_foreach_cell_in_range) : fix 3d handling,
and convert.
* src/sheet.c (sheet_foreach_cell_in_range) : convert from boolean to
bit flags and support only_visible in addition to only existing.
(sheet_col_size_fit_pixels) : Only fit visible cells.
(sheet_row_size_fit_pixels) : ditto.
2002-07-12 Jody Goldberg <jody@gnome.org>
* src/sheet.c (cb_max_cell_width) : leave merged cells out of the
......
2002-07-13 Jody Goldberg <jody@gnome.org>
* src/workbook.c (workbook_foreach_cell_in_range) : fix 3d handling,
and convert.
* src/sheet.c (sheet_foreach_cell_in_range) : convert from boolean to
bit flags and support only_visible in addition to only existing.
(sheet_col_size_fit_pixels) : Only fit visible cells.
(sheet_row_size_fit_pixels) : ditto.
2002-07-12 Jody Goldberg <jody@gnome.org>
* src/sheet.c (cb_max_cell_width) : leave merged cells out of the
......
2002-07-13 Jody Goldberg <jody@gnome.org>
* src/workbook.c (workbook_foreach_cell_in_range) : fix 3d handling,
and convert.
* src/sheet.c (sheet_foreach_cell_in_range) : convert from boolean to
bit flags and support only_visible in addition to only existing.
(sheet_col_size_fit_pixels) : Only fit visible cells.
(sheet_row_size_fit_pixels) : ditto.
2002-07-12 Jody Goldberg <jody@gnome.org>
* src/sheet.c (cb_max_cell_width) : leave merged cells out of the
......
......@@ -1169,9 +1169,8 @@ gnumeric_improduct (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
complex_real (&p.res, 1);
if ((v = function_iterate_argument_values (ei->pos,
&callback_function_imoper,
&p, expr_node_list,
TRUE, TRUE)) != NULL)
&callback_function_imoper, &p, expr_node_list,
TRUE, CELL_ITER_IGNORE_BLANK)) != NULL)
return v;
return value_new_complex (&p.res, p.imunit);
......@@ -1203,9 +1202,8 @@ gnumeric_imsum (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
complex_real (&p.res, 0);
if ((v = function_iterate_argument_values (ei->pos,
callback_function_imoper,
&p, expr_node_list,
TRUE, TRUE)) != NULL)
callback_function_imoper, &p, expr_node_list,
TRUE, CELL_ITER_IGNORE_BLANK)) != NULL)
return v;
return value_new_complex (&p.res, p.imunit);
......
2002-07-13 Jody Goldberg <jody@gnome.org>
* functions.c (gnumeric_isoyear) : silence some warnings.
2002-07-07 Jon K Hellan <hellan@acm.org>
* plugin.xml.in: Added function ISOYEAR.
......@@ -7,7 +11,7 @@
gnumeric_days360, gnumeric_eomonth, gnumeric_workday,
get_serial_weekday, networkdays_holiday_callback,
gnumeric_networkdays): Replaced deprecated g_date_xxx with
g_data_get_xxx.
g_date_get_xxx.
(gnumeric_isoweeknum): Cross reference ISOYEAR in docs.
(gnumeric_isoyear): New function implementing new spreadsheet
funtion ISOYEAR: The year an ISO 8601 week number refers to.
......
......@@ -1223,7 +1223,6 @@ gnumeric_isoyear (FunctionEvalInfo *ei, Value **argv)
{
Value *res;
GDate *date;
int isoyear;
int year;
int month;
int isoweeknum;
......
2002-07-13 Jody Goldberg <jody@gnome.org>
* functions.c (gnumeric_price) : silence some warnings.
2002-07-07 Jody Goldberg <jody@gnome.org>
* sc-fin.c (GetDiffParam) : avoid compiler warnings.
......
......@@ -1746,7 +1746,7 @@ gnumeric_npv (FunctionEvalInfo *ei, GnmExprList *nodes)
p.num = 0;
v = function_iterate_argument_values (ei->pos, callback_function_npv,
&p, nodes, TRUE, TRUE);
&p, nodes, TRUE, CELL_ITER_IGNORE_BLANK);
return (v != NULL) ? v : value_new_float (p.sum);
}
......@@ -2406,10 +2406,10 @@ gnumeric_price (FunctionEvalInfo *ei, Value **argv)
{
GDate *settlement;
GDate *maturity;
gnum_float a, d, e, n;
gnum_float first_term, last_term, den, base, exponent, sum;
/* gnum_float a, d, e, n; */
/* gnum_float first_term, last_term, den, base, exponent, sum; */
gnum_float rate, yield, redemption;
gint freq, basis, k;
gint freq, basis;
Value *result;
settlement = datetime_value_to_g (argv[0]);
......
......@@ -206,7 +206,7 @@ static gnum_float
Duration (GDate *nSettle, GDate *nMat, gnum_float fCoup, gnum_float fYield,
gint nFreq, gint nBase, gnum_float fNumOfCoups)
{
gnum_float fYearfrac = GetYearFrac ( nSettle, nMat, nBase );
/* gnum_float fYearfrac = GetYearFrac ( nSettle, nMat, nBase ); */
gnum_float fDur = 0.0;
gnum_float t, p = 0.0;
......
......@@ -1415,7 +1415,7 @@ gnumeric_countblank (FunctionEvalInfo *ei, Value **args)
value_area_get_height (ei->pos, args[0]) *
value_area_get_width (ei->pos, args[0]);
workbook_foreach_cell_in_range (ei->pos, args[0], TRUE,
workbook_foreach_cell_in_range (ei->pos, args[0], CELL_ITER_IGNORE_BLANK,
&cb_countblank, &count);
return value_new_int (count);
......
......@@ -89,9 +89,8 @@ gnumeric_and (FunctionEvalInfo *ei, GnmExprList *nodes)
/* Yes, AND is actually strict. */
Value *v = function_iterate_argument_values (ei->pos,
callback_function_and,
&result, nodes,
TRUE, TRUE);
callback_function_and, &result, nodes,
TRUE, CELL_ITER_IGNORE_BLANK);
if (v != NULL)
return v;
......@@ -173,9 +172,8 @@ gnumeric_or (FunctionEvalInfo *ei, GnmExprList *nodes)
/* Yes, OR is actually strict. */
Value *v = function_iterate_argument_values (ei->pos,
callback_function_or,
&result, nodes,
TRUE, TRUE);
callback_function_or, &result, nodes,
TRUE, CELL_ITER_IGNORE_BLANK);
if (v != NULL)
return v;
......@@ -226,10 +224,10 @@ gnumeric_xor (FunctionEvalInfo *ei, GnmExprList *nodes)
{
int result = -1;
/* Yes, XOR is actually strict. */
Value *v = function_iterate_argument_values (ei->pos,
callback_function_xor,
&result, nodes,
TRUE, TRUE);
callback_function_xor, &result, nodes,
TRUE, CELL_ITER_IGNORE_BLANK);
if (v != NULL)
return v;
......
......@@ -548,7 +548,7 @@ gnumeric_countif (FunctionEvalInfo *ei, Value **argv)
sheet = eval_sheet (range->v_range.cell.a.sheet, ei->pos->sheet);
ret = sheet_foreach_cell_in_range (sheet,
TRUE, /* Ignore empty cells */
CELL_ITER_IGNORE_BLANK,
range->v_range.cell.a.col,
range->v_range.cell.a.row,
range->v_range.cell.b.col,
......@@ -676,7 +676,7 @@ gnumeric_sumif (FunctionEvalInfo *ei, Value **argv)
* target range. We need the orders of the source values to
* line up with the values of the target range.
*/
actual_range == NULL,
(actual_range == NULL) ? CELL_ITER_IGNORE_BLANK : CELL_ITER_ALL,
range->v_range.cell.a.col,
range->v_range.cell.a.row,
......@@ -707,10 +707,9 @@ gnumeric_sumif (FunctionEvalInfo *ei, Value **argv)
items.current = items.list;
items.sum = items.total_num = 0;
ret = sheet_foreach_cell_in_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,
CELL_ITER_ALL,
actual_range->v_range.cell.a.col,
actual_range->v_range.cell.a.row,
......@@ -2226,7 +2225,8 @@ gnumeric_sumx2my2 (FunctionEvalInfo *ei, Value **argv)
if (values_x->type == VALUE_CELLRANGE) {
ret = sheet_foreach_cell_in_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), FALSE,
eval_sheet (ei->pos->sheet, ei->pos->sheet),
CELL_ITER_ALL,
values_x->v_range.cell.a.col,
values_x->v_range.cell.a.row,
values_x->v_range.cell.b.col,
......@@ -2246,7 +2246,8 @@ gnumeric_sumx2my2 (FunctionEvalInfo *ei, Value **argv)
if (values_y->type == VALUE_CELLRANGE) {
ret = sheet_foreach_cell_in_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet), FALSE,
eval_sheet (ei->pos->sheet, ei->pos->sheet),
CELL_ITER_ALL,
values_y->v_range.cell.a.col,
values_y->v_range.cell.a.row,
values_y->v_range.cell.b.col,
......@@ -2340,7 +2341,7 @@ gnumeric_sumx2py2 (FunctionEvalInfo *ei, Value **argv)
if (values_x->type == VALUE_CELLRANGE) {
ret = sheet_foreach_cell_in_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet),
FALSE, /* include empties so that the lists align */
CELL_ITER_ALL, /* 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,
......@@ -2360,7 +2361,7 @@ gnumeric_sumx2py2 (FunctionEvalInfo *ei, Value **argv)
if (values_y->type == VALUE_CELLRANGE) {
ret = sheet_foreach_cell_in_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet),
FALSE, /* include empties so that the lists align */
CELL_ITER_ALL, /* 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,
......@@ -2452,7 +2453,7 @@ gnumeric_sumxmy2 (FunctionEvalInfo *ei, Value **argv)
if (values_x->type == VALUE_CELLRANGE) {
ret = sheet_foreach_cell_in_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet),
FALSE, /* include empties so that the lists align */
CELL_ITER_ALL, /* 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,
......@@ -2472,7 +2473,7 @@ gnumeric_sumxmy2 (FunctionEvalInfo *ei, Value **argv)
if (values_y->type == VALUE_CELLRANGE) {
ret = sheet_foreach_cell_in_range (
eval_sheet (ei->pos->sheet, ei->pos->sheet),
FALSE, /* include empties so that the lists align */
CELL_ITER_ALL, /* 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,
......@@ -2635,9 +2636,8 @@ gnumeric_seriessum (FunctionEvalInfo *ei, GnmExprList *nodes)
p.sum = 0;
if (function_iterate_argument_values (ei->pos,
callback_function_seriessum,
&p, nodes,
TRUE, TRUE) != NULL)
callback_function_seriessum,
&p, nodes, TRUE, CELL_ITER_IGNORE_BLANK) != NULL)
return value_new_error (ei->pos, gnumeric_err_VALUE);
return value_new_float (p.sum);
......@@ -2699,7 +2699,8 @@ validate_range_numeric_matrix (const EvalPos *ep, Value * matrix,
}
res = sheet_foreach_cell_in_range (
eval_sheet (matrix->v_range.cell.a.sheet, ep->sheet), TRUE,
eval_sheet (matrix->v_range.cell.a.sheet, ep->sheet),
CELL_ITER_IGNORE_BLANK,
matrix->v_range.cell.a.col,
matrix->v_range.cell.a.row,
matrix->v_range.cell.b.col,
......
......@@ -124,7 +124,7 @@ stat_helper (stat_closure_t *cl, EvalPos const *ep, Value *val)
expr_node_list = gnm_expr_list_append (NULL, &expr);
err = function_iterate_argument_values (ep,
&callback_function_stat, cl, expr_node_list,
TRUE, FALSE);
TRUE, CELL_ITER_ALL);
gnm_expr_list_free (expr_node_list);
if (err != NULL)
......@@ -179,7 +179,7 @@ make_list (make_list_t *p, EvalPos const *ep, Value *val)
expr_node_list = gnm_expr_list_append (NULL, &expr);
err = function_iterate_argument_values (ep,
&callback_function_make_list, p, expr_node_list,
TRUE, FALSE);
TRUE, CELL_ITER_ALL);
gnm_expr_list_free (expr_node_list);
return err;
}
......@@ -387,8 +387,8 @@ gnumeric_rank (FunctionEvalInfo *ei, Value **argv)
p.order = 0;
p.rank = 1;
ret = sheet_foreach_cell_in_range (
eval_sheet (argv[1]->v_range.cell.a.sheet,
ei->pos->sheet), TRUE,
eval_sheet (argv[1]->v_range.cell.a.sheet, ei->pos->sheet),
CELL_ITER_IGNORE_BLANK,
argv[1]->v_range.cell.a.col,
argv[1]->v_range.cell.a.row,
argv[1]->v_range.cell.b.col,
......@@ -868,7 +868,7 @@ gnumeric_count (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
/* no need to check for error, this is not strict */
function_iterate_argument_values (ei->pos,
callback_function_count, result, expr_node_list,
FALSE, TRUE);
FALSE, CELL_ITER_IGNORE_BLANK);
return result;
}
......@@ -910,7 +910,7 @@ gnumeric_counta (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
/* no need to check for error, this is not strict */
function_iterate_argument_values (ei->pos,
callback_function_counta, result, expr_node_list,
FALSE, TRUE);
FALSE, CELL_ITER_IGNORE_BLANK);
return result;
}
......@@ -1444,7 +1444,7 @@ gnumeric_chitest (FunctionEvalInfo *ei, Value **argv)
ret = function_iterate_do_value (ei->pos,
(FunctionIterateCB) callback_function_chitest_actual,
&p1, argv[0], TRUE, TRUE);
&p1, argv[0], TRUE, CELL_ITER_IGNORE_BLANK);
if (ret != NULL)
return value_new_error (ei->pos, gnumeric_err_NUM);
......@@ -1453,7 +1453,7 @@ gnumeric_chitest (FunctionEvalInfo *ei, Value **argv)
p2.next_col = p1.columns->next;
ret = function_iterate_do_value (ei->pos,
(FunctionIterateCB) callback_function_chitest_theoretical,
&p2, argv[1], TRUE, TRUE);
&p2, argv[1], TRUE, CELL_ITER_IGNORE_BLANK);
if (ret != NULL)
return value_new_error (ei->pos, gnumeric_err_NUM);
......@@ -2615,8 +2615,8 @@ gnumeric_steyx (FunctionEvalInfo *ei, Value **argv)
if (known_x->type == VALUE_CELLRANGE) {
ret = sheet_foreach_cell_in_range (
eval_sheet (known_x->v_range.cell.a.sheet,
ei->pos->sheet), TRUE,
eval_sheet (known_x->v_range.cell.a.sheet, ei->pos->sheet),
CELL_ITER_IGNORE_BLANK,
known_x->v_range.cell.a.col,
known_x->v_range.cell.a.row,
known_x->v_range.cell.b.col,
......@@ -2645,8 +2645,8 @@ gnumeric_steyx (FunctionEvalInfo *ei, Value **argv)
if (known_y->type == VALUE_CELLRANGE) {
ret = sheet_foreach_cell_in_range (
eval_sheet (known_y->v_range.cell.a.sheet,
ei->pos->sheet),TRUE,
eval_sheet (known_y->v_range.cell.a.sheet, ei->pos->sheet),
CELL_ITER_IGNORE_BLANK,
known_y->v_range.cell.a.col,
known_y->v_range.cell.a.row,
known_y->v_range.cell.b.col,
......@@ -2792,7 +2792,7 @@ gnumeric_ztest (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
status = function_iterate_argument_values (ei->pos,
callback_function_ztest, &p, expr_node_list,
TRUE, TRUE);
TRUE, CELL_ITER_IGNORE_BLANK);
if (status != NULL)
return status;
......@@ -3146,7 +3146,7 @@ gnumeric_percentrank (FunctionEvalInfo *ei, Value **argv)
ret = function_iterate_do_value (ei->pos, (FunctionIterateCB)
callback_function_percentrank,
&p, argv[0],
TRUE, TRUE);
TRUE, CELL_ITER_IGNORE_BLANK);
if (ret != NULL || (p.smaller + p.equal == 0) ||
(p.greater + p.equal == 0))
......@@ -3420,7 +3420,7 @@ gnumeric_ttest (FunctionEvalInfo *ei, Value *argv[])
expr_node_list = gnm_expr_list_append (NULL, &expr);
err = function_iterate_argument_values (ei->pos,
&callback_function_ttest, &t_cl, expr_node_list,
TRUE, FALSE);
TRUE, CELL_ITER_ALL);
gnm_expr_list_free (expr_node_list);
if (err != NULL)
return err;
......@@ -3432,7 +3432,7 @@ gnumeric_ttest (FunctionEvalInfo *ei, Value *argv[])
expr_node_list = gnm_expr_list_append (NULL, &expr);
err = function_iterate_argument_values (ei->pos,
&callback_function_ttest, &t_cl, expr_node_list,
TRUE, FALSE);
TRUE, CELL_ITER_ALL);
gnm_expr_list_free (expr_node_list);
if (err != NULL)
return err;
......
......@@ -217,9 +217,9 @@ do_af_suggest (GnmExpr const *expr, const EvalPos *epos, StyleFormat **explicit)
closure.typ = AF_UNKNOWN;
closure.explicit = explicit;
workbook_foreach_cell_in_range (epos, v, TRUE,
&cb_af_suggest,
&closure);
workbook_foreach_cell_in_range (epos, v,
CELL_ITER_IGNORE_BLANK,
&cb_af_suggest, &closure);
return closure.typ;
}
......
......@@ -156,7 +156,7 @@ collect_floats (GnmExprList *exprlist, EvalPos const *ep, CollectFlags flags,
err = function_iterate_argument_values (ep, &callback_function_collect,
&cl, exprlist,
TRUE, flags&COLLECT_IGNORE_BLANKS);
TRUE, (flags & COLLECT_IGNORE_BLANKS) ? CELL_ITER_IGNORE_BLANK : CELL_ITER_ALL);
if (err) {
g_assert (err->type == VALUE_ERROR);
......@@ -486,7 +486,7 @@ collect_strings (GnmExprList *exprlist, EvalPos const *ep, CollectFlags flags, V
err = function_iterate_argument_values (ep, &callback_function_collect_strings,
&cl, exprlist,
TRUE, flags & COLLECT_IGNORE_BLANKS);
TRUE, (flags & COLLECT_IGNORE_BLANKS) ? CELL_ITER_IGNORE_BLANK : CELL_ITER_ALL);
if (err) {
g_assert (err->type == VALUE_ERROR);
......
......@@ -839,7 +839,7 @@ cb_dialog_solve_clicked (GtkWidget *button, SolverState *state)
result = workbook_foreach_cell_in_range (
eval_pos_init_sheet (&pos, state->sheet),
input_range, FALSE, grab_cells, &input_cells);
input_range, CELL_ITER_ALL, grab_cells, &input_cells);
param->input_cells = input_cells;
......
......@@ -967,8 +967,9 @@ expr_eval_real (GnmExpr const *expr, EvalPos const *pos,
if (res->type != VALUE_CELLRANGE)
return value_duplicate (res);
if (flags & GNM_EXPR_EVAL_PERMIT_NON_SCALAR) {
workbook_foreach_cell_in_range (pos, res, TRUE,
cb_range_eval, NULL);
workbook_foreach_cell_in_range (pos, res,
CELL_ITER_IGNORE_BLANK,
cb_range_eval, NULL);
return value_duplicate (res);
} else {
/*
......
......@@ -1000,7 +1000,7 @@ typedef struct {
*/
static Value *
cb_iterate_cellrange (Sheet *sheet, int col, int row,
Cell *cell, void *user_data)
Cell *cell, gpointer user_data)
{
IterateCallbackClosure *data = user_data;
Value *res;
......@@ -1033,10 +1033,10 @@ cb_iterate_cellrange (Sheet *sheet, int col, int row,
Value *
function_iterate_do_value (EvalPos const *ep,
FunctionIterateCB callback,
void *closure,
gpointer closure,
Value *value,
gboolean strict,
gboolean ignore_blank)
CellIterFlags iter_flags)
{
Value *res = NULL;
......@@ -1056,8 +1056,7 @@ function_iterate_do_value (EvalPos const *ep,
res = (*callback)(ep, value, closure);
break;
case VALUE_ARRAY:
{
case VALUE_ARRAY: {
int x, y;
/* Note the order here. */
......@@ -1066,7 +1065,7 @@ function_iterate_do_value (EvalPos const *ep,
res = function_iterate_do_value (
ep, callback, closure,
value->v_array.vals [x][y],
strict, TRUE);
strict, CELL_ITER_IGNORE_BLANK);
if (res != NULL)
return res;
}
......@@ -1080,7 +1079,7 @@ function_iterate_do_value (EvalPos const *ep,
data.closure = closure;
data.strict = strict;
res = workbook_foreach_cell_in_range (ep, value, ignore_blank,
res = workbook_foreach_cell_in_range (ep, value, iter_flags,
cb_iterate_cellrange,
&data);
}
......@@ -1100,7 +1099,7 @@ function_iterate_do_value (EvalPos const *ep,
* will stop and that error will be returned. If FALSE, an
* error will be passed on to the callback (as a Value *
* of type VALUE_ERROR).
* @ignore_blank: If TRUE blanks will not be passed to the callback.
* @iter_flags:
*
* Return value:
* NULL : if no errors were reported.
......@@ -1118,7 +1117,7 @@ function_iterate_argument_values (EvalPos const *ep,
void *callback_closure,
GnmExprList *expr_node_list,
gboolean strict,
gboolean ignore_blank)
CellIterFlags iter_flags)
{
Value * result = NULL;
......@@ -1141,7 +1140,7 @@ function_iterate_argument_values (EvalPos const *ep,
}
result = function_iterate_do_value (ep, callback, callback_closure,
val, strict, ignore_blank);
val, strict, iter_flags);
value_release (val);
}
return result;
......
......@@ -176,15 +176,15 @@ typedef Value * (*FunctionIterateCB) (EvalPos const *ep,
Value *function_iterate_argument_values (EvalPos const *ep,
FunctionIterateCB cb,
gpointer user_data,
GnmExprList *expr_node_list,
GnmExprList *expr_node_list,
gboolean strict,
gboolean ignore_blank);
CellIterFlags iter_flags);
Value *function_iterate_do_value (EvalPos const *ep,
FunctionIterateCB cb,
gpointer user_data,
Value *value,
gboolean strict,
gboolean ignore_blank);
FunctionIterateCB cb,
gpointer user_data,
Value *value,
gboolean strict,
CellIterFlags iter_flags);
/******************************************************************************/
......
......@@ -119,8 +119,13 @@ struct _GlobalRange {
Range range;
};
typedef Value * (*ForeachCellCB)(Sheet *sheet, int col, int row,
Cell *cell, void *user_data);
typedef enum {
CELL_ITER_ALL = 0,
CELL_ITER_IGNORE_BLANK = 1 << 0,
CELL_ITER_IGNORE_HIDDEN = 1 << 1
} CellIterFlags;
typedef Value *(*CellIterFunc) (Sheet *sheet, int col, int row,
Cell *cell, gpointer user_data);
typedef enum _SpanCalcFlags {
SPANCALC_SIMPLE = 0x0, /* Just calc spans */
......
......@@ -778,9 +778,10 @@ item_cursor_selection_event (GnomeCanvasItem *item, GdkEvent *event)
/* Make sure we don't overwrite the contents of the fill target */
for (x = ic->pos.end.col + 1; x <= final_col; x++) {
tmp = sheet_foreach_cell_in_range (
sheet, TRUE, x, ic->pos.start.row, x,
ic->pos.end.row, (ForeachCellCB) cb_autofill_bound,
tmp = sheet_foreach_cell_in_range (sheet,
CELL_ITER_IGNORE_BLANK,
x, ic->pos.start.row, x, ic->pos.end.row,
(CellIterFunc) cb_autofill_bound,
GINT_TO_POINTER (TRUE));
if (tmp) {
......@@ -822,9 +823,11 @@ item_cursor_selection_event (GnomeCanvasItem *item, GdkEvent *event)
* NOTE : We assume the traversal order is 'do all cols in a row and
* move on to the next row' here!
*/
tmp = sheet_foreach_cell_in_range (
sheet, TRUE, ic->pos.start.col, ic->pos.end.row + 1,
ic->pos.end.col, final_row, (ForeachCellCB) cb_autofill_bound,
tmp = sheet_foreach_cell_in_range (sheet,
CELL_ITER_IGNORE_BLANK,
ic->pos.start.col, ic->pos.end.row + 1,
ic->pos.end.col, final_row,
(CellIterFunc) cb_autofill_bound,
GINT_TO_POINTER (FALSE));
if (tmp) {
......
......@@ -1144,14 +1144,14 @@ global_range_list_parse (Sheet *sheet, char const *str)
Value *
global_range_list_foreach (GSList *gr_list, EvalPos const *ep,
gboolean only_existing,
ForeachCellCB handler,
CellIterFlags flags,
CellIterFunc handler,
gpointer closure)
{
Value *v;
for (; gr_list != NULL; gr_list = gr_list->next) {
v = workbook_foreach_cell_in_range (ep, gr_list->data,
only_existing, handler, closure);
flags, handler, closure);
if (v != NULL)
return v;
}
......
......@@ -108,8 +108,8 @@ char *global_range_name (Sheet *sheet, Range const *r);