Commit f0770524 authored by Wayne Schuller's avatar Wayne Schuller Committed by Jody Goldberg

New canvas based header and footer preview widget. The customize

2001-10-21  Wayne Schuller <k_wayne@linuxpower.org>

	* dialog-printer-setup.c : New canvas based header and footer preview
	  widget. The customize header/footer widget now also uses a
	  GnomePropertyBox for UI consistency.
	* print.glade : Updated.
	* hf-config.glade : Updated.

2001-10-25  Jody Goldberg <jgoldberg@home.com>

	* src/ranges.c (range_trim) : decrease lobotomization factor.

2001-10-23  Jody Goldberg <jgoldberg@home.com>

	* src/expr-name.c (named_expr_new) : renamed from add_real, simplified
	  interface.
	(expr_name_add) : take and store a parse position.
	(expr_name_create) : ditto.
	(expr_name_destroy) : adjust to stored parsepos.
	(expr_name_unlink) : ditto.
	(expr_name_sheet2wb) : ditto.
	(expr_name_init) : ditto.
	(expr_name_as_string) : renamed from expr_name_value.
	(expr_name_eval) : renamed from eval_expr_name.

	s/eval_expr/expr_eval/

	* src/expr.c (do_expr_tree_to_string) : Use value_as_string in most
	  places.
	* src/value-sheet.c (value_cellrange_get_as_string) : delete bogus
	  useless arg.
	(encode_cellref) : delete redundant.

	* src/parse-util.c (cellref_name) : ICK!  XL wraps relative references
	  that are out of bounds.
parent a84d7bb4
......@@ -9,10 +9,7 @@ Release Critical
----------------
http://bugzilla.gnome.org/show_bug.cgi?id=62284 freeze vs delete col/row
http://bugzilla.gnome.org/show_bug.cgi?id=62649 counta recalc (replicate?)
http://bugzilla.gnome.org/show_bug.cgi?id=62004 rand paste (replicate?)
- check printing of objects in hidden regions.
- Add an idle handler at start up to check for availablity of
evo and guppi. They should only be enabled if they are available.
- config check for xml-i18n-tool version (or should it be
......
2001-10-25 Jody Goldberg <jgoldberg@home.com>
* src/ranges.c (range_trim) : decrease lobotomization factor.
2001-10-23 Jody Goldberg <jgoldberg@home.com>
* src/expr-name.c (named_expr_new) : renamed from add_real, simplified
interface.
(expr_name_add) : take and store a parse position.
(expr_name_create) : ditto.
(expr_name_destroy) : adjust to stored parsepos.
(expr_name_unlink) : ditto.
(expr_name_sheet2wb) : ditto.
(expr_name_init) : ditto.
(expr_name_as_string) : renamed from expr_name_value.
(expr_name_eval) : renamed from eval_expr_name.
s/eval_expr/expr_eval/
* src/expr.c (do_expr_tree_to_string) : Use value_as_string in most
places.
* src/value-sheet.c (value_cellrange_get_as_string) : delete bogus
useless arg.
(encode_cellref) : delete redundant.
* src/parse-util.c (cellref_name) : ICK! XL wraps relative references
that are out of bounds.
2001-10-23 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/ranges.c/h (global_range_parse) : remove `strict' argument
......@@ -10,7 +38,6 @@
to range_list_parse but calling global_range_parse rather than
range_parse (for analysis tools)
2001-10-23 Almer S. Tigelaar <almer@gnome.org>
* src/mstyle.c (mstyle_get_validation_msg): Fix this for
......
......@@ -13,11 +13,16 @@ Jody:
* LOG is valid with base > 0 && base != 1
* Clean out some unused code.
* Fix redo of unmerge to handle redraw spans.
* Improve Name Support.
Morten:
* Improve goal seek.
* Fixed parsing of numbers is scientific context.
Wayne Schuller:
* Much improved header/footer preview canvas.
* Improve UI for customizing print header/footer.
--------------------------------------------------------------------------
Gnumeric 0.72
......
2001-10-25 Jody Goldberg <jgoldberg@home.com>
* src/ranges.c (range_trim) : decrease lobotomization factor.
2001-10-23 Jody Goldberg <jgoldberg@home.com>
* src/expr-name.c (named_expr_new) : renamed from add_real, simplified
interface.
(expr_name_add) : take and store a parse position.
(expr_name_create) : ditto.
(expr_name_destroy) : adjust to stored parsepos.
(expr_name_unlink) : ditto.
(expr_name_sheet2wb) : ditto.
(expr_name_init) : ditto.
(expr_name_as_string) : renamed from expr_name_value.
(expr_name_eval) : renamed from eval_expr_name.
s/eval_expr/expr_eval/
* src/expr.c (do_expr_tree_to_string) : Use value_as_string in most
places.
* src/value-sheet.c (value_cellrange_get_as_string) : delete bogus
useless arg.
(encode_cellref) : delete redundant.
* src/parse-util.c (cellref_name) : ICK! XL wraps relative references
that are out of bounds.
2001-10-23 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/ranges.c/h (global_range_parse) : remove `strict' argument
......@@ -10,7 +38,6 @@
to range_list_parse but calling global_range_parse rather than
range_parse (for analysis tools)
2001-10-23 Almer S. Tigelaar <almer@gnome.org>
* src/mstyle.c (mstyle_get_validation_msg): Fix this for
......
2001-10-25 Jody Goldberg <jgoldberg@home.com>
* src/ranges.c (range_trim) : decrease lobotomization factor.
2001-10-23 Jody Goldberg <jgoldberg@home.com>
* src/expr-name.c (named_expr_new) : renamed from add_real, simplified
interface.
(expr_name_add) : take and store a parse position.
(expr_name_create) : ditto.
(expr_name_destroy) : adjust to stored parsepos.
(expr_name_unlink) : ditto.
(expr_name_sheet2wb) : ditto.
(expr_name_init) : ditto.
(expr_name_as_string) : renamed from expr_name_value.
(expr_name_eval) : renamed from eval_expr_name.
s/eval_expr/expr_eval/
* src/expr.c (do_expr_tree_to_string) : Use value_as_string in most
places.
* src/value-sheet.c (value_cellrange_get_as_string) : delete bogus
useless arg.
(encode_cellref) : delete redundant.
* src/parse-util.c (cellref_name) : ICK! XL wraps relative references
that are out of bounds.
2001-10-23 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/ranges.c/h (global_range_parse) : remove `strict' argument
......@@ -10,7 +38,6 @@
to range_list_parse but calling global_range_parse rather than
range_parse (for analysis tools)
2001-10-23 Almer S. Tigelaar <almer@gnome.org>
* src/mstyle.c (mstyle_get_validation_msg): Fix this for
......
2001-10-25 Jody Goldberg <jgoldberg@home.com>
* src/ranges.c (range_trim) : decrease lobotomization factor.
2001-10-23 Jody Goldberg <jgoldberg@home.com>
* src/expr-name.c (named_expr_new) : renamed from add_real, simplified
interface.
(expr_name_add) : take and store a parse position.
(expr_name_create) : ditto.
(expr_name_destroy) : adjust to stored parsepos.
(expr_name_unlink) : ditto.
(expr_name_sheet2wb) : ditto.
(expr_name_init) : ditto.
(expr_name_as_string) : renamed from expr_name_value.
(expr_name_eval) : renamed from eval_expr_name.
s/eval_expr/expr_eval/
* src/expr.c (do_expr_tree_to_string) : Use value_as_string in most
places.
* src/value-sheet.c (value_cellrange_get_as_string) : delete bogus
useless arg.
(encode_cellref) : delete redundant.
* src/parse-util.c (cellref_name) : ICK! XL wraps relative references
that are out of bounds.
2001-10-23 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/ranges.c/h (global_range_parse) : remove `strict' argument
......@@ -10,7 +38,6 @@
to range_list_parse but calling global_range_parse rather than
range_parse (for analysis tools)
2001-10-23 Almer S. Tigelaar <almer@gnome.org>
* src/mstyle.c (mstyle_get_validation_msg): Fix this for
......
......@@ -37,8 +37,8 @@ Optionally:
gb == 0.0.19 (Gnome Basic for macros)
gda >= 0.2.11 (GDA plugin, for accessing databases)
guile >= 1.5 ("Soon" to be releated Guile version)
guppi == CVS module guppi3
evolution == CVS
guppi >= 0.40.0 (corresponds to 0.72)
evolution >= beta3
Notes regarding plugins
-----------------------
......@@ -193,7 +193,3 @@ documentation for these:
o Gnumeric command line debug arguments.
- dump-func-defs
- debug
- debug_excel_read
- debug_excel_formulas
- debug_excel_color
- debug_excel_chart
2001-10-23 Jody Goldberg <jgoldberg@home.com>
* ms-excel-write.c (write_rowinfo) : duplicate code.
* ms-excel-read.c (biff_name_data_get_name) : adjust to new named
expression api.
2001-10-22 Almer S. Tigelaar <almer@gnome.org>
* ms-excel-read.c (ms_excel_read_cf): Adjust for
......
......@@ -830,25 +830,23 @@ biff_name_data_get_name (ExcelSheet const *esheet, int idx)
if (bnd->type == BNDStore && bnd->v.store.data) {
ExprTree *tree = ms_excel_parse_formula (esheet,
bnd->v.store.data,
0, 0, FALSE,
bnd->v.store.len,
NULL);
bnd->v.store.data, 0, 0, FALSE,
bnd->v.store.len, NULL);
bnd->type = BNDName;
g_free (bnd->v.store.data);
if (tree) {
char *duff = "Some Error";
bnd->v.name = (bnd->sheet_index > 0)
? expr_name_add (NULL, esheet->gnum_sheet,
bnd->name, tree, &duff)
: expr_name_add (esheet->wb->gnum_wb, NULL,
bnd->name, tree, &duff);
ParsePos pp;
if (bnd->sheet_index > 0)
parse_pos_init (&pp, NULL, esheet->gnum_sheet, 0,0);
else
parse_pos_init (&pp, esheet->wb->gnum_wb, NULL, 0,0);
bnd->v.name = expr_name_add (&pp, bnd->name, tree, NULL);
if (!bnd->v.name)
printf ("Error: '%s' for name '%s'\n", duff,
bnd->name);
printf ("Error: for name '%s'\n", bnd->name);
#ifndef NO_DEBUG_EXCEL
else if (ms_excel_read_debug > 1) {
ParsePos ep;
......
......@@ -44,6 +44,7 @@
#include <workbook.h>
#include <io-context.h>
#include <expr.h>
#include <expr-name.h>
#include <gutils.h>
#include <str.h>
......@@ -3334,8 +3335,6 @@ write_rowinfo (BiffPut *bp, ExcelSheet *sheet, guint32 row, guint32 last_col)
options |= 0x10;
if (!ri->visible)
options |= 0x20;
if (!ri->visible)
options |= 0x20;
if (ri->hard_size)
options |= 0x40;
......@@ -3348,7 +3347,7 @@ write_rowinfo (BiffPut *bp, ExcelSheet *sheet, guint32 row, guint32 last_col)
pos = bp->streamPos;
MS_OLE_SET_GUINT16 (data + 0, row); /* Row number */
MS_OLE_SET_GUINT16 (data + 2, 0); /* first def. col */
MS_OLE_SET_GUINT16 (data + 4, last_col); /* last def. col */
MS_OLE_SET_GUINT16 (data + 4, last_col);/* last def. col */
MS_OLE_SET_GUINT16 (data + 6, height); /* height */
MS_OLE_SET_GUINT16 (data + 8, 0x00); /* undocumented */
MS_OLE_SET_GUINT16 (data + 10, 0x00); /* reserved */
......
......@@ -4,29 +4,26 @@
* Author:
* Michael Meeks (michael@ximian.com)
*
* (C) 1998, 1999, 2000 Michael Meeks
* (C) 1998-2001 Michael Meeks
*/
#include <fcntl.h>
#include <assert.h>
#include <stdio.h>
#include <config.h>
#include <gnome.h>
#include "boot.h"
#include "gnumeric.h"
#include "func.h"
#include "value.h"
#include "gutils.h"
#include "sheet.h"
#include "str.h"
#include "parse-util.h"
#include "ms-formula-read.h"
#include "excel.h"
#include "ms-biff.h"
#include "ms-formula-read.h"
#include "formula-types.h"
#include "boot.h"
#include <gnumeric.h>
#include <gutils.h>
#include <func.h>
#include <value.h>
#include <expr-name.h>
#include <str.h>
#include <parse-util.h>
#include <sheet.h>
#include <fcntl.h>
#include <assert.h>
#include <stdio.h>
/* #define NO_DEBUG_EXCEL */
......
......@@ -5,29 +5,26 @@
* Author:
* Michael Meeks (michael@ximian.com)
*
* (C) 1998, 1999, 2000 Michael Meeks
* (C) 1998-2001 Michael Meeks
*/
#include <fcntl.h>
#include <assert.h>
#include <stdio.h>
#include <config.h>
#include <gnome.h>
#include "boot.h"
#include "ms-formula-write.h"
#include "gnumeric.h"
#include "excel.h"
#include "ms-biff.h"
#include "formula-types.h"
#include "boot.h"
#include "gutils.h"
#include "func.h"
#include "value.h"
#include "expr-name.h"
#include "str.h"
#include "parse-util.h"
#include "excel.h"
#include "ms-biff.h"
#include "ms-formula-write.h"
#include "formula-types.h"
#include <fcntl.h>
#include <assert.h>
#include <stdio.h>
#define FORMULA_DEBUG 0
/*#define DO_IT (ms_excel_formula_debug > 0)*/
......
......@@ -43,7 +43,7 @@ get_value_class (FunctionEvalInfo *ei, ExprTree *expr)
Value *value;
enum Value_Class res;
value = eval_expr (ei->pos, expr,
value = expr_eval (expr, ei->pos,
EVAL_PERMIT_NON_SCALAR|EVAL_PERMIT_EMPTY);
if (value) {
switch (value->type) {
......@@ -440,7 +440,7 @@ gnumeric_check_for_err (FunctionEvalInfo *ei, GList *expr_node_list,
_("Argument mismatch"));
return NULL;
}
tmp = eval_expr (ei->pos, (ExprTree *) expr_node_list->data, EVAL_STRICT);
tmp = expr_eval (expr_node_list->data, ei->pos, EVAL_STRICT);
if (tmp != NULL) {
if (tmp->type == VALUE_ERROR)
......
......@@ -194,7 +194,7 @@ gnumeric_if (FunctionEvalInfo *ei, GList *expr_node_list)
_("Invalid number of arguments"));
/* Compute the if part */
value = eval_expr (ei->pos, (ExprTree *) expr_node_list->data, EVAL_STRICT);
value = expr_eval (expr_node_list->data, ei->pos, EVAL_STRICT);
if (VALUE_IS_EMPTY_OR_ERROR(value))
return value;
......@@ -219,7 +219,7 @@ gnumeric_if (FunctionEvalInfo *ei, GList *expr_node_list)
}
/* Return the result */
return eval_expr (ei->pos, expr, EVAL_PERMIT_NON_SCALAR);
return expr_eval (expr, ei->pos, EVAL_PERMIT_NON_SCALAR);
}
/***************************************************************************/
......
......@@ -15,6 +15,7 @@
#include "cell.h"
#include "str.h"
#include "sheet.h"
#include "expr-name.h"
#include <string.h>
#include <stdlib.h>
......@@ -453,7 +454,7 @@ gnumeric_choose (FunctionEvalInfo *ei, GList *l)
if (argc < 1 || !l->data)
return value_new_error (ei->pos, _("#ARG!"));
v = eval_expr (ei->pos, l->data, EVAL_STRICT);
v = expr_eval (l->data, ei->pos, EVAL_STRICT);
if (!v)
return NULL;
......@@ -469,7 +470,7 @@ gnumeric_choose (FunctionEvalInfo *ei, GList *l)
while (l){
index--;
if (!index)
return eval_expr (ei->pos, l->data, EVAL_PERMIT_NON_SCALAR);
return expr_eval (l->data, ei->pos, EVAL_PERMIT_NON_SCALAR);
l = g_list_next (l);
}
return value_new_error (ei->pos, gnumeric_err_VALUE);
......@@ -768,7 +769,7 @@ gnumeric_indirect (FunctionEvalInfo *ei, Value **args)
expr = tmp;
}
if (expr->any.oper == OPER_VAR) {
Value *res = eval_expr (ei->pos, expr, EVAL_STRICT);
Value *res = expr_eval (expr, ei->pos, EVAL_STRICT);
expr_tree_unref (expr);
return res;
} else if (expr->any.oper == OPER_CONSTANT) {
......
......@@ -2814,7 +2814,7 @@ gnumeric_subtotal (FunctionEvalInfo *ei, GList *expr_node_list)
if (tree == NULL)
return value_new_error (ei->pos, gnumeric_err_NUM);
val = eval_expr (ei->pos, tree, EVAL_STRICT);
val = expr_eval (tree, ei->pos, EVAL_STRICT);
if (!val) return NULL;
if (!VALUE_IS_NUMBER (val)) {
value_release (val);
......@@ -2909,7 +2909,7 @@ gnumeric_seriessum (FunctionEvalInfo *ei, GList *nodes)
if (tree == NULL)
return value_new_error (ei->pos, gnumeric_err_NUM);
val = eval_expr (ei->pos, tree, EVAL_STRICT);
val = expr_eval (tree, ei->pos, EVAL_STRICT);
if (!val) return NULL;
if (!VALUE_IS_NUMBER (val)) {
value_release (val);
......@@ -2925,7 +2925,7 @@ gnumeric_seriessum (FunctionEvalInfo *ei, GList *nodes)
if (tree == NULL)
return value_new_error (ei->pos, gnumeric_err_NUM);
val = eval_expr (ei->pos, tree, EVAL_STRICT);
val = expr_eval (tree, ei->pos, EVAL_STRICT);
if (!val) return NULL;
if (! VALUE_IS_NUMBER (val)) {
value_release (val);
......@@ -2944,7 +2944,7 @@ gnumeric_seriessum (FunctionEvalInfo *ei, GList *nodes)
if (tree == NULL)
return value_new_error (ei->pos, gnumeric_err_NUM);
val = eval_expr (ei->pos, tree, EVAL_STRICT);
val = expr_eval (tree, ei->pos, EVAL_STRICT);
if (!val) return NULL;
if (! VALUE_IS_NUMBER (val)) {
value_release (val);
......@@ -3272,8 +3272,8 @@ gnumeric_sumproduct (FunctionEvalInfo *ei, GList *args)
for (l = args, i = 0; l; l = l->next, i++) {
int thissizex, thissizey, x, y;
ExprTree *tree = l->data;
Value *val = eval_expr (ei->pos, tree,
ExprTree const *expr = l->data;
Value *val = expr_eval (expr, ei->pos,
EVAL_PERMIT_NON_SCALAR | EVAL_PERMIT_EMPTY);
thissizex = value_area_get_width (ei->pos, val);
......
......@@ -313,7 +313,7 @@ gnumeric_concatenate (FunctionEvalInfo *ei, GList *l)
_("Invalid number of arguments"));
s = g_string_new ("");
while (l != NULL && (v = eval_expr (ei->pos, l->data, EVAL_STRICT)) != NULL) {
while (l != NULL && (v = expr_eval (l->data, ei->pos, EVAL_STRICT)) != NULL) {
if (VALUE_IS_EMPTY_OR_ERROR (v))
goto error;
g_string_append (s, value_peek_string (v));
......
2001-10-23 Jody Goldberg <jgoldberg@home.com>
* plugin.c (generic_marshaller) : s/eval_expr/expr_eval/
2001-10-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.72
......
......@@ -112,7 +112,7 @@ generic_marshaller (FunctionEvalInfo *ei, GList *nodes)
* this can be relaxed. We do not need to require
* non emptiness, or scalarness.
*/
Value *v = eval_expr (ei->pos, l->data, EVAL_STRICT);
Value *v = expr_eval (l->data, ei->pos, EVAL_STRICT);
args = g_slist_prepend (args, value_to_gb (v));
......
2001-10-23 Jody Goldberg <jgoldberg@home.com>
* plugin.c (func_scm_apply) : s/eval_expr/expr_eval/
2001-10-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.72
......
......@@ -67,7 +67,7 @@ func_scm_apply (FunctionEvalInfo *ei, GList *expr_node_list)
return value_new_error (ei->pos, _("Invalid number of arguments"));
/* Retrieve the function name, This can be empty, but not a non scalar */
value = eval_expr (ei->pos, (ExprTree*)expr_node_list->data, EVAL_PERMIT_EMPTY);
value = expr_eval (expr_node_list->data, ei->pos, EVAL_PERMIT_EMPTY);
if (value == NULL)
return value_new_error (ei->pos, _("First argument to SCM must be a Guile expression"));
......@@ -93,7 +93,8 @@ func_scm_apply (FunctionEvalInfo *ei, GList *expr_node_list)
eval_cell.sheet = NULL;
/* Evaluate each argument, non scalar is ok, but empty is not */
value = eval_expr (ei->pos, (ExprTree*)g_list_nth(expr_node_list, i)->data,
value = expr_eval (g_list_nth(expr_node_list, i)->data,
ei->pos,
EVAL_PERMIT_NON_SCALAR);
if (value == NULL)
return value_new_error (ei->pos, _("Could not evaluate argument"));
......
2001-10-23 Jody Goldberg <jgoldberg@home.com>
* python-loader.c (call_python_function_nodes) :
s/eval_expr/expr_eval/
2001-10-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.72
......
......@@ -543,7 +543,7 @@ call_python_function_nodes (FunctionEvalInfo *ei, GList *expr_tree_list)
n_args = g_list_length (expr_tree_list);
values = g_new (Value *, n_args);
for (i = 0, l = expr_tree_list; l != NULL; i++, l = l->next) {
values[i] = eval_expr (ei->pos, (ExprTree *) l->data, EVAL_PERMIT_NON_SCALAR);
values[i] = expr_eval (l->data, ei->pos, EVAL_PERMIT_NON_SCALAR);
}
ret_value = call_python_function (python_fn, ei->pos, n_args, values);
for (i = 0; i < n_args; i++) {
......
2001-10-23 Jody Goldberg <jgoldberg@home.com>
* python.c (marshal_func_nodes) : s/eval_expr/expr_eval/
2001-10-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.72
......
......@@ -702,7 +702,7 @@ marshal_func_nodes (FunctionEvalInfo *ei, GList *nodes)
/* Now, the actual arguments */
for (i = 0, l = nodes; i < argc && l; i++, l = l->next) {
ev = eval_expr (ei->pos, l->data, EVAL_PERMIT_NON_SCALAR);
ev = expr_eval (l->data, ei->pos, EVAL_PERMIT_NON_SCALAR);
/* ref is stolen from us */
PyTuple_SetItem (args, i + 1, value_to_python (ev));
value_release (ev);
......
2001-10-23 Jody Goldberg <jgoldberg@home.com>
* xml-sax-read.c (xml_sax_finish_parse_wb_names_name) : support
position for names.
(xml_sax_finish_parse_sheet_names_name) : ditto.
2001-10-23 Jody Goldberg <jgoldberg@home.com>
* xml-sax-read.c (xml_sax_attr_cellpos) : no need to pass dummy.
2001-10-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.72
......
......@@ -143,7 +143,6 @@ static gboolean
xml_sax_attr_cellpos (CHAR const * const *attrs, char const *name, CellPos *val)
{
CellPos tmp;
int dummy;
g_return_val_if_fail (attrs != NULL, FALSE);
g_return_val_if_fail (attrs[0] != NULL, FALSE);
......@@ -152,7 +151,7 @@ xml_sax_attr_cellpos (CHAR const * const *attrs, char const *name, CellPos *val)
if (strcmp (attrs[0], name))
return FALSE;
if (!parse_cell_name (attrs[1], &tmp.col, &tmp.row, TRUE, &dummy)) {
if (!parse_cell_name (attrs[1], &tmp.col, &tmp.row, TRUE, NULL)) {
g_warning ("Invalid attribute '%s', expected cellpos, received '%s'",
name, attrs[1]);
return FALSE;
......@@ -239,6 +238,7 @@ STATE_WB,
STATE_NAMES_NAME,
STATE_NAMES_NAME_NAME,
STATE_NAMES_NAME_VALUE,
STATE_NAMES_NAME_POSITION,
STATE_WB_GEOMETRY,
STATE_WB_SHEETS,
STATE_SHEET,
......@@ -250,6 +250,7 @@ STATE_WB,
STATE_SHEET_NAMES_NAME,
STATE_SHEET_NAMES_NAME_NAME,
STATE_SHEET_NAMES_NAME_VALUE,
STATE_SHEET_NAMES_NAME_POSITION,
STATE_SHEET_PRINTINFO,
STATE_PRINT_MARGINS,
STATE_PRINT_MARGIN_TOP,
......@@ -334,6 +335,7 @@ static char const * const xmlSax_state_names[] =
"gmr:Name",
"gmr:name",
"gmr:value",
"gmr:position",
"gmr:Geometry",
"gmr:Sheets",
"gmr:Sheet",
......@@ -345,6 +347,7 @@ static char const * const xmlSax_state_names[] =
"gmr:Name",
"gmr:name",
"gmr:value",
"gmr:position",
"gmr:PrintInformation",
"gmr:Margins",
"gmr:top",
......@@ -446,6 +449,7 @@ typedef struct _XMLSaxParseState
struct {
char *name;
char *value;
char *position;
} name;
gboolean style_range_init;
......@@ -1387,8 +1391,17 @@ xml_sax_finish_parse_wb_names_name (XMLSaxParseState *state)
if (state->version >= GNUM_XML_V7) {
ParseError perr;
ParsePos pos;
if (!expr_name_create (state->wb, NULL, state->name.name,
parse_pos_init (&pos, NULL, state->sheet, 0, 0);
if (state->name.position) {
CellRef tmp;
if (cellref_a1_get (&tmp, state->name.position, &pos.eval)) {
pos.eval.col = tmp.col;
pos.eval.row = tmp.row;
}
}
if (!expr_name_create (&pos, state->name.name,
state->name.value, &perr))
g_warning (perr.message);
parse_error_free (&perr);
......@@ -1403,25 +1416,44 @@ xml_sax_finish_parse_wb_names_name (XMLSaxParseState *state)
g_warning ("Can't process named expression '%s'. Ignoring!", state->name.name);
}
g_free (state->name.name);
if (state->name.position) {
g_free (state->name.position);
state->name.position = NULL;
}
g_free (state->name.value);
state->name.name = NULL;
state->name.value = NULL;
g_free (state->name.name);
state->name.name = NULL;
}
static void
xml_sax_finish_parse_sheet_names_name (XMLSaxParseState *state)
{
ParseError perr;
ParsePos pos;
g_return_if_fail (state->name.name != NULL);
g_return_if_fail (state->name.value != NULL);
if (!expr_name_create (NULL, state->sheet, state->name.name,
parse_pos_init (&pos, NULL, state->sheet, 0, 0);
if (state->name.position) {
CellRef tmp;
if (cellref_a1_get (&tmp, state->name.position, &pos.eval)) {
pos.eval.col = tmp.col;
pos.eval.row = tmp.row;
}
}
if (!expr_name_create (&pos, state->name.name,
state->name.value, &perr))
g_warning (perr.message);
parse_error_free (&perr);
if (state->name.position) {
g_free (state->name.position);
state->name.position = NULL;
}
g_free (state->name.name);
g_free (state->name.value);
state->name.name = NULL;
......@@ -1445,6 +1477,11 @@ xml_sax_name (XMLSaxParseState *state)
g_return_if_fail (state->name.value == NULL);
state->name.value = g_strndup (content, len);
break;
case STATE_SHEET_NAMES_NAME_POSITION:
case STATE_NAMES_NAME_POSITION:
g_return_if_fail (state->name.position == NULL);
state->name.position = g_strndup (content, len);