Commit 207bb4a7 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

only redraw if something recalced. (dependent_eval) : return flag if

2001-09-19  Jody Goldberg <jgoldberg@home.com>

	* src/eval.c (workbook_recalc) : only redraw if something recalced.
	(dependent_eval) : return flag if something recalced.
parent 23b2729d
2001-09-19 Jody Goldberg <jgoldberg@home.com>
* src/eval.c (workbook_recalc) : only redraw if something recalced.
(dependent_eval) : return flag if something recalced.
2001-09-19 Jody Goldberg <jgoldberg@home.com>
* src/cell-draw.c (cell_draw) : off by 1.
......
2001-09-19 Jody Goldberg <jgoldberg@home.com>
* src/eval.c (workbook_recalc) : only redraw if something recalced.
(dependent_eval) : return flag if something recalced.
2001-09-19 Jody Goldberg <jgoldberg@home.com>
* src/cell-draw.c (cell_draw) : off by 1.
......
2001-09-19 Jody Goldberg <jgoldberg@home.com>
* src/eval.c (workbook_recalc) : only redraw if something recalced.
(dependent_eval) : return flag if something recalced.
2001-09-19 Jody Goldberg <jgoldberg@home.com>
* src/cell-draw.c (cell_draw) : off by 1.
......
2001-09-19 Jody Goldberg <jgoldberg@home.com>
* src/eval.c (workbook_recalc) : only redraw if something recalced.
(dependent_eval) : return flag if something recalced.
2001-09-19 Jody Goldberg <jgoldberg@home.com>
* src/cell-draw.c (cell_draw) : off by 1.
......
......@@ -1066,9 +1066,8 @@ workbook_queue_all_recalc (Workbook *wb)
/**
* dependent_eval :
* @dep :
*
*/
void
gboolean
dependent_eval (Dependent *dep)
{
if (dep->flags & DEPENDENT_NEEDS_RECALC) {
......@@ -1077,18 +1076,20 @@ dependent_eval (Dependent *dep)
if (t != DEPENDENT_CELL) {
DependentClass *klass = g_ptr_array_index (dep_classes, t);
g_return_if_fail (klass);
g_return_val_if_fail (klass, FALSE);
(*klass->eval) (dep);
} else {
gboolean finished = cell_eval_content (DEP_TO_CELL (dep));
/* This should always be the top of the stack */
g_return_if_fail (finished);
g_return_val_if_fail (finished, FALSE);
}
/* Don't clear flag until after in case we iterate */
dep->flags &= ~DEPENDENT_NEEDS_RECALC;
return TRUE;
}
return FALSE;
}
/**
......@@ -1103,10 +1104,14 @@ dependent_eval (Dependent *dep)
void
workbook_recalc (Workbook *wb)
{
gboolean redraw = FALSE;
g_return_if_fail (IS_WORKBOOK (wb));
WORKBOOK_FOREACH_DEPENDENT (wb, dep, dependent_eval (dep););
WORKBOOK_FOREACH_SHEET (wb, sheet, sheet_redraw_all (sheet, FALSE););
WORKBOOK_FOREACH_DEPENDENT (wb, dep, redraw |= dependent_eval (dep););
if (redraw) {
WORKBOOK_FOREACH_SHEET (wb, sheet, sheet_redraw_all (sheet, FALSE););
}
}
/**
......
......@@ -56,13 +56,13 @@ guint32 dependent_type_register (DependentClass const *klass);
void dependent_types_init (void);
void dependent_types_shutdown (void);
void dependent_set_expr (Dependent *dependent, ExprTree *expr);
void dependent_link (Dependent *dep, CellPos const *pos);
void dependent_unlink (Dependent *dep, CellPos const *pos);
void dependent_unlink_sheet (Sheet *sheet);
void dependent_eval (Dependent *dep);
void dependent_changed (Dependent *dep, gboolean queue_recalc);
void cb_dependent_queue_recalc (Dependent *dep, gpointer ignore);
void dependent_set_expr (Dependent *dependent, ExprTree *expr);
void dependent_link (Dependent *dep, CellPos const *pos);
void dependent_unlink (Dependent *dep, CellPos const *pos);
void dependent_unlink_sheet (Sheet *sheet);
gboolean dependent_eval (Dependent *dep);
void dependent_changed (Dependent *dep, gboolean queue_recalc);
void cb_dependent_queue_recalc (Dependent *dep, gpointer ignore);
void cell_add_dependencies (Cell *cell);
void cell_drop_dependencies (Cell *cell);
......
......@@ -1066,9 +1066,8 @@ workbook_queue_all_recalc (Workbook *wb)
/**
* dependent_eval :
* @dep :
*
*/
void
gboolean
dependent_eval (Dependent *dep)
{
if (dep->flags & DEPENDENT_NEEDS_RECALC) {
......@@ -1077,18 +1076,20 @@ dependent_eval (Dependent *dep)
if (t != DEPENDENT_CELL) {
DependentClass *klass = g_ptr_array_index (dep_classes, t);
g_return_if_fail (klass);
g_return_val_if_fail (klass, FALSE);
(*klass->eval) (dep);
} else {
gboolean finished = cell_eval_content (DEP_TO_CELL (dep));
/* This should always be the top of the stack */
g_return_if_fail (finished);
g_return_val_if_fail (finished, FALSE);
}
/* Don't clear flag until after in case we iterate */
dep->flags &= ~DEPENDENT_NEEDS_RECALC;
return TRUE;
}
return FALSE;
}
/**
......@@ -1103,10 +1104,14 @@ dependent_eval (Dependent *dep)
void
workbook_recalc (Workbook *wb)
{
gboolean redraw = FALSE;
g_return_if_fail (IS_WORKBOOK (wb));
WORKBOOK_FOREACH_DEPENDENT (wb, dep, dependent_eval (dep););
WORKBOOK_FOREACH_SHEET (wb, sheet, sheet_redraw_all (sheet, FALSE););
WORKBOOK_FOREACH_DEPENDENT (wb, dep, redraw |= dependent_eval (dep););
if (redraw) {
WORKBOOK_FOREACH_SHEET (wb, sheet, sheet_redraw_all (sheet, FALSE););
}
}
/**
......
......@@ -56,13 +56,13 @@ guint32 dependent_type_register (DependentClass const *klass);
void dependent_types_init (void);
void dependent_types_shutdown (void);
void dependent_set_expr (Dependent *dependent, ExprTree *expr);
void dependent_link (Dependent *dep, CellPos const *pos);
void dependent_unlink (Dependent *dep, CellPos const *pos);
void dependent_unlink_sheet (Sheet *sheet);
void dependent_eval (Dependent *dep);
void dependent_changed (Dependent *dep, gboolean queue_recalc);
void cb_dependent_queue_recalc (Dependent *dep, gpointer ignore);
void dependent_set_expr (Dependent *dependent, ExprTree *expr);
void dependent_link (Dependent *dep, CellPos const *pos);
void dependent_unlink (Dependent *dep, CellPos const *pos);
void dependent_unlink_sheet (Sheet *sheet);
gboolean dependent_eval (Dependent *dep);
void dependent_changed (Dependent *dep, gboolean queue_recalc);
void cb_dependent_queue_recalc (Dependent *dep, gpointer ignore);
void cell_add_dependencies (Cell *cell);
void cell_drop_dependencies (Cell *cell);
......
......@@ -1541,7 +1541,6 @@ expr_rewrite (ExprTree const *expr, ExprRewriteInfo const *rwinfo)
return NULL;
case OPER_VAR:
{
if (rwinfo->type == EXPR_REWRITE_SHEET) {
if (expr->var.ref.sheet == rwinfo->u.sheet)
return expr_tree_new_constant (value_new_error (NULL, gnumeric_err_REF));
......@@ -1569,7 +1568,6 @@ expr_rewrite (ExprTree const *expr, ExprRewriteInfo const *rwinfo)
return expr_tree_new_var (&res);
}
}
}
case OPER_CONSTANT: {
Value const *v = expr->constant.value;
......
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