Commit ad6b6064 authored by Jody Goldberg's avatar Jody Goldberg

Tweak the xml routines to support content as well as attributes

parent 5526045b
2001-08-28 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_sheet_read) : no need to load the max col/row.
That is really only useful for external parsers. We handle it
internally.
2001-08-28 Morten Welinder <terra@diku.dk> 2001-08-28 Morten Welinder <terra@diku.dk>
* src/workbook.h (struct _Workbook): point to first dependent * src/workbook.h (struct _Workbook): point to first dependent
...@@ -31,21 +37,21 @@ ...@@ -31,21 +37,21 @@
* idl/gnumeric-graphs.idl (importSpecification) : new routine. * idl/gnumeric-graphs.idl (importSpecification) : new routine.
* src/xml-io.c : clean up. * src/xml-io.c : clean up.
s/xml_get_value_int/xml_prop_get_int/ s/xml_get_value_int/xml_node_get_int/
s/xml_set_value_int/xml_prop_set_int/ s/xml_set_value_int/xml_node_set_int/
s/xml_get_value_double/xml_prop_get_double/ s/xml_get_value_double/xml_node_get_double/
s/xml_set_value_double/xml_prop_set_double/ s/xml_set_value_double/xml_node_set_double/
s/xml_set_value_points/xml_prop_set_points/ s/xml_set_value_points/xml_node_set_points/
s/xml_set_value_cstr/xml_prop_set_cstr/ s/xml_set_value_cstr/xml_node_set_cstr/
s/xml_set_prop_cellpos/xml_prop_set_cellpos/ s/xml_set_prop_cellpos/xml_node_set_cellpos/
s/xml_get_prop_cellpos/xml_prop_get_cellpos/ s/xml_get_prop_cellpos/xml_node_get_cellpos/
s/xml_read_range/xml_prop_get_range/ s/xml_read_range/xml_node_get_range/
s/xml_get_print_hf/xml_prop_get_print_hf/ s/xml_get_print_hf/xml_node_get_print_hf/
s/xml_set_print_hf/xml_prop_set_print_hf/ s/xml_set_print_hf/xml_node_set_print_hf/
s/xml_set_color_value/xml_prop_set_color/ s/xml_set_color_value/xml_node_set_color/
s/xml_get_color_value/xml_prop_get_color/ s/xml_get_color_value/xml_node_get_color/
s/xml_set_value_color/xml_prop_set_gdkcolor/ s/xml_set_value_color/xml_node_set_gdkcolor/
s/xml_get_value_color/xml_prop_get_gdkcolor/ s/xml_get_value_color/xml_node_get_gdkcolor/
Remove the pointless searching of children for content. Remove the pointless searching of children for content.
We never relied on those semantics, nor do we want them. We never relied on those semantics, nor do we want them.
...@@ -53,7 +59,7 @@ ...@@ -53,7 +59,7 @@
(xml_sheet_create) : Use xmlGetProp directly. (xml_sheet_create) : Use xmlGetProp directly.
(xml_sheet_read) : ditto. (xml_sheet_read) : ditto.
(xml_read_solver) : ditto. (xml_read_solver) : ditto.
(xml_write_solver) : use xml_prop_set_cstr. (xml_write_solver) : use xml_node_set_cstr.
(xml_write_print_info) : Use xmlNewChild. (xml_write_print_info) : Use xmlNewChild.
(xml_value_get) : delete and use xmlGetProp directly. (xml_value_get) : delete and use xmlGetProp directly.
......
2001-08-28 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_sheet_read) : no need to load the max col/row.
That is really only useful for external parsers. We handle it
internally.
2001-08-28 Morten Welinder <terra@diku.dk> 2001-08-28 Morten Welinder <terra@diku.dk>
* src/workbook.h (struct _Workbook): point to first dependent * src/workbook.h (struct _Workbook): point to first dependent
...@@ -31,21 +37,21 @@ ...@@ -31,21 +37,21 @@
* idl/gnumeric-graphs.idl (importSpecification) : new routine. * idl/gnumeric-graphs.idl (importSpecification) : new routine.
* src/xml-io.c : clean up. * src/xml-io.c : clean up.
s/xml_get_value_int/xml_prop_get_int/ s/xml_get_value_int/xml_node_get_int/
s/xml_set_value_int/xml_prop_set_int/ s/xml_set_value_int/xml_node_set_int/
s/xml_get_value_double/xml_prop_get_double/ s/xml_get_value_double/xml_node_get_double/
s/xml_set_value_double/xml_prop_set_double/ s/xml_set_value_double/xml_node_set_double/
s/xml_set_value_points/xml_prop_set_points/ s/xml_set_value_points/xml_node_set_points/
s/xml_set_value_cstr/xml_prop_set_cstr/ s/xml_set_value_cstr/xml_node_set_cstr/
s/xml_set_prop_cellpos/xml_prop_set_cellpos/ s/xml_set_prop_cellpos/xml_node_set_cellpos/
s/xml_get_prop_cellpos/xml_prop_get_cellpos/ s/xml_get_prop_cellpos/xml_node_get_cellpos/
s/xml_read_range/xml_prop_get_range/ s/xml_read_range/xml_node_get_range/
s/xml_get_print_hf/xml_prop_get_print_hf/ s/xml_get_print_hf/xml_node_get_print_hf/
s/xml_set_print_hf/xml_prop_set_print_hf/ s/xml_set_print_hf/xml_node_set_print_hf/
s/xml_set_color_value/xml_prop_set_color/ s/xml_set_color_value/xml_node_set_color/
s/xml_get_color_value/xml_prop_get_color/ s/xml_get_color_value/xml_node_get_color/
s/xml_set_value_color/xml_prop_set_gdkcolor/ s/xml_set_value_color/xml_node_set_gdkcolor/
s/xml_get_value_color/xml_prop_get_gdkcolor/ s/xml_get_value_color/xml_node_get_gdkcolor/
Remove the pointless searching of children for content. Remove the pointless searching of children for content.
We never relied on those semantics, nor do we want them. We never relied on those semantics, nor do we want them.
...@@ -53,7 +59,7 @@ ...@@ -53,7 +59,7 @@
(xml_sheet_create) : Use xmlGetProp directly. (xml_sheet_create) : Use xmlGetProp directly.
(xml_sheet_read) : ditto. (xml_sheet_read) : ditto.
(xml_read_solver) : ditto. (xml_read_solver) : ditto.
(xml_write_solver) : use xml_prop_set_cstr. (xml_write_solver) : use xml_node_set_cstr.
(xml_write_print_info) : Use xmlNewChild. (xml_write_print_info) : Use xmlNewChild.
(xml_value_get) : delete and use xmlGetProp directly. (xml_value_get) : delete and use xmlGetProp directly.
......
2001-08-28 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_sheet_read) : no need to load the max col/row.
That is really only useful for external parsers. We handle it
internally.
2001-08-28 Morten Welinder <terra@diku.dk> 2001-08-28 Morten Welinder <terra@diku.dk>
* src/workbook.h (struct _Workbook): point to first dependent * src/workbook.h (struct _Workbook): point to first dependent
...@@ -31,21 +37,21 @@ ...@@ -31,21 +37,21 @@
* idl/gnumeric-graphs.idl (importSpecification) : new routine. * idl/gnumeric-graphs.idl (importSpecification) : new routine.
* src/xml-io.c : clean up. * src/xml-io.c : clean up.
s/xml_get_value_int/xml_prop_get_int/ s/xml_get_value_int/xml_node_get_int/
s/xml_set_value_int/xml_prop_set_int/ s/xml_set_value_int/xml_node_set_int/
s/xml_get_value_double/xml_prop_get_double/ s/xml_get_value_double/xml_node_get_double/
s/xml_set_value_double/xml_prop_set_double/ s/xml_set_value_double/xml_node_set_double/
s/xml_set_value_points/xml_prop_set_points/ s/xml_set_value_points/xml_node_set_points/
s/xml_set_value_cstr/xml_prop_set_cstr/ s/xml_set_value_cstr/xml_node_set_cstr/
s/xml_set_prop_cellpos/xml_prop_set_cellpos/ s/xml_set_prop_cellpos/xml_node_set_cellpos/
s/xml_get_prop_cellpos/xml_prop_get_cellpos/ s/xml_get_prop_cellpos/xml_node_get_cellpos/
s/xml_read_range/xml_prop_get_range/ s/xml_read_range/xml_node_get_range/
s/xml_get_print_hf/xml_prop_get_print_hf/ s/xml_get_print_hf/xml_node_get_print_hf/
s/xml_set_print_hf/xml_prop_set_print_hf/ s/xml_set_print_hf/xml_node_set_print_hf/
s/xml_set_color_value/xml_prop_set_color/ s/xml_set_color_value/xml_node_set_color/
s/xml_get_color_value/xml_prop_get_color/ s/xml_get_color_value/xml_node_get_color/
s/xml_set_value_color/xml_prop_set_gdkcolor/ s/xml_set_value_color/xml_node_set_gdkcolor/
s/xml_get_value_color/xml_prop_get_gdkcolor/ s/xml_get_value_color/xml_node_get_gdkcolor/
Remove the pointless searching of children for content. Remove the pointless searching of children for content.
We never relied on those semantics, nor do we want them. We never relied on those semantics, nor do we want them.
...@@ -53,7 +59,7 @@ ...@@ -53,7 +59,7 @@
(xml_sheet_create) : Use xmlGetProp directly. (xml_sheet_create) : Use xmlGetProp directly.
(xml_sheet_read) : ditto. (xml_sheet_read) : ditto.
(xml_read_solver) : ditto. (xml_read_solver) : ditto.
(xml_write_solver) : use xml_prop_set_cstr. (xml_write_solver) : use xml_node_set_cstr.
(xml_write_print_info) : Use xmlNewChild. (xml_write_print_info) : Use xmlNewChild.
(xml_value_get) : delete and use xmlGetProp directly. (xml_value_get) : delete and use xmlGetProp directly.
......
2001-08-28 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_sheet_read) : no need to load the max col/row.
That is really only useful for external parsers. We handle it
internally.
2001-08-28 Morten Welinder <terra@diku.dk> 2001-08-28 Morten Welinder <terra@diku.dk>
* src/workbook.h (struct _Workbook): point to first dependent * src/workbook.h (struct _Workbook): point to first dependent
...@@ -31,21 +37,21 @@ ...@@ -31,21 +37,21 @@
* idl/gnumeric-graphs.idl (importSpecification) : new routine. * idl/gnumeric-graphs.idl (importSpecification) : new routine.
* src/xml-io.c : clean up. * src/xml-io.c : clean up.
s/xml_get_value_int/xml_prop_get_int/ s/xml_get_value_int/xml_node_get_int/
s/xml_set_value_int/xml_prop_set_int/ s/xml_set_value_int/xml_node_set_int/
s/xml_get_value_double/xml_prop_get_double/ s/xml_get_value_double/xml_node_get_double/
s/xml_set_value_double/xml_prop_set_double/ s/xml_set_value_double/xml_node_set_double/
s/xml_set_value_points/xml_prop_set_points/ s/xml_set_value_points/xml_node_set_points/
s/xml_set_value_cstr/xml_prop_set_cstr/ s/xml_set_value_cstr/xml_node_set_cstr/
s/xml_set_prop_cellpos/xml_prop_set_cellpos/ s/xml_set_prop_cellpos/xml_node_set_cellpos/
s/xml_get_prop_cellpos/xml_prop_get_cellpos/ s/xml_get_prop_cellpos/xml_node_get_cellpos/
s/xml_read_range/xml_prop_get_range/ s/xml_read_range/xml_node_get_range/
s/xml_get_print_hf/xml_prop_get_print_hf/ s/xml_get_print_hf/xml_node_get_print_hf/
s/xml_set_print_hf/xml_prop_set_print_hf/ s/xml_set_print_hf/xml_node_set_print_hf/
s/xml_set_color_value/xml_prop_set_color/ s/xml_set_color_value/xml_node_set_color/
s/xml_get_color_value/xml_prop_get_color/ s/xml_get_color_value/xml_node_get_color/
s/xml_set_value_color/xml_prop_set_gdkcolor/ s/xml_set_value_color/xml_node_set_gdkcolor/
s/xml_get_value_color/xml_prop_get_gdkcolor/ s/xml_get_value_color/xml_node_get_gdkcolor/
Remove the pointless searching of children for content. Remove the pointless searching of children for content.
We never relied on those semantics, nor do we want them. We never relied on those semantics, nor do we want them.
...@@ -53,7 +59,7 @@ ...@@ -53,7 +59,7 @@
(xml_sheet_create) : Use xmlGetProp directly. (xml_sheet_create) : Use xmlGetProp directly.
(xml_sheet_read) : ditto. (xml_sheet_read) : ditto.
(xml_read_solver) : ditto. (xml_read_solver) : ditto.
(xml_write_solver) : use xml_prop_set_cstr. (xml_write_solver) : use xml_node_set_cstr.
(xml_write_print_info) : Use xmlNewChild. (xml_write_print_info) : Use xmlNewChild.
(xml_value_get) : delete and use xmlGetProp directly. (xml_value_get) : delete and use xmlGetProp directly.
......
...@@ -44,7 +44,7 @@ gint ms_excel_formula_debug = 0; ...@@ -44,7 +44,7 @@ gint ms_excel_formula_debug = 0;
/* Enables debugging mesgs while reading excel colors & patterns */ /* Enables debugging mesgs while reading excel colors & patterns */
gint ms_excel_color_debug = 0; gint ms_excel_color_debug = 0;
/* Enables debugging mesgs while reading excel charts */ /* Enables debugging mesgs while reading excel charts */
gint ms_excel_chart_debug = 0; gint ms_excel_chart_debug = 10;
/* Enables debugging mesgs while writing excel workbooks */ /* Enables debugging mesgs while writing excel workbooks */
gint ms_excel_write_debug = 0; gint ms_excel_write_debug = 0;
/* Enables debugging mesgs while reading excel objects */ /* Enables debugging mesgs while reading excel objects */
......
...@@ -38,12 +38,16 @@ typedef enum { ...@@ -38,12 +38,16 @@ typedef enum {
MS_VECTOR_PURPOSE_MAX = 4 MS_VECTOR_PURPOSE_MAX = 4
} MS_VECTOR_PURPOSE; } MS_VECTOR_PURPOSE;
char const *const ms_vector_purpose_type_name [] =
{
"labels", "values", "categories", "bubbles",
};
typedef struct _ExcelChartSeries typedef struct _ExcelChartSeries
{ {
struct { struct {
GnmGraphVectorType type; GnmGraphVectorType type;
int count; int count, remote_ID;
GnmGraphVector *g_vector;
} vector [MS_VECTOR_PURPOSE_MAX]; } vector [MS_VECTOR_PURPOSE_MAX];
int chart_group; int chart_group;
...@@ -101,7 +105,7 @@ excel_chart_series_new (void) ...@@ -101,7 +105,7 @@ excel_chart_series_new (void)
series->chart_group = -1; series->chart_group = -1;
for (i = MS_VECTOR_PURPOSE_MAX; i-- > 0 ; ) { for (i = MS_VECTOR_PURPOSE_MAX; i-- > 0 ; ) {
series->vector [i].g_vector = NULL; series->vector [i].remote_ID = -1;
series->vector [i].type = GNM_VECTOR_AUTO; /* may be reset later */ series->vector [i].type = GNM_VECTOR_AUTO; /* may be reset later */
} }
...@@ -244,7 +248,7 @@ BC_R(ai)(ExcelChartHandler const *handle, ...@@ -244,7 +248,7 @@ BC_R(ai)(ExcelChartHandler const *handle,
g_return_val_if_fail (purpose < MS_VECTOR_PURPOSE_MAX, TRUE); g_return_val_if_fail (purpose < MS_VECTOR_PURPOSE_MAX, TRUE);
switch (purpose) { switch (purpose) {
case MS_VECTOR_PURPOSE_LABELS : puts ("Linking title or text"); break; case MS_VECTOR_PURPOSE_LABELS : puts ("Linking labels"); break;
case MS_VECTOR_PURPOSE_VALUES : puts ("Linking values"); break; case MS_VECTOR_PURPOSE_VALUES : puts ("Linking values"); break;
case MS_VECTOR_PURPOSE_CATEGORIES : puts ("Linking categories"); break; case MS_VECTOR_PURPOSE_CATEGORIES : puts ("Linking categories"); break;
case MS_VECTOR_PURPOSE_BUBBLES : puts ("Linking bubbles"); break; case MS_VECTOR_PURPOSE_BUBBLES : puts ("Linking bubbles"); break;
...@@ -271,7 +275,7 @@ BC_R(ai)(ExcelChartHandler const *handle, ...@@ -271,7 +275,7 @@ BC_R(ai)(ExcelChartHandler const *handle,
g_return_val_if_fail (s->currentSeries != NULL, TRUE); g_return_val_if_fail (s->currentSeries != NULL, TRUE);
#ifdef ENABLE_BONOBO #ifdef ENABLE_BONOBO
s->currentSeries->vector [purpose].g_vector = s->currentSeries->vector [purpose].remote_ID =
gnm_graph_add_vector (s->graph, expr, gnm_graph_add_vector (s->graph, expr,
s->currentSeries->vector [purpose].type, s->currentSeries->vector [purpose].type,
sheet); sheet);
...@@ -2123,7 +2127,7 @@ ms_excel_chart (BiffQuery *q, MSContainer *container, MsBiffVersion ver, GtkObje ...@@ -2123,7 +2127,7 @@ ms_excel_chart (BiffQuery *q, MSContainer *container, MsBiffVersion ver, GtkObje
int const num_handler = sizeof(chart_biff_handler) / int const num_handler = sizeof(chart_biff_handler) /
sizeof(ExcelChartHandler *); sizeof(ExcelChartHandler *);
int i; int i, j;
xmlNodePtr tmp; xmlNodePtr tmp;
gboolean done = FALSE; gboolean done = FALSE;
ExcelChartReadState state; ExcelChartReadState state;
...@@ -2282,9 +2286,15 @@ ms_excel_chart (BiffQuery *q, MSContainer *container, MsBiffVersion ver, GtkObje ...@@ -2282,9 +2286,15 @@ ms_excel_chart (BiffQuery *q, MSContainer *container, MsBiffVersion ver, GtkObje
state.xml_ns, "Data", NULL); state.xml_ns, "Data", NULL);
for (i = state.series->len; i-- > 0 ; ) { for (i = state.series->len; i-- > 0 ; ) {
ExcelChartSeries *series = g_ptr_array_index (state.series, i); ExcelChartSeries *series = g_ptr_array_index (state.series, i);
xmlNodePtr s = xmlNewDocNode (state.xml_doc, state.xml_ns, "Series", NULL); xmlNodePtr s = xmlNewChild (tmp, state.xml_ns, "Series", NULL);
xml_prop_set_int (s, "ChartGroup", series->chart_group); xml_node_set_int (s, "ChartGroup", series->chart_group);
xmlAddChild (tmp, s);
for (j = MS_VECTOR_PURPOSE_MAX; j-- > 0 ; )
if (series->vector [j].remote_ID >= 0) {
xmlNodePtr v = xmlNewChild (s, state.xml_ns,
ms_vector_purpose_type_name [j], NULL);
xml_node_set_int (v, "ID", series->vector [j].remote_ID);
}
} }
#ifdef ENABLE_BONOBO #ifdef ENABLE_BONOBO
......
...@@ -637,8 +637,10 @@ gnm_graph_subscribe_vector (GnmGraph *graph, GnmGraphVector *vector) ...@@ -637,8 +637,10 @@ gnm_graph_subscribe_vector (GnmGraph *graph, GnmGraphVector *vector)
* @expr : the expression to evaluate for this vector. * @expr : the expression to evaluate for this vector.
* @type : optional, pass GNM_VECTOR_AUTO, and we will make a guess. * @type : optional, pass GNM_VECTOR_AUTO, and we will make a guess.
* @sheet : this a dependentContainer when I create it. * @sheet : this a dependentContainer when I create it.
*
* Returns the ID of the vector
*/ */
GnmGraphVector * int
gnm_graph_add_vector (GnmGraph *graph, ExprTree *expr, gnm_graph_add_vector (GnmGraph *graph, ExprTree *expr,
GnmGraphVectorType type, Sheet *sheet) GnmGraphVectorType type, Sheet *sheet)
{ {
...@@ -646,7 +648,7 @@ gnm_graph_add_vector (GnmGraph *graph, ExprTree *expr, ...@@ -646,7 +648,7 @@ gnm_graph_add_vector (GnmGraph *graph, ExprTree *expr,
EvalPos ep; EvalPos ep;
int i; int i;
g_return_val_if_fail (IS_GNUMERIC_GRAPH (graph), FALSE); g_return_val_if_fail (IS_GNUMERIC_GRAPH (graph), -1);
/* If this graph already has this vector don't duplicate it. /* If this graph already has this vector don't duplicate it.
* This is useful when importing a set of series with a common dimension. * This is useful when importing a set of series with a common dimension.
...@@ -664,7 +666,7 @@ gnm_graph_add_vector (GnmGraph *graph, ExprTree *expr, ...@@ -664,7 +666,7 @@ gnm_graph_add_vector (GnmGraph *graph, ExprTree *expr,
printf ("vector::ref (%d) @ 0x%p = %s\n", vector->type, vector, expr_str); printf ("vector::ref (%d) @ 0x%p = %s\n", vector->type, vector, expr_str);
g_free (expr_str); g_free (expr_str);
#endif #endif
return vector; return vector->id;
} }
} }
...@@ -712,7 +714,7 @@ gnm_graph_add_vector (GnmGraph *graph, ExprTree *expr, ...@@ -712,7 +714,7 @@ gnm_graph_add_vector (GnmGraph *graph, ExprTree *expr,
} }
#endif #endif
return vector; return vector->id;
} }
static char * static char *
......
...@@ -24,7 +24,7 @@ void gnm_graph_clear_vectors (GnmGraph *graph); ...@@ -24,7 +24,7 @@ void gnm_graph_clear_vectors (GnmGraph *graph);
void gnm_graph_arrange_vectors (GnmGraph *graph); void gnm_graph_arrange_vectors (GnmGraph *graph);
void gnm_graph_import_specification (GnmGraph *graph, void gnm_graph_import_specification (GnmGraph *graph,
xmlDocPtr spec); xmlDocPtr spec);
GnmGraphVector *gnm_graph_add_vector (GnmGraph *graph, int gnm_graph_add_vector (GnmGraph *graph,
ExprTree *expr, ExprTree *expr,
GnmGraphVectorType type, GnmGraphVectorType type,
Sheet *sheet); Sheet *sheet);
......
...@@ -203,8 +203,8 @@ cell_comment_write_xml (SheetObject const *so, ...@@ -203,8 +203,8 @@ cell_comment_write_xml (SheetObject const *so,
XmlParseContext const *ctxt, xmlNodePtr tree) XmlParseContext const *ctxt, xmlNodePtr tree)
{ {
CellComment const *cc = CELL_COMMENT (so); CellComment const *cc = CELL_COMMENT (so);
xml_prop_set_cstr (tree, "Author", cc->author); xml_node_set_cstr (tree, "Author", cc->author);
xml_prop_set_cstr (tree, "Text", cc->text); xml_node_set_cstr (tree, "Text", cc->text);
return FALSE; return FALSE;
} }
......
...@@ -177,18 +177,18 @@ sheet_object_graphic_read_xml (SheetObject *so, ...@@ -177,18 +177,18 @@ sheet_object_graphic_read_xml (SheetObject *so,
g_return_val_if_fail (IS_SHEET_OBJECT_GRAPHIC (so), TRUE); g_return_val_if_fail (IS_SHEET_OBJECT_GRAPHIC (so), TRUE);
sog = SHEET_OBJECT_GRAPHIC (so); sog = SHEET_OBJECT_GRAPHIC (so);
color = xml_prop_get_gdkcolor (tree, "FillColor"); color = xml_node_get_gdkcolor (tree, "FillColor");
sheet_object_graphic_fill_color_set (sog, color); sheet_object_graphic_fill_color_set (sog, color);
if (xml_prop_get_int (tree, "Type", &tmp)) if (xml_node_get_int (tree, "Type", &tmp))
sog->type = tmp; sog->type = tmp;
xml_prop_get_double (tree, "Width", &width); xml_node_get_double (tree, "Width", &width);
sheet_object_graphic_width_set (sog, width); sheet_object_graphic_width_set (sog, width);
if (xml_prop_get_double (tree, "ArrowShapeA", &a) && if (xml_node_get_double (tree, "ArrowShapeA", &a) &&
xml_prop_get_double (tree, "ArrowShapeB", &b) && xml_node_get_double (tree, "ArrowShapeB", &b) &&
xml_prop_get_double (tree, "ArrowShapeC", &c)) xml_node_get_double (tree, "ArrowShapeC", &c))
sheet_object_graphic_abc_set (sog, a, b, c); sheet_object_graphic_abc_set (sog, a, b, c);
return FALSE; return FALSE;
...@@ -203,14 +203,14 @@ sheet_object_graphic_write_xml (SheetObject const *so, ...@@ -203,14 +203,14 @@ sheet_object_graphic_write_xml (SheetObject const *so,
g_return_val_if_fail (IS_SHEET_OBJECT_GRAPHIC (so), TRUE); g_return_val_if_fail (IS_SHEET_OBJECT_GRAPHIC (so), TRUE);
sog = SHEET_OBJECT_GRAPHIC (so); sog = SHEET_OBJECT_GRAPHIC (so);
xml_prop_set_gdkcolor (tree, "FillColor", sog->fill_color); xml_node_set_gdkcolor (tree, "FillColor", sog->fill_color);
xml_prop_set_int (tree, "Type", sog->type); xml_node_set_int (tree, "Type", sog->type);
xml_prop_set_double (tree, "Width", sog->width, -1); xml_node_set_double (tree, "Width", sog->width, -1);
if (sog->type == SHEET_OBJECT_ARROW) { if (sog->type == SHEET_OBJECT_ARROW) {
xml_prop_set_double (tree, "ArrowShapeA", sog->a, -1); xml_node_set_double (tree, "ArrowShapeA", sog->a, -1);
xml_prop_set_double (tree, "ArrowShapeB", sog->b, -1); xml_node_set_double (tree, "ArrowShapeB", sog->b, -1);
xml_prop_set_double (tree, "ArrowShapeC", sog->c, -1); xml_node_set_double (tree, "ArrowShapeC", sog->c, -1);
} }
return FALSE; return FALSE;
...@@ -706,7 +706,7 @@ sheet_object_filled_read_xml (SheetObject *so, ...@@ -706,7 +706,7 @@ sheet_object_filled_read_xml (SheetObject *so,
g_return_val_if_fail (IS_SHEET_OBJECT_FILLED (so), TRUE); g_return_val_if_fail (IS_SHEET_OBJECT_FILLED (so), TRUE);
sof = SHEET_OBJECT_FILLED (so); sof = SHEET_OBJECT_FILLED (so);
color = xml_prop_get_gdkcolor (tree, "OutlineColor"); color = xml_node_get_gdkcolor (tree, "OutlineColor");
sheet_object_filled_outline_color_set (sof, color); sheet_object_filled_outline_color_set (sof, color);
return sheet_object_graphic_read_xml (so, ctxt, tree); return sheet_object_graphic_read_xml (so, ctxt, tree);
...@@ -721,7 +721,7 @@ sheet_object_filled_write_xml (SheetObject const *so, ...@@ -721,7 +721,7 @@ sheet_object_filled_write_xml (SheetObject const *so,
g_return_val_if_fail (IS_SHEET_OBJECT_FILLED (so), TRUE); g_return_val_if_fail (IS_SHEET_OBJECT_FILLED (so), TRUE);
sof = SHEET_OBJECT_FILLED (so); sof = SHEET_OBJECT_FILLED (so);
xml_prop_set_gdkcolor (tree, "OutlineColor", sof->outline_color); xml_node_set_gdkcolor (tree, "OutlineColor", sof->outline_color);
return sheet_object_graphic_write_xml (so, ctxt, tree); return sheet_object_graphic_write_xml (so, ctxt, tree);
} }
......
...@@ -252,7 +252,7 @@ sheet_widget_label_write_xml (SheetObject const *so, ...@@ -252,7 +252,7 @@ sheet_widget_label_write_xml (SheetObject const *so,
{ {
SheetWidgetLabel *swl = SHEET_WIDGET_LABEL (so); SheetWidgetLabel *swl = SHEET_WIDGET_LABEL (so);
xml_prop_set_cstr (tree, "Label", swl->label); xml_node_set_cstr (tree, "Label", swl->label);
return FALSE; return FALSE;
} }
...@@ -350,7 +350,7 @@ sheet_widget_frame_write_xml (SheetObject const *so, ...@@ -350,7 +350,7 @@ sheet_widget_frame_write_xml (SheetObject const *so,
{ {
SheetWidgetFrame *swf = SHEET_WIDGET_FRAME (so); SheetWidgetFrame *swf = SHEET_WIDGET_FRAME (so);
xml_prop_set_cstr (tree, "Label", swf->label); xml_node_set_cstr (tree, "Label", swf->label);
return FALSE; return FALSE;
} }
...@@ -447,7 +447,7 @@ sheet_widget_button_write_xml (SheetObject const *so, ...@@ -447,7 +447,7 @@ sheet_widget_button_write_xml (SheetObject const *so,
{ {
SheetWidgetButton *swb = SHEET_WIDGET_BUTTON (so); SheetWidgetButton *swb = SHEET_WIDGET_BUTTON (so);
xml_prop_set_cstr (tree, "Label", swb->label); xml_node_set_cstr (tree, "Label", swb->label);
return FALSE; return FALSE;
} }
...@@ -908,9 +908,9 @@ sheet_widget_checkbox_write_xml (SheetObject const *so, ...@@ -908,9 +908,9 @@ sheet_widget_checkbox_write_xml (SheetObject const *so,
pp = parse_pos_init (&pos, NULL, so->sheet, 0, 0); pp = parse_pos_init (&pos, NULL, so->sheet, 0, 0);
val = expr_tree_as_string (swc->dep.expression, pp); val = expr_tree_as_string (swc->dep.expression, pp);
xml_prop_set_cstr (tree, "Label", swc->label); xml_node_set_cstr (tree, "Label", swc->label);
xml_prop_set_int (tree, "Value", swc->value); xml_node_set_int (tree, "Value", swc->value);
xml_prop_set_cstr (tree, "Input", val); xml_node_set_cstr (tree, "Input", val);
return FALSE; return FALSE;
} }
...@@ -955,7 +955,7 @@ sheet_widget_checkbox_read_xml (SheetObject *so, ...@@ -955,7 +955,7 @@ sheet_widget_checkbox_read_xml (SheetObject *so,
swc->dep.sheet = context->sheet; swc->dep.sheet = context->sheet;
swc->dep.flags = checkbox_get_dep_type (); swc->dep.flags = checkbox_get_dep_type ();
xml_prop_get_int (tree, "Value", &swc->value); xml_node_get_int (tree, "Value", &swc->value);
return FALSE; return FALSE;
} }
......
...@@ -469,7 +469,7 @@ sheet_object_read_xml (XmlParseContext const *ctxt, xmlNodePtr tree) ...@@ -469,7 +469,7 @@ sheet_object_read_xml (XmlParseContext const *ctxt, xmlNodePtr tree)
xmlFree (tmp); xmlFree (tmp);
} }
if (xml_prop_get_int (tree, "Direction", &tmp_int)) if (xml_node_get_int (tree, "Direction", &tmp_int))
so->anchor.direction = tmp_int; so->anchor.direction = tmp_int;
else else
so->anchor.direction = SO_DIR_UNKNOWN; so->anchor.direction = SO_DIR_UNKNOWN;
...@@ -503,16 +503,16 @@ sheet_object_write_xml (SheetObject const *so, XmlParseContext const *ctxt) ...@@ -503,16 +503,16 @@ sheet_object_write_xml (SheetObject const *so, XmlParseContext const *ctxt)
return NULL; return NULL;
} }
xml_prop_set_cstr (tree, "ObjectBound", range_name (&so->anchor.cell_bound)); xml_node_set_cstr (tree, "ObjectBound", range_name (&so->anchor.cell_bound));
snprintf (buffer, sizeof (buffer), "%.*g %.*g %.*g %.*g", snprintf (buffer, sizeof (buffer), "%.*g %.*g %.*g %.*g",
DBL_DIG, so->anchor.offset [0], DBL_DIG, so->anchor.offset [1], DBL_DIG, so->anchor.offset [0], DBL_DIG, so->anchor.offset [1],
DBL_DIG, so->anchor.offset [2], DBL_DIG, so->anchor.offset [3]); DBL_DIG, so->anchor.offset [2], DBL_DIG, so->anchor.offset [3]);
xml_prop_set_cstr (tree, "ObjectOffset", buffer); xml_node_set_cstr (tree, "ObjectOffset", buffer);
snprintf (buffer, sizeof (buffer), "%d %d %d %d", snprintf (buffer, sizeof (buffer), "%d %d %d %d",
so->anchor.type [0], so->anchor.type [1], so->anchor.type [0], so->anchor.type [1],
so->anchor.type [2], so->anchor.type [3]); so->anchor.type [2], so->anchor.type [3]);
xml_prop_set_cstr (tree, "ObjectAnchorType", buffer); xml_node_set_cstr (tree, "ObjectAnchorType", buffer);
xml_prop_set_int (tree, "Direction", so->anchor.direction); xml_node_set_int (tree, "Direction", so->anchor.direction);
return tree; return tree;
} }
......
...@@ -53,15 +53,15 @@ xml_write_format_col_row_info (XmlParseContext *ctxt, FormatColRowInfo info, xml ...@@ -53,15 +53,15 @@ xml_write_format_col_row_info (XmlParseContext *ctxt, FormatColRowInfo info, xml
* Write placement * Write placement
*/ */
child = xmlNewDocNode (ctxt->doc, ctxt->ns, "Placement", NULL); child = xmlNewDocNode (ctxt->doc, ctxt->ns, "Placement", NULL);
xml_prop_set_int (child, "offset", info.offset); xml_node_set_int (child, "offset", info.offset);
xml_prop_set_int (child, "offset_gravity", info.offset_gravity); xml_node_set_int (child, "offset_gravity", info.offset_gravity);
xmlAddChild (node, child); xmlAddChild (node, child);
/* /*
* Write dimensions * Write dimensions
*/ */
child = xmlNewDocNode (ctxt->doc, ctxt->ns, "Dimensions", NULL); child = xmlNewDocNode (ctxt->doc, ctxt->ns, "Dimensions", NULL);
xml_prop_set_int (child, "size", info.size); xml_node_set_int (child, "size", info.size);
xmlAddChild (node, child); xmlAddChild (node, child);
} }
...@@ -96,10 +96,10 @@ xml_write_format_template_member (XmlParseContext *ctxt, TemplateMember *member) ...@@ -96,10 +96,10 @@ xml_write_format_template_member (XmlParseContext *ctxt, TemplateMember *member)
* Write frequency information * Write frequency information
*/ */