Commit 1ece555a authored by Michael Meeks's avatar Michael Meeks

Heath Martin's comment load/save fix.

parent 1dcc1b0f
1999-06-30 Heath Martin <martinh@pegasus.cc.ucf.edu>
* src/cell.[c,h]: (cell_get_comment) New function.
* src/xml-io.c: (xml_write_cell) Save comments.
(xml_read_cell) Load comments.
1999-06-30 Michael Meeks <michael@edenproject.org>
* TODO: Moved some bits to plugins/excel.
......
1999-06-30 Heath Martin <martinh@pegasus.cc.ucf.edu>
* src/cell.[c,h]: (cell_get_comment) New function.
* src/xml-io.c: (xml_write_cell) Save comments.
(xml_read_cell) Load comments.
1999-06-30 Michael Meeks <michael@edenproject.org>
* TODO: Moved some bits to plugins/excel.
......
1999-06-30 Heath Martin <martinh@pegasus.cc.ucf.edu>
* src/cell.[c,h]: (cell_get_comment) New function.
* src/xml-io.c: (xml_write_cell) Save comments.
(xml_read_cell) Load comments.
1999-06-30 Michael Meeks <michael@edenproject.org>
* TODO: Moved some bits to plugins/excel.
......
1999-06-30 Heath Martin <martinh@pegasus.cc.ucf.edu>
* src/cell.[c,h]: (cell_get_comment) New function.
* src/xml-io.c: (xml_write_cell) Save comments.
(xml_read_cell) Load comments.
1999-06-30 Michael Meeks <michael@edenproject.org>
* TODO: Moved some bits to plugins/excel.
......
......@@ -1506,3 +1506,18 @@ cell_get_content (Cell *cell)
return str;
}
char *
cell_get_comment (Cell *cell)
{
char *str;
g_return_val_if_fail (cell != NULL, NULL);
if (cell->comment)
str = g_strdup (cell->comment->comment->str);
else
str = NULL;
return str;
}
......@@ -134,6 +134,7 @@ void cell_set_comment (Cell *cell, const char *str);
void cell_comment_destroy (Cell *cell);
void cell_comment_reposition (Cell *cell);
void cell_set_font_from_style (Cell *cell, StyleFont *style_font);
char *cell_get_comment (Cell *cell);
void cell_set_foreground (Cell *cell, gushort red,
gushort green, gushort blue);
void cell_set_background (Cell *cell, gushort red,
......
......@@ -1055,6 +1055,14 @@ xml_write_cell (parse_xml_context_t *ctxt, Cell *cell)
xmlEncodeEntities(ctxt->doc, text));
g_free (text);
text = cell_get_comment(cell);
if (text) {
xmlNewChild(cur, ctxt->ns, "Comment",
xmlEncodeEntities(ctxt->doc, text));
g_free(text);
}
return cur;
}
......@@ -1069,6 +1077,7 @@ xml_read_cell (parse_xml_context_t *ctxt, xmlNodePtr tree)
xmlNodePtr childs;
int row = 0, col = 0;
char *content = NULL;
char *comment = NULL;
gboolean style_read = FALSE;
int style_idx;
......@@ -1132,6 +1141,13 @@ xml_read_cell (parse_xml_context_t *ctxt, xmlNodePtr tree)
}
if (!strcmp (childs->name, "Content"))
content = xmlNodeGetContent(childs);
if (!strcmp (childs->name, "Comment")) {
comment = xmlNodeGetContent(childs);
if (comment) {
cell_set_comment(ret, comment);
free(comment);
}
}
childs = childs->next;
}
......
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