Commit 8b5866fb authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

New base class for Cells. Convert everything to access the elements that


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

	* dependent.[ch] : New base class for Cells.
	  Convert everything to access the elements that are now
	  in the cell's base.
	s/Cell::sheet/Cell::Dependent::sheet/
	s/Cell::cell_flags/Cell::Dependent::flags/

	* Makefile.am : Because of XL we need to build plugins before src.
	  That will need changing.

	* src/func.c (function_marshal_arg) : Use expr_array_intersection.

	* src/expr.c (eval_expr_real) : Do implicit conversions from strings
	  to numbers if possible.
	  Access the first element of an array.  NOTE : This is WRONG
	  We need to implement array expression behavior some day.
	(expr_array_intersection) : New routine.
parent 29debbc9
2000-08-30 Jody Goldberg <jgoldberg@home.com>
* dependent.[ch] : New base class for Cells.
Convert everything to access the elements that are now
in the cell's base.
s/Cell::sheet/Cell::Dependent::sheet/
s/Cell::cell_flags/Cell::Dependent::flags/
* Makefile.am : Because of XL we need to build plugins before src.
That will need changing.
* src/func.c (function_marshal_arg) : Use expr_array_intersection.
* src/expr.c (eval_expr_real) : Do implicit conversions from strings
to numbers if possible.
Access the first element of an array. NOTE : This is WRONG
We need to implement array expression behavior some day.
(expr_array_intersection) : New routine.
2000-08-30 Morten Welinder <terra@diku.dk>
* src/print-cell.c (print_show_iso8859_1): Fix a few type errors.
......
2000-08-30 Jody Goldberg <jgoldberg@home.com>
* dependent.[ch] : New base class for Cells.
Convert everything to access the elements that are now
in the cell's base.
s/Cell::sheet/Cell::Dependent::sheet/
s/Cell::cell_flags/Cell::Dependent::flags/
* Makefile.am : Because of XL we need to build plugins before src.
That will need changing.
* src/func.c (function_marshal_arg) : Use expr_array_intersection.
* src/expr.c (eval_expr_real) : Do implicit conversions from strings
to numbers if possible.
Access the first element of an array. NOTE : This is WRONG
We need to implement array expression behavior some day.
(expr_array_intersection) : New routine.
2000-08-30 Morten Welinder <terra@diku.dk>
* src/print-cell.c (print_show_iso8859_1): Fix a few type errors.
......
......@@ -6,6 +6,7 @@ Almer:
Chema:
* Copy sheet.
Jody:
* Applix support mostly functional.
* Improve support for named expressions.
......@@ -13,6 +14,7 @@ Jody:
* Improve internation keyboard support.
* Fix XIRR and friends.
* A few more bugs in printing multiline text.
* Correct handling of number formating in intl locales.
John Gill:
* Double click fill support.
......@@ -23,6 +25,7 @@ Jon K
JPR:
* Put more effort into reverse engineering MATCH (and friends)
than you want to know about.
* Fixed sort to ignore hidden rows/cols.
Jukka:
* Implementation of `Anova: Two-Factor With Replication'
......@@ -51,6 +54,9 @@ Morten:
Pablo De Napoli:
* New NT_MU function in numtheory.
Thomas Canty:
* Updated and improved documentation.
Translations:
* Updated: da (Kenneth/Keld?), de (Karl), en_GB (Robert), ko
(Sung-Hyun Nam), no (Kjartan), ru (Valek), uk (Yuri), maybe more.
......
2000-08-30 Jody Goldberg <jgoldberg@home.com>
* dependent.[ch] : New base class for Cells.
Convert everything to access the elements that are now
in the cell's base.
s/Cell::sheet/Cell::Dependent::sheet/
s/Cell::cell_flags/Cell::Dependent::flags/
* Makefile.am : Because of XL we need to build plugins before src.
That will need changing.
* src/func.c (function_marshal_arg) : Use expr_array_intersection.
* src/expr.c (eval_expr_real) : Do implicit conversions from strings
to numbers if possible.
Access the first element of an array. NOTE : This is WRONG
We need to implement array expression behavior some day.
(expr_array_intersection) : New routine.
2000-08-30 Morten Welinder <terra@diku.dk>
* src/print-cell.c (print_show_iso8859_1): Fix a few type errors.
......
2000-08-30 Jody Goldberg <jgoldberg@home.com>
* dependent.[ch] : New base class for Cells.
Convert everything to access the elements that are now
in the cell's base.
s/Cell::sheet/Cell::Dependent::sheet/
s/Cell::cell_flags/Cell::Dependent::flags/
* Makefile.am : Because of XL we need to build plugins before src.
That will need changing.
* src/func.c (function_marshal_arg) : Use expr_array_intersection.
* src/expr.c (eval_expr_real) : Do implicit conversions from strings
to numbers if possible.
Access the first element of an array. NOTE : This is WRONG
We need to implement array expression behavior some day.
(expr_array_intersection) : New routine.
2000-08-30 Morten Welinder <terra@diku.dk>
* src/print-cell.c (print_show_iso8859_1): Fix a few type errors.
......
2000-08-30 Jody Goldberg <jgoldberg@home.com>
* dependent.[ch] : New base class for Cells.
Convert everything to access the elements that are now
in the cell's base.
s/Cell::sheet/Cell::Dependent::sheet/
s/Cell::cell_flags/Cell::Dependent::flags/
* Makefile.am : Because of XL we need to build plugins before src.
That will need changing.
* src/func.c (function_marshal_arg) : Use expr_array_intersection.
* src/expr.c (eval_expr_real) : Do implicit conversions from strings
to numbers if possible.
Access the first element of an array. NOTE : This is WRONG
We need to implement array expression behavior some day.
(expr_array_intersection) : New routine.
2000-08-30 Morten Welinder <terra@diku.dk>
* src/print-cell.c (print_show_iso8859_1): Fix a few type errors.
......
2000-08-30 Jody Goldberg <jgoldberg@home.com>
* dependent.[ch] : New base class for Cells.
Convert everything to access the elements that are now
in the cell's base.
s/Cell::sheet/Cell::Dependent::sheet/
s/Cell::cell_flags/Cell::Dependent::flags/
* Makefile.am : Because of XL we need to build plugins before src.
That will need changing.
* src/func.c (function_marshal_arg) : Use expr_array_intersection.
* src/expr.c (eval_expr_real) : Do implicit conversions from strings
to numbers if possible.
Access the first element of an array. NOTE : This is WRONG
We need to implement array expression behavior some day.
(expr_array_intersection) : New routine.
2000-08-30 Morten Welinder <terra@diku.dk>
* src/print-cell.c (print_show_iso8859_1): Fix a few type errors.
......
2000-08-30 Jody Goldberg <jgoldberg@home.com>
* dependent.[ch] : New base class for Cells.
Convert everything to access the elements that are now
in the cell's base.
s/Cell::sheet/Cell::Dependent::sheet/
s/Cell::cell_flags/Cell::Dependent::flags/
* Makefile.am : Because of XL we need to build plugins before src.
That will need changing.
* src/func.c (function_marshal_arg) : Use expr_array_intersection.
* src/expr.c (eval_expr_real) : Do implicit conversions from strings
to numbers if possible.
Access the first element of an array. NOTE : This is WRONG
We need to implement array expression behavior some day.
(expr_array_intersection) : New routine.
2000-08-30 Morten Welinder <terra@diku.dk>
* src/print-cell.c (print_show_iso8859_1): Fix a few type errors.
......
......@@ -28,26 +28,6 @@
<section>
<title>Graphics Component</title>
<entry size="small" status="0%" target="1.0">
<title>Fix scaling in scatter plots</title>
<description>
Scatter plots are not scaling correctly currently: they are
not scaling to the dimensions of the allocated size for the
graph inside the layout.
</description>
<contact>miguel@helixcode.com</contact>
</entry>
<entry size="small" status="0%" target="1.0">
<title>Stacked and Stacked 100% are not implemented for line plots</title>
<description>
The stacked and stacked 100% code paths for line plots have
not been implemented yet. They should be fairly simple to
implement.
</description>
<contact>miguel@helixcode.com</contact>
</entry>
<entry size="medium" status="0%" target="1.0">
<title>Need to support captions</title>
<description>
......@@ -56,41 +36,6 @@
<contact>miguel@helixcode.com</contact>
</entry>
<entry size="medium" status="0%" target="1.0">
<title>Add axis object</title>
<description>
Axis are supposed to be independent objects that are handled
by the Layout object. The Axis object does not yet exist and
needs to be implemented
</description>
<contact>miguel@helixcode.com</contact>
</entry>
<entry size="medium" status="0%" target="1.0">
<title>Pie Charts</title>
<description>
There is no pie support in the Graphics component yet.
</description>
<contact>miguel@helixcode.com</contact>
</entry>
<entry size="medium" status="0%" target="1.0">
<title>Add 3d plotting</title>
<description>
There is no 3d plotting right now.
</description>
<contact>miguel@helixcode.com</contact>
</entry>
<entry size="medium" status="0%" target="1.0">
<title>Add editing facilities</title>
<description>
No graph item supports any form of editing right now, and we
need to implement it.
</description>
<contact>miguel@helixcode.com</contact>
</entry>
</section> <!--Graphics Component-->
</todo>
......@@ -13,10 +13,10 @@
#include "cell.h"
#include "workbook.h"
#include "format.h"
#include "style.h"
#include "number-match.h"
#include <sys/utsname.h>
enum Value_Class {
VALUE_CLASS_NUMBER = 1,
VALUE_CLASS_TEXT = 2,
......@@ -864,7 +864,7 @@ information_functions_init (void)
&help_error, gnumeric_error);
function_add_nodes (cat, "error.type", "", "",
&help_error_type, gnumeric_error_type);
function_add_args (cat, "info", "?", "info_type",
function_add_args (cat, "info", "s", "info_type",
&help_info, gnumeric_info);
function_add_nodes (cat, "isblank", "?", "value",
&help_isblank, gnumeric_isblank);
......
......@@ -87,6 +87,8 @@ GNUMERIC_BASE_SOURCES = \
dates.h \
datetime.c \
datetime.h \
dependent.c \
dependent.h \
eval.h \
eval.c \
expr.c \
......@@ -99,7 +101,7 @@ GNUMERIC_BASE_SOURCES = \
formats.c \
func.c \
func.h \
func-utils.h \
func-util.h \
format.c \
format.h \
global-gnome-font.c \
......@@ -226,8 +228,7 @@ GNUMERIC_BONOBO_SOURCES = \
sheet-object-container.h \
sheet-object-item.c \
sheet-object-item.h \
sheet-vector.c \
sheet-vector.h
graph-series.c
gnumeric_SOURCES = \
main.c \
......
......@@ -19,6 +19,7 @@
#include "parse-util.h"
#include "tools.h"
#include "value.h"
#include "style.h"
#include "regression.h"
#include "workbook.h"
......
......@@ -117,7 +117,7 @@ cell_comment_realize (Cell *cell)
g_return_if_fail (cell->comment != NULL);
sheet_cell_comment_link (cell);
for (l = cell->sheet->sheet_views; l; l = l->next){
for (l = cell->base.sheet->sheet_views; l; l = l->next){
SheetView *sheet_view = SHEET_VIEW (l->data);
GnomeCanvasItem *o;
......@@ -149,7 +149,7 @@ cell_set_comment (Cell *cell, const char *str)
cell->comment->comment = string_get (str);
if (cell->sheet)
if (cell->base.sheet)
cell_comment_realize (cell);
}
......
......@@ -140,7 +140,7 @@ cell_draw (Cell const *cell, MStyle *mstyle, CellSpanInfo const * const spaninfo
GdkFont *font;
GdkRectangle rect;
Sheet const * const sheet = cell->sheet;
Sheet const * const sheet = cell->base.sheet;
ColRowInfo const * const ci = cell->col_info;
ColRowInfo const * const ri = cell->row_info;
int start_col, end_col;
......
......@@ -11,6 +11,7 @@
#include "cell-comment.h"
#include "expr.h"
#include "eval.h"
#include "style.h"
#include "sheet.h"
#include "value.h"
#include "rendered-value.h"
......@@ -27,7 +28,7 @@
static inline void
cell_dirty (Cell *cell)
{
Sheet *sheet = cell->sheet;
Sheet *sheet = cell->base.sheet;
/* Cells from the clipboard do not have a sheet attached */
if (sheet)
......@@ -96,7 +97,7 @@ cell_cleanout (Cell *cell)
cell->format = NULL;
}
cell->cell_flags &= ~(CELL_HAS_EXPRESSION|CELL_QUEUED_FOR_RECALC);
cell->base.flags &= ~(CELL_HAS_EXPRESSION|DEPENDENT_QUEUED_FOR_RECALC);
}
/**
......@@ -120,8 +121,8 @@ cell_copy (Cell const *cell)
*new_cell = *cell;
/* The new cell is not linked into any of the major management structures */
new_cell->sheet = NULL;
new_cell->cell_flags &= ~(CELL_QUEUED_FOR_RECALC|CELL_IN_SHEET_LIST|CELL_IN_EXPR_LIST);
new_cell->base.sheet = NULL;
new_cell->base.flags &= ~(DEPENDENT_QUEUED_FOR_RECALC|CELL_IN_SHEET_LIST|CELL_IN_EXPR_LIST);
/* now copy properly the rest */
if (cell_has_expr (new_cell))
......@@ -218,7 +219,7 @@ cell_relocate (Cell *cell, ExprRewriteInfo *rwinfo)
int const y = expr->array.y;
if (x != 0 || y != 0)
expr->array.corner.cell =
sheet_cell_get (cell->sheet,
sheet_cell_get (cell->base.sheet,
cell->pos.col - x,
cell->pos.row - y);
}
......@@ -278,7 +279,7 @@ cell_set_text (Cell *cell, char const *text)
if (val != NULL) { /* String was a value */
cell_cleanout (cell);
cell->cell_flags &= ~CELL_HAS_EXPRESSION;
cell->base.flags &= ~CELL_HAS_EXPRESSION;
cell->value = val;
cell->u.entered_text = string_get (text);
cell->format = format;
......@@ -439,7 +440,7 @@ cell_set_expr_and_value (Cell *cell, ExprTree *expr, Value *v)
cell_cleanout (cell);
cell->u.expression = expr;
cell->cell_flags |= CELL_HAS_EXPRESSION;
cell->base.flags |= CELL_HAS_EXPRESSION;
sheet_cell_expr_link (cell);
#if 0
/* TODO : Should we add this for consistancy ? */
......@@ -478,7 +479,7 @@ cell_set_expr_internal (Cell *cell, ExprTree *expr, StyleFormat *opt_fmt)
cell->format = opt_fmt;
cell->u.expression = expr;
cell->cell_flags |= CELL_HAS_EXPRESSION;
cell->base.flags |= CELL_HAS_EXPRESSION;
/* Until the value is recomputed, we put in this value. */
cell->value = value_new_error (NULL, gnumeric_err_RECALC);
......@@ -679,7 +680,7 @@ cell_render_value (Cell *cell)
MStyle *
cell_get_mstyle (Cell const *cell)
{
return sheet_style_compute (cell->sheet,
return sheet_style_compute (cell->base.sheet,
cell->pos.col,
cell->pos.row);
}
......@@ -692,7 +693,7 @@ cell_set_mstyle (Cell const *cell, MStyle *mstyle)
range.start = cell->pos;
range.end = range.start;
sheet_style_attach (cell->sheet, range, mstyle);
sheet_style_attach (cell->base.sheet, range, mstyle);
}
char *
......@@ -771,7 +772,7 @@ cell_make_value (Cell *cell)
expr_tree_unref (cell->u.expression);
cell->u.expression = NULL;
cell->cell_flags &= ~CELL_HAS_EXPRESSION;
cell->base.flags &= ~CELL_HAS_EXPRESSION;
if (cell->rendered_value == NULL)
cell_render_value (cell);
......
......@@ -3,32 +3,28 @@
#include <glib.h>
#include "gnumeric.h"
#include "style.h"
#include "str.h"
#include "dependent.h"
typedef enum {
/* Cell has an expression rather than entered_text */
CELL_HAS_EXPRESSION = 0x1,
/* Cell has been queued for recalc */
CELL_QUEUED_FOR_RECALC = 0x2,
/* Cell has be linked into the workbook wide expression list */
CELL_IN_EXPR_LIST = 0x4,
CELL_IN_EXPR_LIST = 0x2,
/* Cell is linked into the sheet */
CELL_IN_SHEET_LIST = 0x8
CELL_IN_SHEET_LIST = 0x4
/* MUST BE <= 0xffff */
} CellFlags;
typedef struct _CellComment CellComment;
/* Definition of a Gnumeric Cell */
struct _Cell {
Dependent base;
/* Mandatory state information */
CellPos pos;
CellFlags cell_flags;
Sheet *sheet;
ColRowInfo *col_info;
ColRowInfo *row_info;
......@@ -64,10 +60,10 @@ gboolean cell_is_number (Cell const * cell);
gboolean cell_is_zero (Cell const * cell);
ExprArray const * cell_is_array (Cell const * cell);
gboolean cell_is_partial_array (Cell const * cell);
#define cell_needs_recalc(cell) ((cell)->cell_flags & CELL_QUEUED_FOR_RECALC)
#define cell_has_expr(cell) ((cell)->cell_flags & CELL_HAS_EXPRESSION)
#define cell_is_linked(cell) ((cell)->cell_flags & CELL_IN_SHEET_LIST)
#define cell_expr_is_linked(cell) ((cell)->cell_flags & CELL_IN_EXPR_LIST)
#define cell_needs_recalc(cell) ((cell)->base.flags & DEPENDENT_QUEUED_FOR_RECALC)
#define cell_has_expr(cell) ((cell)->base.flags & CELL_HAS_EXPRESSION)
#define cell_is_linked(cell) ((cell)->base.flags & CELL_IN_SHEET_LIST)
#define cell_expr_is_linked(cell) ((cell)->base.flags & CELL_IN_EXPR_LIST)
#define cell_has_comment(cell) ((cell)->comment != NULL)
/**
......
......@@ -17,6 +17,7 @@
#include <config.h>
#include "cellspan.h"
#include "cell.h"
#include "style.h"
#include "colrow.h"
#include "value.h"
#include "rendered-value.h"
......@@ -175,7 +176,7 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
return;
}
sheet = cell->sheet;
sheet = cell->base.sheet;
mstyle = cell_get_mstyle (cell);
align = value_get_default_halign (cell->value, mstyle);
row = cell->pos.row;
......@@ -317,7 +318,7 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
cell_is_blank (sheet_cell_get (sheet, tmp, row)) &&
NULL == row_span_get (ri, tmp)) {
MStyle * const mstyle =
sheet_style_compute (cell->sheet, tmp, row);
sheet_style_compute (cell->base.sheet, tmp, row);
gboolean const res =
(mstyle_get_align_h (mstyle) == HALIGN_CENTER_ACROSS_SELECTION);
mstyle_unref (mstyle);
......@@ -332,7 +333,7 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
if (tmp < SHEET_MAX_COLS &&
cell_is_blank (sheet_cell_get (sheet, tmp, row))) {
MStyle * const mstyle =
sheet_style_compute (cell->sheet, tmp, row);
sheet_style_compute (cell->base.sheet, tmp, row);
gboolean const res =
(mstyle_get_align_h (mstyle) == HALIGN_CENTER_ACROSS_SELECTION);
mstyle_unref (mstyle);
......
......@@ -142,7 +142,7 @@ paste_cell_with_operation (Sheet *dest_sheet,
return;
new_cell = cell_copy (c_copy->u.cell);
new_cell->sheet = dest_sheet;
new_cell->base.sheet = dest_sheet;
new_cell->pos.col = target_col;
new_cell->pos.row = target_row;
......@@ -230,7 +230,7 @@ paste_cell (Sheet *dest_sheet,
Cell *new_cell = cell_copy (c_copy->u.cell);
/* Cell can not be linked in yet, but it needs an accurate location */
new_cell->sheet = dest_sheet;
new_cell->base.sheet = dest_sheet;
new_cell->pos.col = target_col;
new_cell->pos.row = target_row;
......@@ -545,7 +545,7 @@ clipboard_release (CellRegion *content)
if (this_cell->type == CELL_COPY_TYPE_CELL) {
/* The cell is not really in the rows or columns */
this_cell->u.cell->sheet = NULL;
this_cell->u.cell->base.sheet = NULL;
this_cell->u.cell->row_info = NULL;
this_cell->u.cell->col_info = NULL;
cell_destroy (this_cell->u.cell);
......
......@@ -735,8 +735,8 @@ cmd_ins_del_row_col_redo (GnumericCommand *cmd, CommandContext *context)
trouble = sheet_delete_cols (context, me->sheet, me->index,
me->count, &me->reloc_storage);
else
trouble =sheet_delete_rows (context, me->sheet, me->index,
me->count, &me->reloc_storage);
trouble = sheet_delete_rows (context, me->sheet, me->index,
me->count, &me->reloc_storage);
}
sheet_set_dirty (me->sheet, TRUE);
......
......@@ -13,6 +13,7 @@
#include <string.h>
#include "sheet.h"
#include "cell.h"
#include "str.h"
#include "complete-sheet.h"
#include "gnumeric-type-util.h"
......
#ifndef GNUMERIC_CURSORS_H
#define GNUMERIC_CURSORS_H
#include <gdk/gdk.h>
typedef enum {
GNUMERIC_CURSOR_FAT_CROSS,
GNUMERIC_CURSOR_THIN_CROSS,
......
/*
* eval.c: Cell recomputation routines.
* eval.c: Recomputation routines for things that depend on cells.
*
* Please do not commit to this module, send a patch to Michael.
*
......@@ -26,25 +26,25 @@ typedef enum {
/*
* A DependencyRange defines a range of cells whose values
* are used by another Cell in the spreadsheet.
* are used by another objects in the spreadsheet.
*
* A change in those cells will trigger a recomputation on the
* cells listed in cell_list.
* cells listed in dependent_list.
*/
typedef struct {
/*
* This range specifies uniquely the position of the
* cells that are depended on by the cell_list.
* cells that are depended on by the dependent_list.
*/
Range range;
/* The list of cells that depend on this range */
GList *cell_list;
GList *dependent_list;
} DependencyRange;
/*
* A DependencySingle stores a list of cells that depend
* on the cell at @pos in @cell_list. NB. the EvalPos
* on the cell at @pos in @dependent_list. NB. the EvalPos
* is quite vital since there may not be a cell there yet.
*/
typedef struct {
......@@ -55,7 +55,7 @@ typedef struct {
/*
* The list of cells that depend on this cell
*/
GList *cell_list;
GList *dependent_list;
} DependencySingle;
struct _DependencyData {
......@@ -140,8 +140,8 @@ dependency_range_destroy (gpointer key, gpointer value, gpointer closure)
{
DependencyRange *deprange = value;
g_list_free (deprange->cell_list);
deprange->cell_list = NULL;
g_list_free (deprange->dependent_list);
deprange->dependent_list = NULL;
g_free (value);
......@@ -153,8 +153,8 @@ dependency_single_destroy (gpointer key, gpointer value, gpointer closure)
{
DependencySingle *single = value;
g_list_free (single->cell_list);
single->cell_list = NULL;
g_list_free (single->dependent_list);
single->dependent_list = NULL;
g_free (value);
......@@ -164,7 +164,7 @@ dependency_single_destroy (gpointer key, gpointer value, gpointer closure)
typedef struct {
ExprRewriteInfo const *rwinfo;
GSList *cell_list;
GSList *dependent_list;
} destroy_closure_t;
static void
......@@ -174,18 +174,18 @@ cb_range_hash_to_list (gpointer key, gpointer value, gpointer closure)
GList *l;
DependencyRange *dep = value;
for (l = dep->cell_list; l; l = l->next) {
Cell *cell = l->data;
for (l = dep->dependent_list; l; l = l->next) {
Dependent *dependent = l->data;
if (c->rwinfo->type == EXPR_REWRITE_SHEET &&
cell->sheet != c->rwinfo->u.sheet)
dependent->sheet != c->rwinfo->u.sheet)
c->cell_list = g_slist_prepend (c->cell_list, l->data);
c->dependent_list = g_slist_prepend (c->dependent_list, l->data);
else if (c->rwinfo->type == EXPR_REWRITE_WORKBOOK &&
cell->sheet->workbook != c->rwinfo->u.workbook)
dependent->sheet->workbook != c->rwinfo->u.workbook)
c->cell_list = g_slist_prepend (c->cell_list, l->data);
c->dependent_list = g_slist_prepend (c->dependent_list, l->data);
}
}
......@@ -196,18 +196,18 @@ cb_single_hash_to_list (gpointer key, gpointer value, gpointer closure)
GList *l;
DependencySingle *dep = value;
for (l = dep->cell_list; l; l = l->next) {
Cell *cell = l->data;
for (l = dep->dependent_list; l; l = l->next) {
Dependent *dependent = l->data;
if (c->rwinfo->type == EXPR_REWRITE_SHEET &&
cell->sheet != c->rwinfo->u.sheet)
dependent->sheet != c->rwinfo->u.sheet)
c->cell_list = g_slist_prepend (c->cell_list, l->data);
c->dependent_list = g_slist_prepend (c->dependent_list, l->data);
else if (c->rwinfo->type == EXPR_REWRITE_WORKBOOK &&
cell->sheet->workbook != c->rwinfo->u.workbook)
dependent->sheet->workbook != c->rwinfo->u.workbook)
c->cell_list = g_slist_prepend (c->cell_list, l->data);
c->dependent_list = g_slist_prepend (c->dependent_list, l->data);
}
}
......@@ -228,7 +228,7 @@ invalidate_refs (Cell *cell, const ExprRewriteInfo *rwinfo)
#if 0
fprintf (stderr, "Invalidating to #REF! in %s!%s %p\n",
cell->sheet->name_quoted, cell_name (cell), newtree);
cell->base.sheet->name_quoted, cell_name (cell), newtree);
#endif
/*
......@@ -256,15 +256,15 @@ do_deps_destroy (Sheet *sheet, const ExprRewriteInfo *rwinfo)
return;
c.rwinfo = rwinfo;
c.cell_list = NULL;
c.dependent_list = NULL;
if (deps->range_hash) {
g_hash_table_foreach (deps->range_hash,
&cb_range_hash_to_list, &c);
while (c.cell_list) {
invalidate_refs (c.cell_list->data, rwinfo);
c.cell_list = g_slist_remove (c.cell_list, c.cell_list->data);
while (c.dependent_list) {
invalidate_refs (c.dependent_list->data, rwinfo);
c.dependent_list = g_slist_remove (c.dependent_list, c.dependent_list->data);
}
g_hash_table_foreach_remove (deps->range_hash,
......@@ -275,14 +275,14 @@ do_deps_destroy (Sheet *sheet, const ExprRewriteInfo *rwinfo)
deps->range_hash = NULL;
}
c.cell_list = NULL;
c.dependent_list = NULL;
if (deps->single_hash) {
g_hash_table_foreach (deps->single_hash,
&cb_single_hash_to_list, &c);