Commit ff553ef5 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa

formula_cell_list *ONLY* exists in the Workbook, not on the Sheet.

1998-11-23  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/sheet.h: formula_cell_list *ONLY* exists in the Workbook,
	not on the Sheet.

	* src/sheet.c (sheet_cell_formula_link,	sheet_cell_formula_unlink):
	Keep the formula on the Workbook, not on the Sheet.  Thanks to
	Havoc for reporting these bugs.

	* src/cell.c (cell_set_formula): Use cell_set_rendered_text to
	propery set the error messages.
	(cell_get_text): If value is NULL, use the rendered version of the
	text instead of re-rendering it.
parent 10ca9c84
1998-11-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet.h: formula_cell_list *ONLY* exists in the Workbook,
not on the Sheet.
* src/sheet.c (sheet_cell_formula_link, sheet_cell_formula_unlink):
Keep the formula on the Workbook, not on the Sheet. Thanks to
Havoc for reporting these bugs.
* src/cell.c (cell_set_formula): Use cell_set_rendered_text to
propery set the error messages.
(cell_get_text): If value is NULL, use the rendered version of the
text instead of re-rendering it.
* src/dialog-cell-format.c (create_number_format_page): Put the
clist inside a scrolled window for the new CList api.
......
1998-11-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet.h: formula_cell_list *ONLY* exists in the Workbook,
not on the Sheet.
* src/sheet.c (sheet_cell_formula_link, sheet_cell_formula_unlink):
Keep the formula on the Workbook, not on the Sheet. Thanks to
Havoc for reporting these bugs.
* src/cell.c (cell_set_formula): Use cell_set_rendered_text to
propery set the error messages.
(cell_get_text): If value is NULL, use the rendered version of the
text instead of re-rendering it.
* src/dialog-cell-format.c (create_number_format_page): Put the
clist inside a scrolled window for the new CList api.
......
1998-11-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet.h: formula_cell_list *ONLY* exists in the Workbook,
not on the Sheet.
* src/sheet.c (sheet_cell_formula_link, sheet_cell_formula_unlink):
Keep the formula on the Workbook, not on the Sheet. Thanks to
Havoc for reporting these bugs.
* src/cell.c (cell_set_formula): Use cell_set_rendered_text to
propery set the error messages.
(cell_get_text): If value is NULL, use the rendered version of the
text instead of re-rendering it.
* src/dialog-cell-format.c (create_number_format_page): Put the
clist inside a scrolled window for the new CList api.
......
1998-11-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet.h: formula_cell_list *ONLY* exists in the Workbook,
not on the Sheet.
* src/sheet.c (sheet_cell_formula_link, sheet_cell_formula_unlink):
Keep the formula on the Workbook, not on the Sheet. Thanks to
Havoc for reporting these bugs.
* src/cell.c (cell_set_formula): Use cell_set_rendered_text to
propery set the error messages.
(cell_get_text): If value is NULL, use the rendered version of the
text instead of re-rendering it.
* src/dialog-cell-format.c (create_number_format_page): Put the
clist inside a scrolled window for the new CList api.
......
......@@ -52,9 +52,7 @@ cell_set_formula (Cell *cell, char *text)
&desired_format,
&error_msg);
if (cell->parsed_node == NULL){
if (cell->text)
string_unref_ptr (&cell->text);
cell->text = string_get (error_msg);
cell_set_rendered_text (cell, error_msg);
return;
}
if (desired_format && strcmp (cell->style->format->format, "General") == 0){
......@@ -1327,12 +1325,7 @@ cell_draw (Cell *cell, void *sv, GdkGC *gc, GdkDrawable *drawable, int x1, int y
else
do_multi_line = FALSE;
#if 0
if (cell->text)
text = cell->text->str;
else
text = "";
#endif
text = cell->text->str;
if (do_multi_line){
GList *lines, *l;
......@@ -1491,7 +1484,14 @@ cell_get_text (Cell *cell)
return ret;
}
str = format_value (cell->style->format, cell->value, NULL);
/*
* If a value is set, return that text formatted
*/
if (cell->value)
str = format_value (cell->style->format, cell->value, NULL);
else
str = g_strdup (cell->text->str);
return str;
}
......@@ -19,7 +19,7 @@ static const struct poptOption options[] = {
{NULL, '\0', 0, NULL, 0}
};
static void
static int
gnumeric_main (void *closure, int argc, char *argv [])
{
GList *l;
......
......@@ -19,7 +19,7 @@ static const struct poptOption options[] = {
{NULL, '\0', 0, NULL, 0}
};
static void
static int
gnumeric_main (void *closure, int argc, char *argv [])
{
GList *l;
......
......@@ -2004,7 +2004,7 @@ sheet_cell_formula_link (Cell *cell)
sheet = cell->sheet;
sheet->formula_cell_list = g_list_prepend (sheet->formula_cell_list, cell);
sheet->workbook->formula_cell_list = g_list_prepend (sheet->workbook->formula_cell_list, cell);
cell_add_dependencies (cell);
}
......@@ -2018,7 +2018,7 @@ sheet_cell_formula_unlink (Cell *cell)
sheet = cell->sheet;
cell_drop_dependencies (cell);
sheet->formula_cell_list = g_list_remove (sheet->formula_cell_list, cell);
sheet->workbook->formula_cell_list = g_list_remove (sheet->workbook->formula_cell_list, cell);
}
/*
......
......@@ -106,9 +106,6 @@ typedef struct {
int cursor_col, cursor_row;
/* The list of formulas */
GList *formula_cell_list;
/* The list of cells that have a comment */
GList *comment_list;
......
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