Commit 0f4097ca authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Fix minor thinko in eval_expr.

Improve status update after load.

2000-04-06  Jody Goldberg <jgoldberg@home.com>

	* src/xml-io.c (gnumeric_xml_read_workbook) : No need to recalc, the
	  loader handles it.

	* src/file.c (workbook_read) : Do a recalc and sheet_update after loading.
	  Wrap entire process in deep_{freeze,thaw}.

	* src/expr.c (eval_expr) : Fix thinko.
parent f4bd1b61
2000-04-06 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (gnumeric_xml_read_workbook) : No need to recalc, the
loader handles it.
* src/file.c (workbook_read) : Do a recalc and sheet_update after loading.
Wrap entire process in deep_{freeze,thaw}.
* src/expr.c (eval_expr) : Fix thinko.
* src/functions/fn-string.c : Add func 'expression' to return text of
......
2000-04-06 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (gnumeric_xml_read_workbook) : No need to recalc, the
loader handles it.
* src/file.c (workbook_read) : Do a recalc and sheet_update after loading.
Wrap entire process in deep_{freeze,thaw}.
* src/expr.c (eval_expr) : Fix thinko.
* src/functions/fn-string.c : Add func 'expression' to return text of
......
......@@ -5,9 +5,8 @@ Jon:
Jody:
* Bugs fixes.
* Improve doc generation.
* Update the status area (autoexpr, editor, format tools) when things
* change.
* Correct doc generation.
* Improve update status area (autoexpr, editor, format tools)
* Rework canvas editor to behave nicely at boundaries and
span correctly.
......
2000-04-06 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (gnumeric_xml_read_workbook) : No need to recalc, the
loader handles it.
* src/file.c (workbook_read) : Do a recalc and sheet_update after loading.
Wrap entire process in deep_{freeze,thaw}.
* src/expr.c (eval_expr) : Fix thinko.
* src/functions/fn-string.c : Add func 'expression' to return text of
......
2000-04-06 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (gnumeric_xml_read_workbook) : No need to recalc, the
loader handles it.
* src/file.c (workbook_read) : Do a recalc and sheet_update after loading.
Wrap entire process in deep_{freeze,thaw}.
* src/expr.c (eval_expr) : Fix thinko.
* src/functions/fn-string.c : Add func 'expression' to return text of
......
2000-04-06 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (gnumeric_xml_read_workbook) : No need to recalc, the
loader handles it.
* src/file.c (workbook_read) : Do a recalc and sheet_update after loading.
Wrap entire process in deep_{freeze,thaw}.
* src/expr.c (eval_expr) : Fix thinko.
* src/functions/fn-string.c : Add func 'expression' to return text of
......
2000-04-06 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (gnumeric_xml_read_workbook) : No need to recalc, the
loader handles it.
* src/file.c (workbook_read) : Do a recalc and sheet_update after loading.
Wrap entire process in deep_{freeze,thaw}.
* src/expr.c (eval_expr) : Fix thinko.
* src/functions/fn-string.c : Add func 'expression' to return text of
......
2000-04-06 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (gnumeric_xml_read_workbook) : No need to recalc, the
loader handles it.
* src/file.c (workbook_read) : Do a recalc and sheet_update after loading.
Wrap entire process in deep_{freeze,thaw}.
* src/expr.c (eval_expr) : Fix thinko.
* src/functions/fn-string.c : Add func 'expression' to return text of
......
......@@ -279,7 +279,6 @@ dif_read_workbook (CommandContext *context,
workbook_attach_sheet (book, src.sheet);
g_free (name);
if (!dif_parse_sheet (&src)) {
workbook_detach_sheet (book, src.sheet, TRUE);
gnumeric_error_read
......
2000-04-06 Jody Goldberg <jgoldberg@home.com>
* ms-excel-read.c (ms_excel_read_workbook) : Move deep freeze/thaw to
a higher level.
2000-04-06 Jody Goldberg <jgoldberg@home.com>
* ms-formula-read.c (ms_excel_parse_formula) : Adjust to change in
......
......@@ -3490,8 +3490,6 @@ ms_excel_read_workbook (CommandContext *context, Workbook *workbook,
int current_sheet = 0;
char *problem_loading = NULL;
cell_deep_freeze_redraws ();
/* Find that book file */
/* Look for workbook before book so that we load the office97
* format rather than office5 when there are multiple streams. */
......@@ -4021,8 +4019,6 @@ ms_excel_read_workbook (CommandContext *context, Workbook *workbook,
}
#endif
cell_deep_thaw_redraws ();
if (wb) {
Workbook *workbook = wb->gnum_wb;
......@@ -4034,7 +4030,6 @@ ms_excel_read_workbook (CommandContext *context, Workbook *workbook,
gnumeric_error_read (context, problem_loading);
return -1;
}
workbook_recalc (workbook);
return 0;
}
......
2000-04-06 Jody Goldberg <jgoldberg@home.com>
* lotus.c (lotus_read) : Move the freeze/thaw and recalc to a higher
level.
2000-04-06 Jody Goldberg <jgoldberg@home.com>
* lotus-formula.c (lotus_parse_formula) : Adjust to changes in
......
......@@ -335,13 +335,7 @@ lotus_read (CommandContext *context, Workbook *wb, const char *filename)
return -1;
}
cell_deep_freeze_redraws ();
res = read_workbook (context, wb, f);
if (res == 0) {
workbook_recalc (wb);
cell_deep_thaw_redraws ();
}
fclose (f);
return res;
......
......@@ -360,11 +360,9 @@ text_read_workbook (CommandContext *context, Workbook *wb,
int ret;
ret = readTextWorkbook (context, wb, filename, FALSE);
if (ret == 0) {
if (ret == 0)
workbook_set_saveinfo (wb, filename,
FILE_FL_MANUAL, text_write_workbook);
workbook_recalc_all (wb);
}
return ret;
}
......
2000-04-06 Jody Goldberg <jgoldberg@home.com>
* boot.c (xbase_load) : Moved the recalc free/thaw to a higher level.
2000-03-23 Jon K Hellan <hellan@acm.org>
* boot.c (xbase_load): No longer change filename extension to
......
......@@ -161,8 +161,6 @@ xbase_load (CommandContext *context, Workbook *wb, const char *filename)
workbook_attach_sheet (wb, sheet);
workbook_set_saveinfo (wb, filename, FILE_FL_MANUAL, NULL);
cell_deep_freeze_redraws ();
field = 0;
while (field < file->fields) {
cell = sheet_cell_fetch (sheet, field, 0);
......@@ -182,9 +180,6 @@ xbase_load (CommandContext *context, Workbook *wb, const char *filename)
row++;
} while (record_seek (rec, SEEK_CUR, 1));
workbook_recalc (wb);
cell_deep_thaw_redraws ();
xbase_close (file);
return 0;
......
......@@ -255,6 +255,8 @@ workbook_read (CommandContext *context, const char *filename)
g_return_val_if_fail (filename != NULL, NULL);
cell_deep_freeze_redraws ();
if (g_file_exists (filename)) {
template = g_strdup_printf (_("Could not read file %s\n%%s"),
filename);
......@@ -268,6 +270,13 @@ workbook_read (CommandContext *context, const char *filename)
gnumeric_xml_write_workbook);
}
cell_deep_thaw_redraws ();
if (wb != NULL) {
workbook_recalc (wb);
sheet_update (wb->current_sheet);
}
return wb;
}
......
......@@ -105,6 +105,9 @@ file_open_cmd (GtkWidget *widget, Workbook *wb)
if (new_wb != NULL) {
gtk_widget_show (new_wb->toplevel);
/* If the current workbook is empty and untouched remove it
* in favour of the new book
*/
if (workbook_is_pristine (wb)) {
#ifdef ENABLE_BONOBO
bonobo_object_unref (BONOBO_OBJECT (wb));
......
......@@ -59,7 +59,7 @@ xml_arg_set (GtkArg *arg, gchar *string)
GTK_VALUE_UCHAR (*arg) = string[0];
break;
case GTK_TYPE_BOOL:
if (!strcmp (string, "TRUE"))
if (!strcmp (string, "TRUE"))
GTK_VALUE_BOOL (*arg) = TRUE;
else
GTK_VALUE_BOOL (*arg) = FALSE;
......@@ -119,7 +119,7 @@ xml_arg_get (GtkArg *arg)
return NULL;
}
/*
* Get a value for a node either carried as an attibute or as
* the content of a child.
......@@ -1128,7 +1128,7 @@ xml_write_attribute (parse_xml_context_t *ctxt, xmlNodePtr attr, GtkArg *arg)
{
xmlChar *tstr;
gchar *str;
switch (arg->type) {
case GTK_TYPE_CHAR:
case GTK_TYPE_UCHAR:
......@@ -1140,15 +1140,15 @@ xml_write_attribute (parse_xml_context_t *ctxt, xmlNodePtr attr, GtkArg *arg)
case GTK_TYPE_FLOAT:
case GTK_TYPE_DOUBLE:
case GTK_TYPE_STRING:
str = xml_arg_get (arg);
tstr = xmlEncodeEntitiesReentrant (ctxt->doc, str);
str = xml_arg_get (arg);
tstr = xmlEncodeEntitiesReentrant (ctxt->doc, str);
xmlNewChild (attr, ctxt->ns, "value", tstr);
if (tstr) {
xmlFree (tstr);
}
g_free (str);
break;
}
}
}
static xmlNodePtr
......@@ -1156,7 +1156,7 @@ xml_write_attributes (parse_xml_context_t *ctxt, guint n_args, GtkArg *args)
{
xmlNodePtr cur;
gint i;
cur = xmlNewDocNode (ctxt->doc, ctxt->ns, "Attributes", NULL);
for (i=0; i < n_args; args++, i++) {
......@@ -1170,7 +1170,7 @@ xml_write_attributes (parse_xml_context_t *ctxt, guint n_args, GtkArg *args)
if (tstr) {
xmlFree (tstr);
}
xmlNewChild (tmp, ctxt->ns, "type", tstr);
xml_set_value_int (tmp, "type", args->type);
......@@ -1198,7 +1198,7 @@ xml_read_attribute (parse_xml_context_t *ctxt, xmlNodePtr attr, GtkArg *arg)
{
xmlNodePtr val;
char *value;
switch (arg->type) {
case GTK_TYPE_CHAR:
case GTK_TYPE_UCHAR:
......@@ -1214,13 +1214,13 @@ xml_read_attribute (parse_xml_context_t *ctxt, xmlNodePtr attr, GtkArg *arg)
if (val) {
value = xmlNodeGetContent (val);
xml_arg_set (arg, value);
if (value){
xmlFree (value);
}
}
break;
}
}
}
static void
......@@ -1228,30 +1228,30 @@ xml_read_attributes (parse_xml_context_t *ctxt, xmlNodePtr tree, GList **list)
{
xmlNodePtr child, subchild;
GtkArg *arg;
g_return_if_fail (ctxt != NULL);
g_return_if_fail (tree != NULL);
g_return_if_fail (ctxt->wb != NULL);
child = tree->childs;
while (child) {
char *name = NULL;
int type = 0;
if (child->name && !strcmp (child->name, "Attribute")) {
subchild = xml_search_child (child, "name");
if (subchild) {
name = xmlNodeGetContent (subchild);
}
xml_get_value_int (child, "type", &type);
if (name && type) {
arg = gtk_arg_new (type);
arg->name = g_strdup (name);
xml_read_attribute (ctxt, child, arg);
*list = g_list_prepend (*list, arg);
}
}
......@@ -2682,7 +2682,7 @@ xml_workbook_write (parse_xml_context_t *ctxt, Workbook *wb)
child = xml_write_attributes (ctxt, n_args, args);
if (child)
xmlAddChild (cur, child);
child = xml_write_summary (ctxt, wb->summary_info);
if (child)
xmlAddChild (cur, child);
......@@ -2766,7 +2766,7 @@ xml_workbook_read (Workbook *wb, parse_xml_context_t *ctxt, xmlNodePtr tree)
xmlNodePtr child, c;
char *oldlocale;
GList *list = NULL;
if (strcmp (tree->name, "Workbook")){
fprintf (stderr,
"xml_workbook_read: invalid element type %s, 'Workbook' expected`\n",
......@@ -2835,7 +2835,7 @@ xml_workbook_read (Workbook *wb, parse_xml_context_t *ctxt, xmlNodePtr tree)
xml_free_arg_list (list);
g_list_free (list);
}
child = xml_search_child (tree, "UIData");
if (child) {
int tmp = 0;
......@@ -3028,8 +3028,7 @@ gnumeric_xml_read_workbook (CommandContext *context, Workbook *wb,
xml_workbook_read (wb, &ctxt, res->root);
workbook_set_saveinfo (wb, (char *) filename, FILE_FL_AUTO,
gnumeric_xml_write_workbook);
workbook_recalc_all (wb);
xmlFreeDoc (res);
return 0;
}
......
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