Commit 01a95234 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Remainder of patch to handle non-cell dependents.

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

	* configure.in : Add test for pspell.
	* acconfig.h : Ditto.

	* s/cell.u.expression/cell.base.expression/
	* s/cell.generation/cell.base.generation/
	* s/cell.u.entered_text/cell.entered_text/  <- deprecated
	* s/workbook.formula_cell_list/workbook.dependents/

	* s/sheet_cell_expr_link/dependent_expr_link/
	* s/sheet_cell_expr_unlink/dependent_expr_unlink/

	* s/eval_queue_cell/dependent_queue_recalc/
	* s/eval_queue_list/dependent_queue_recalc_list/
	* s/eval_unqueue_cell/dependent_unqueue_recalc/
	* s/eval_unqueue_sheet/dependent_unqueue_recalc_sheet/
	*
	* s/cell_add_dependencies/dependent_add_dependencies
	* s/cell_drop_dependencies/dependent_drop_dependencies

	* s/cell_formula_changed/dependent_changed/
	* s/sheet_cell_expr_link/dependent_link/
	* s/CELL_IN_EXPR_LIST/DEPENDENT_IN_EXPR_LIST/

	* src/cell.c (cell_eval_content) : moved from eval.c

	* src/eval.c (sheet_region_get_deps) : Take a Range rather than 4 int.
	(drop_range_dep) : Use dependent_debug_name.
	(dependency_range_ctor) : Take a CellPos as an arg rather than a Cell.
	(handle_cell_single_dep) : Take an optional CellPos and a Dependent.
	(handle_cell_range_deps) : Ditto. Do not check for singletons here.
	(handle_tree_deps) : Ditto.  Call handle_cell_single_dep directly.
	(cell_add_explicit_dependency) : Delete.
	(get_single_dependencies) : Some const.

	* src/cmd-edit.c (cmd_select_cur_depends) : Use dependent_list_filter
	  to only show cell dependencies for now.

	* src/dependent.c (dependent_list_filter) : new function.
	(dependent_debug_name) : new function.

	* src/history.c : Add a comment about File/Print Preview for
	  translators.

	* src/workbook.c (cb_cell_rerender) : Only cells need this.
parent c0380cce
......@@ -19,6 +19,8 @@ Release Critical
font size and things like that.
- Copy sheet, and insert new sheet both append to the end of the sheet list
rather than inserting before the current sheet.
- When setting the zoom for excel import we respan & render all cells. Then
we redo it after loading. Add a flag to disable respanning to sheet_set_zoom.
Post 0.57 Changes
-----------------
......@@ -91,6 +93,7 @@ Printing
- cell text wraps differently when printing than displaying due to scaling
differences in font size. do we want to eliminate this ?
- headers and footers should be clipped
- Support for repeated rows/cols is borked.
Widget polishing
----------------
......
2000-09-05 Jody Goldberg <jgoldberg@home.com>
* configure.in : Add test for pspell.
* acconfig.h : Ditto.
* s/cell.u.expression/cell.base.expression/
* s/cell.generation/cell.base.generation/
* s/cell.u.entered_text/cell.entered_text/ <- deprecated
* s/workbook.formula_cell_list/workbook.dependents/
* s/sheet_cell_expr_link/dependent_expr_link/
* s/sheet_cell_expr_unlink/dependent_expr_unlink/
* s/eval_queue_cell/dependent_queue_recalc/
* s/eval_queue_list/dependent_queue_recalc_list/
* s/eval_unqueue_cell/dependent_unqueue_recalc/
* s/eval_unqueue_sheet/dependent_unqueue_recalc_sheet/
*
* s/cell_add_dependencies/dependent_add_dependencies
* s/cell_drop_dependencies/dependent_drop_dependencies
* s/cell_formula_changed/dependent_changed/
* s/sheet_cell_expr_link/dependent_link/
* s/CELL_IN_EXPR_LIST/DEPENDENT_IN_EXPR_LIST/
* src/cell.c (cell_eval_content) : moved from eval.c
* src/eval.c (sheet_region_get_deps) : Take a Range rather than 4 int.
(drop_range_dep) : Use dependent_debug_name.
(dependency_range_ctor) : Take a CellPos as an arg rather than a Cell.
(handle_cell_single_dep) : Take an optional CellPos and a Dependent.
(handle_cell_range_deps) : Ditto. Do not check for singletons here.
(handle_tree_deps) : Ditto. Call handle_cell_single_dep directly.
(cell_add_explicit_dependency) : Delete.
(get_single_dependencies) : Some const.
* src/cmd-edit.c (cmd_select_cur_depends) : Use dependent_list_filter
to only show cell dependencies for now.
* src/dependent.c (dependent_list_filter) : new function.
(dependent_debug_name) : new function.
* src/history.c : Add a comment about File/Print Preview for
translators.
* src/workbook.c (cb_cell_rerender) : Only cells need this.
2000-09-03 Almer. S. Tigelaar. <almer1@dds.nl>
* src/cell-draw.c:
......
2000-09-05 Jody Goldberg <jgoldberg@home.com>
* configure.in : Add test for pspell.
* acconfig.h : Ditto.
* s/cell.u.expression/cell.base.expression/
* s/cell.generation/cell.base.generation/
* s/cell.u.entered_text/cell.entered_text/ <- deprecated
* s/workbook.formula_cell_list/workbook.dependents/
* s/sheet_cell_expr_link/dependent_expr_link/
* s/sheet_cell_expr_unlink/dependent_expr_unlink/
* s/eval_queue_cell/dependent_queue_recalc/
* s/eval_queue_list/dependent_queue_recalc_list/
* s/eval_unqueue_cell/dependent_unqueue_recalc/
* s/eval_unqueue_sheet/dependent_unqueue_recalc_sheet/
*
* s/cell_add_dependencies/dependent_add_dependencies
* s/cell_drop_dependencies/dependent_drop_dependencies
* s/cell_formula_changed/dependent_changed/
* s/sheet_cell_expr_link/dependent_link/
* s/CELL_IN_EXPR_LIST/DEPENDENT_IN_EXPR_LIST/
* src/cell.c (cell_eval_content) : moved from eval.c
* src/eval.c (sheet_region_get_deps) : Take a Range rather than 4 int.
(drop_range_dep) : Use dependent_debug_name.
(dependency_range_ctor) : Take a CellPos as an arg rather than a Cell.
(handle_cell_single_dep) : Take an optional CellPos and a Dependent.
(handle_cell_range_deps) : Ditto. Do not check for singletons here.
(handle_tree_deps) : Ditto. Call handle_cell_single_dep directly.
(cell_add_explicit_dependency) : Delete.
(get_single_dependencies) : Some const.
* src/cmd-edit.c (cmd_select_cur_depends) : Use dependent_list_filter
to only show cell dependencies for now.
* src/dependent.c (dependent_list_filter) : new function.
(dependent_debug_name) : new function.
* src/history.c : Add a comment about File/Print Preview for
translators.
* src/workbook.c (cb_cell_rerender) : Only cells need this.
2000-09-03 Almer. S. Tigelaar. <almer1@dds.nl>
* src/cell-draw.c:
......
......@@ -8,6 +8,9 @@ Almer:
Chema:
* Copy sheet.
Hardy Falk:
* Output the cells in row/col sequence, taher than by hash.
Jody:
* Applix support mostly functional.
* Improve support for named expressions.
......
2000-09-05 Jody Goldberg <jgoldberg@home.com>
* configure.in : Add test for pspell.
* acconfig.h : Ditto.
* s/cell.u.expression/cell.base.expression/
* s/cell.generation/cell.base.generation/
* s/cell.u.entered_text/cell.entered_text/ <- deprecated
* s/workbook.formula_cell_list/workbook.dependents/
* s/sheet_cell_expr_link/dependent_expr_link/
* s/sheet_cell_expr_unlink/dependent_expr_unlink/
* s/eval_queue_cell/dependent_queue_recalc/
* s/eval_queue_list/dependent_queue_recalc_list/
* s/eval_unqueue_cell/dependent_unqueue_recalc/
* s/eval_unqueue_sheet/dependent_unqueue_recalc_sheet/
*
* s/cell_add_dependencies/dependent_add_dependencies
* s/cell_drop_dependencies/dependent_drop_dependencies
* s/cell_formula_changed/dependent_changed/
* s/sheet_cell_expr_link/dependent_link/
* s/CELL_IN_EXPR_LIST/DEPENDENT_IN_EXPR_LIST/
* src/cell.c (cell_eval_content) : moved from eval.c
* src/eval.c (sheet_region_get_deps) : Take a Range rather than 4 int.
(drop_range_dep) : Use dependent_debug_name.
(dependency_range_ctor) : Take a CellPos as an arg rather than a Cell.
(handle_cell_single_dep) : Take an optional CellPos and a Dependent.
(handle_cell_range_deps) : Ditto. Do not check for singletons here.
(handle_tree_deps) : Ditto. Call handle_cell_single_dep directly.
(cell_add_explicit_dependency) : Delete.
(get_single_dependencies) : Some const.
* src/cmd-edit.c (cmd_select_cur_depends) : Use dependent_list_filter
to only show cell dependencies for now.
* src/dependent.c (dependent_list_filter) : new function.
(dependent_debug_name) : new function.
* src/history.c : Add a comment about File/Print Preview for
translators.
* src/workbook.c (cb_cell_rerender) : Only cells need this.
2000-09-03 Almer. S. Tigelaar. <almer1@dds.nl>
* src/cell-draw.c:
......
2000-09-05 Jody Goldberg <jgoldberg@home.com>
* configure.in : Add test for pspell.
* acconfig.h : Ditto.
* s/cell.u.expression/cell.base.expression/
* s/cell.generation/cell.base.generation/
* s/cell.u.entered_text/cell.entered_text/ <- deprecated
* s/workbook.formula_cell_list/workbook.dependents/
* s/sheet_cell_expr_link/dependent_expr_link/
* s/sheet_cell_expr_unlink/dependent_expr_unlink/
* s/eval_queue_cell/dependent_queue_recalc/
* s/eval_queue_list/dependent_queue_recalc_list/
* s/eval_unqueue_cell/dependent_unqueue_recalc/
* s/eval_unqueue_sheet/dependent_unqueue_recalc_sheet/
*
* s/cell_add_dependencies/dependent_add_dependencies
* s/cell_drop_dependencies/dependent_drop_dependencies
* s/cell_formula_changed/dependent_changed/
* s/sheet_cell_expr_link/dependent_link/
* s/CELL_IN_EXPR_LIST/DEPENDENT_IN_EXPR_LIST/
* src/cell.c (cell_eval_content) : moved from eval.c
* src/eval.c (sheet_region_get_deps) : Take a Range rather than 4 int.
(drop_range_dep) : Use dependent_debug_name.
(dependency_range_ctor) : Take a CellPos as an arg rather than a Cell.
(handle_cell_single_dep) : Take an optional CellPos and a Dependent.
(handle_cell_range_deps) : Ditto. Do not check for singletons here.
(handle_tree_deps) : Ditto. Call handle_cell_single_dep directly.
(cell_add_explicit_dependency) : Delete.
(get_single_dependencies) : Some const.
* src/cmd-edit.c (cmd_select_cur_depends) : Use dependent_list_filter
to only show cell dependencies for now.
* src/dependent.c (dependent_list_filter) : new function.
(dependent_debug_name) : new function.
* src/history.c : Add a comment about File/Print Preview for
translators.
* src/workbook.c (cb_cell_rerender) : Only cells need this.
2000-09-03 Almer. S. Tigelaar. <almer1@dds.nl>
* src/cell-draw.c:
......
2000-09-05 Jody Goldberg <jgoldberg@home.com>
* configure.in : Add test for pspell.
* acconfig.h : Ditto.
* s/cell.u.expression/cell.base.expression/
* s/cell.generation/cell.base.generation/
* s/cell.u.entered_text/cell.entered_text/ <- deprecated
* s/workbook.formula_cell_list/workbook.dependents/
* s/sheet_cell_expr_link/dependent_expr_link/
* s/sheet_cell_expr_unlink/dependent_expr_unlink/
* s/eval_queue_cell/dependent_queue_recalc/
* s/eval_queue_list/dependent_queue_recalc_list/
* s/eval_unqueue_cell/dependent_unqueue_recalc/
* s/eval_unqueue_sheet/dependent_unqueue_recalc_sheet/
*
* s/cell_add_dependencies/dependent_add_dependencies
* s/cell_drop_dependencies/dependent_drop_dependencies
* s/cell_formula_changed/dependent_changed/
* s/sheet_cell_expr_link/dependent_link/
* s/CELL_IN_EXPR_LIST/DEPENDENT_IN_EXPR_LIST/
* src/cell.c (cell_eval_content) : moved from eval.c
* src/eval.c (sheet_region_get_deps) : Take a Range rather than 4 int.
(drop_range_dep) : Use dependent_debug_name.
(dependency_range_ctor) : Take a CellPos as an arg rather than a Cell.
(handle_cell_single_dep) : Take an optional CellPos and a Dependent.
(handle_cell_range_deps) : Ditto. Do not check for singletons here.
(handle_tree_deps) : Ditto. Call handle_cell_single_dep directly.
(cell_add_explicit_dependency) : Delete.
(get_single_dependencies) : Some const.
* src/cmd-edit.c (cmd_select_cur_depends) : Use dependent_list_filter
to only show cell dependencies for now.
* src/dependent.c (dependent_list_filter) : new function.
(dependent_debug_name) : new function.
* src/history.c : Add a comment about File/Print Preview for
translators.
* src/workbook.c (cb_cell_rerender) : Only cells need this.
2000-09-03 Almer. S. Tigelaar. <almer1@dds.nl>
* src/cell-draw.c:
......
2000-09-05 Jody Goldberg <jgoldberg@home.com>
* configure.in : Add test for pspell.
* acconfig.h : Ditto.
* s/cell.u.expression/cell.base.expression/
* s/cell.generation/cell.base.generation/
* s/cell.u.entered_text/cell.entered_text/ <- deprecated
* s/workbook.formula_cell_list/workbook.dependents/
* s/sheet_cell_expr_link/dependent_expr_link/
* s/sheet_cell_expr_unlink/dependent_expr_unlink/
* s/eval_queue_cell/dependent_queue_recalc/
* s/eval_queue_list/dependent_queue_recalc_list/
* s/eval_unqueue_cell/dependent_unqueue_recalc/
* s/eval_unqueue_sheet/dependent_unqueue_recalc_sheet/
*
* s/cell_add_dependencies/dependent_add_dependencies
* s/cell_drop_dependencies/dependent_drop_dependencies
* s/cell_formula_changed/dependent_changed/
* s/sheet_cell_expr_link/dependent_link/
* s/CELL_IN_EXPR_LIST/DEPENDENT_IN_EXPR_LIST/
* src/cell.c (cell_eval_content) : moved from eval.c
* src/eval.c (sheet_region_get_deps) : Take a Range rather than 4 int.
(drop_range_dep) : Use dependent_debug_name.
(dependency_range_ctor) : Take a CellPos as an arg rather than a Cell.
(handle_cell_single_dep) : Take an optional CellPos and a Dependent.
(handle_cell_range_deps) : Ditto. Do not check for singletons here.
(handle_tree_deps) : Ditto. Call handle_cell_single_dep directly.
(cell_add_explicit_dependency) : Delete.
(get_single_dependencies) : Some const.
* src/cmd-edit.c (cmd_select_cur_depends) : Use dependent_list_filter
to only show cell dependencies for now.
* src/dependent.c (dependent_list_filter) : new function.
(dependent_debug_name) : new function.
* src/history.c : Add a comment about File/Print Preview for
translators.
* src/workbook.c (cb_cell_rerender) : Only cells need this.
2000-09-03 Almer. S. Tigelaar. <almer1@dds.nl>
* src/cell-draw.c:
......
2000-09-05 Jody Goldberg <jgoldberg@home.com>
* configure.in : Add test for pspell.
* acconfig.h : Ditto.
* s/cell.u.expression/cell.base.expression/
* s/cell.generation/cell.base.generation/
* s/cell.u.entered_text/cell.entered_text/ <- deprecated
* s/workbook.formula_cell_list/workbook.dependents/
* s/sheet_cell_expr_link/dependent_expr_link/
* s/sheet_cell_expr_unlink/dependent_expr_unlink/
* s/eval_queue_cell/dependent_queue_recalc/
* s/eval_queue_list/dependent_queue_recalc_list/
* s/eval_unqueue_cell/dependent_unqueue_recalc/
* s/eval_unqueue_sheet/dependent_unqueue_recalc_sheet/
*
* s/cell_add_dependencies/dependent_add_dependencies
* s/cell_drop_dependencies/dependent_drop_dependencies
* s/cell_formula_changed/dependent_changed/
* s/sheet_cell_expr_link/dependent_link/
* s/CELL_IN_EXPR_LIST/DEPENDENT_IN_EXPR_LIST/
* src/cell.c (cell_eval_content) : moved from eval.c
* src/eval.c (sheet_region_get_deps) : Take a Range rather than 4 int.
(drop_range_dep) : Use dependent_debug_name.
(dependency_range_ctor) : Take a CellPos as an arg rather than a Cell.
(handle_cell_single_dep) : Take an optional CellPos and a Dependent.
(handle_cell_range_deps) : Ditto. Do not check for singletons here.
(handle_tree_deps) : Ditto. Call handle_cell_single_dep directly.
(cell_add_explicit_dependency) : Delete.
(get_single_dependencies) : Some const.
* src/cmd-edit.c (cmd_select_cur_depends) : Use dependent_list_filter
to only show cell dependencies for now.
* src/dependent.c (dependent_list_filter) : new function.
(dependent_debug_name) : new function.
* src/history.c : Add a comment about File/Print Preview for
translators.
* src/workbook.c (cb_cell_rerender) : Only cells need this.
2000-09-03 Almer. S. Tigelaar. <almer1@dds.nl>
* src/cell-draw.c:
......
......@@ -14,6 +14,7 @@
#undef ENABLE_GB
#undef HAVE_IEEEFP_H
#undef ENABLE_GNOME
#undef HAVE_PSPELL
#undef GNUMERIC_VERSION
......
......@@ -352,20 +352,58 @@ else
AC_MSG_ERROR(Did not find GTK+ installed)
fi
dnl ******************************
dnl Check for Applix SHELF
dnl ******************************
try_applix_shelf=false
applix_shelf=
applix_shelf_msg=no
have_applix_shelf=false
AC_ARG_WITH(applix_shelf,
[--{with,without}-shelf Compile with Applix SHELF support or without it],
dnl ****************
dnl Check for pspell
dnl ****************
try_pspell=true
have_pspell=false
pspell_msg=no
PSPELL_LIBS=""
AC_ARG_WITH(pspell,
[--{with,without}-pspell Compile with Pspell support or without it],
if test x$withval = xno; then
try_pspell=false
fi
if test x$withval = xyes; then
try_applix_shelf=true
try_pspell=true
fi
)
if $try_pspell; then
AC_MSG_CHECKING([for pspell])
if pspell-config version > /dev/null 2>&1; then
pspell_ver=`pspell-config version`
AC_MSG_RESULT([found ($pspell_ver)])
AC_CHECK_LIB(pspell, new_pspell_config, have_pspell=true)
if test x$have_pspell = xtrue; then
AC_DEFINE(HAVE_PSPELL)
PSPELL_LIBS="-lpspell"
pspell_msg=yes
fi
else
AC_MSG_RESULT(not found)
fi
fi
AC_SUBST(PSPELL_LIBS)
AM_CONDITIONAL(HAVE_PSPELL, $have_pspell)
dnl ******************************
dnl Check for Applix SHELF
dnl ******************************
dnl try_applix_shelf=false
dnl applix_shelf=
dnl applix_shelf_msg=no
dnl have_applix_shelf=false
dnl AC_ARG_WITH(applix_shelf,
dnl [--{with,without}-shelf Compile with Applix SHELF support or without it],
dnl if test x$withval = xyes; then
dnl try_applix_shelf=true
dnl fi
dnl)
dnl ***************************************
dnl Check for gnome-libs which supports wm icons
dnl ***************************************
......@@ -452,7 +490,7 @@ Configuration:
GB Support: ${gb_msg}
Bonobo Support: ${bonobo_msg}
Oaf Support: ${using_oaf}
Spell Checking: ${pspell_msg}
"
if $have_bonobo; then
echo "
......
......@@ -2204,7 +2204,7 @@ ms_excel_read_formula (BiffQuery *q, ExcelSheet *sheet)
* 0x2 = CalcOnLoad
*/
if (options & 0x3)
eval_queue_cell (cell);
dependent_queue_recalc (CELL_TO_DEP (cell));
}
BiffSharedFormula *
......
......@@ -1450,7 +1450,7 @@ pre_cell (gconstpointer dummy, Cell *cell, ExcelSheet *sheet)
cell_mark_used (sheet, col, row);
if (cell_has_expr (cell))
ms_formula_build_pre_data (sheet, cell->u.expression);
ms_formula_build_pre_data (sheet, cell->base.expression);
/* Save cell pointer */
c = excel_cell_get (sheet, col, row);
......@@ -2414,7 +2414,7 @@ write_formula (BiffPut *bp, ExcelSheet *sheet, const Cell *cell, gint16 xf)
MS_OLE_SET_GUINT32 (data + 16, 0x0);
MS_OLE_SET_GUINT16 (data + 20, 0x0);
ms_biff_put_var_write (bp, data, 22);
len = ms_excel_write_formula (bp, sheet, cell->u.expression,
len = ms_excel_write_formula (bp, sheet, cell->base.expression,
col, row);
g_assert (len <= 0xffff);
ms_biff_put_var_seekto (bp, 20);
......@@ -2463,7 +2463,7 @@ write_cell (BiffPut *bp, ExcelSheet *sheet, const ExcelCell *cell)
printf ("Writing cell at %s '%s' = '%s', xf = 0x%x\n",
cell_name (gnum_cell),
(cell_has_expr (gnum_cell) ?
expr_tree_as_string (gnum_cell->u.expression,
expr_tree_as_string (gnum_cell->base.expression,
parse_pos_init_cell (&tmp, gnum_cell)) :
"none"),
(gnum_cell->value ?
......
......@@ -782,9 +782,6 @@ gnumeric_indirect (FunctionEvalInfo *ei, Value **args)
calling_cell = sheet_cell_get (ei->pos->sheet,
ei->pos->eval.col, ei->pos->eval.row);
/* A dependency on the indirection cell if we do not already depend on it */
cell_add_explicit_dependency (calling_cell, &ref);
if (!dest_cell)
return value_new_int (0);
else
......
......@@ -812,7 +812,7 @@ gnumeric_expression (FunctionEvalInfo *ei, Value **args)
if (cell_has_expr (cell)) {
ParsePos pos;
char * expr_string =
expr_tree_as_string (cell->u.expression,
expr_tree_as_string (cell->base.expression,
parse_pos_init_evalpos (&pos, ei->pos));
Value * res = value_new_string (expr_string);
g_free (expr_string);
......
......@@ -919,7 +919,7 @@ xml2ParseCellContent (XML2ParseState *state)
if (expr == NULL) {
if (cell_has_expr (cell))
g_hash_table_insert (state->expr_map, id,
cell->u.expression);
cell->base.expression);
else
g_warning ("XML-IO2 : Shared expression with no expession ??");
} else if (!is_post_52_array)
......
......@@ -919,7 +919,7 @@ xml2ParseCellContent (XML2ParseState *state)
if (expr == NULL) {
if (cell_has_expr (cell))
g_hash_table_insert (state->expr_map, id,
cell->u.expression);
cell->base.expression);
else
g_warning ("XML-IO2 : Shared expression with no expession ??");
} else if (!is_post_52_array)
......
......@@ -230,6 +230,8 @@ GNUMERIC_BONOBO_SOURCES = \
bonobo-io.h \
embeddable-grid.c \
embeddable-grid.h \
graph-series.c \
graph-series.h \
sheet-object-bonobo.c \
sheet-object-bonobo.h \
sheet-object-container.c \
......@@ -264,6 +266,7 @@ gnumeric_LDADD = \
$(EXTRA_GNOME_LIBS) \
$(GNOME_XML_LIB) \
$(GUILE_LIBS) \
$(PSPELL_LIBS) \
$(INTLLIBS)
gnumeric_bonobo_LDADD = \
......@@ -274,6 +277,7 @@ gnumeric_bonobo_LDADD = \
$(EXTRA_GNOME_LIBS) \
$(GNOME_XML_LIB) \
$(GUILE_LIBS) \
$(PSPELL_LIBS) \
$(INTLLIBS)
wc:
......
......@@ -19,6 +19,8 @@
#include "parse-util.h"
#include "format.h"
extern int dependency_debugging;
/**
* cell_dirty : Mark the sheet containing the cell as being dirty.
* @cell : the dirty cell.
......@@ -35,22 +37,6 @@ cell_dirty (Cell *cell)
sheet_set_dirty(sheet, TRUE);
}
/**
* cell_formula_changed : Registers the expression with the sheet and
* optionally queues a recalc.
* @cell : the dirty cell.
* @queue_recalc: also queue a recalc for the cell.
*
* INTERNAL.
*/
static void
cell_formula_changed (Cell *cell, gboolean queue_recalc)
{
sheet_cell_expr_link (cell);
if (queue_recalc)
eval_queue_cell (cell);
}
/**
* cell_cleanout :
* Empty a cell's
......@@ -76,12 +62,12 @@ cell_cleanout (Cell *cell)
if (cell_has_expr (cell)) {
/* Clipboard cells, e.g., are not attached to a sheet. */
if (cell_expr_is_linked (cell))
sheet_cell_expr_unlink (cell);
expr_tree_unref (cell->u.expression);
cell->u.expression = NULL;
} else if (cell->u.entered_text) {
string_unref (cell->u.entered_text);
cell->u.entered_text = NULL;
dependent_unlink (CELL_TO_DEP (cell), &cell->pos);
expr_tree_unref (cell->base.expression);
cell->base.expression = NULL;
} else if (cell->entered_text) {
string_unref (cell->entered_text);
cell->entered_text = NULL;
}
if (cell->value) {
......@@ -122,13 +108,13 @@ cell_copy (Cell const *cell)
/* The new cell is not linked into any of the major management structures */
new_cell->base.sheet = NULL;
new_cell->base.flags &= ~(DEPENDENT_QUEUED_FOR_RECALC|CELL_IN_SHEET_LIST|CELL_IN_EXPR_LIST);
new_cell->base.flags &= ~(DEPENDENT_QUEUED_FOR_RECALC|CELL_IN_SHEET_LIST|DEPENDENT_IN_EXPR_LIST);
/* now copy properly the rest */
if (cell_has_expr (new_cell))
expr_tree_ref (new_cell->u.expression);
expr_tree_ref (new_cell->base.expression);
else
string_ref (new_cell->u.entered_text);
string_ref (new_cell->entered_text);
new_cell->rendered_value = NULL;
......@@ -165,8 +151,56 @@ cell_destroy (Cell *cell)
}
/**
* cell_content_changed: Queues recalc of all of the cells depends.
* cell_eval_content:
* @cell: the cell to evaluate.
*
* This function evaluates the contents of the cell,
* it should not be used by anyone. It is an internal
* function.
**/
void
cell_eval_content (Cell *cell)
{
Value *v;
EvalPos pos;
if (!cell_has_expr (cell))
return;
#ifdef DEBUG_EVALUATION
if (dependency_debugging > 1) {
ParsePos pp;
char *exprtxt = expr_decode_tree
(cell->base.expression, parse_pos_init_cell (&pp, cell));
printf ("Evaluating %s: %s ->\n", cell_name (cell), exprtxt);
g_free (exprtxt);
}
#endif
v = eval_expr (eval_pos_init_cell (&pos, cell),
cell->base.expression, EVAL_STRICT);
#ifdef DEBUG_EVALUATION
if (dependency_debugging > 1) {
char *valtxt = v
? value_get_as_string (v)
: g_strdup ("NULL");
printf ("Evaluating %s: -> %s\n", cell_name (cell), valtxt);
g_free (valtxt);
}
#endif
if (v == NULL)
v = value_new_error (&pos, "Internal error");
cell_assign_value (cell, v, NULL);
rendered_value_calc_size (cell);
sheet_redraw_cell (cell);
}
/**
* cell_content_changed: Queues recalc of all of the cells depends.
*/
void
cell_content_changed (Cell *cell)
......@@ -178,7 +212,7 @@ cell_content_changed (Cell *cell)
/* Queue all of the dependencies for this cell */
deps = cell_get_dependencies (cell);
if (deps)
eval_queue_list (deps, TRUE);
dependent_queue_recalc_list (deps, TRUE);
}
/*
......@@ -200,10 +234,10 @@ cell_relocate (Cell *cell, ExprRewriteInfo *rwinfo)
/* 2. If the cell contains a formula, relocate the formula */
if (cell_has_expr (cell)) {
ExprTree *expr = cell->u.expression;
ExprTree *expr = cell->base.expression;
if (cell_expr_is_linked (cell))
sheet_cell_expr_unlink (cell);
dependent_unlink (CELL_TO_DEP (cell), &cell->pos);
/*
* WARNING WARNING WARNING
......@@ -230,13 +264,13 @@ cell_relocate (Cell *cell, ExprRewriteInfo *rwinfo)
if (expr != NULL) {
/* expression was unlinked above */
expr_tree_unref (cell->u.expression);
cell->u.expression = expr;
expr_tree_unref (cell->base.expression);
cell->base.expression = expr;
}
}
/* Relink the expression. */
cell_formula_changed (cell, TRUE);
dependent_changed (CELL_TO_DEP (cell), &cell->pos, TRUE);
}
/* 3. Move any auxiliary canvas items */
......@@ -281,7 +315,7 @@ cell_set_text (Cell *cell, char const *text)
cell->base.flags &= ~CELL_HAS_EXPRESSION;
cell->value = val;
cell->u.entered_text = string_get (text);
cell->entered_text = string_get (text);
cell->format = format;
cell_render_value (cell);
} else { /* String was an expression */
......@@ -321,7 +355,7 @@ cell_set_text_and_value (Cell *cell, String *text,
cell_cleanout (cell);
cell->format = opt_fmt;
cell->u.entered_text = string_ref (text);
cell->entered_text = string_ref (text);
cell->value = v;
cell_render_value (cell);
}
......@@ -400,14 +434,14 @@ cell_set_value (Cell *cell, Value *v, StyleFormat *opt_fmt)
if (v->type == VALUE_STRING) {
/* TODO : add new string routine to avoid the extra copy */
char *tmp = g_strconcat ("\'", v->v_str.val->str, NULL);
cell->u.entered_text = string_get (tmp);
cell->entered_text = string_get (tmp);