[gnumeric] xml: further cleanups.



commit c701373934141dc75603d73acd3b966a5588cfb0
Author: Morten Welinder <terra gnome org>
Date:   Mon Sep 21 20:01:07 2009 -0400

    xml: further cleanups.

 src/format-template.c |   75 -------------------------------------------------
 src/xml-io.c          |   13 +--------
 src/xml-io.h          |    3 --
 3 files changed, 1 insertions(+), 90 deletions(-)
---
diff --git a/src/format-template.c b/src/format-template.c
index 2740a01..5d19753 100644
--- a/src/format-template.c
+++ b/src/format-template.c
@@ -502,81 +502,6 @@ format_template_new_from_file (char const *filename, GOCmdContext *cc)
 	return ft;
 }
 
-#if 0
-static xmlNode *
-format_colrow_info_write_xml (FormatColRowInfo const *info,
-			      xmlNode *parent, xmlChar const *type,
-			      G_GNUC_UNUSED XmlParseContext *ctxt)
-{
-	xmlNode *tmp, *container;
-
-	container = xmlNewChild (parent, parent->ns, type, NULL);
-	tmp = xmlNewChild (container, container->ns, CC2XML ("Placement"), NULL);
-	go_xml_node_set_int (tmp, "offset", info->offset);
-	go_xml_node_set_int (tmp, "offset_gravity", info->offset_gravity);
-
-	tmp = xmlNewChild (container, container->ns, CC2XML ("Dimensions"), NULL);
-	go_xml_node_set_int (tmp, "size", info->size);
-
-	return container;
-}
-
-/*
- * Create an XML subtree of doc equivalent to the given TemplateMember
- */
-static xmlNodePtr
-xml_write_format_template_member (XmlParseContext *ctxt, TemplateMember *member)
-{
-	xmlNode *tmp, *member_node;
-
-	member_node = xmlNewDocNode (ctxt->doc, ctxt->ns, CC2XML ("Member"), NULL);
-	if (member_node == NULL)
-		return NULL;
-
-	format_colrow_info_write_xml (&member->col, member_node, "Col", ctxt);
-	format_colrow_info_write_xml (&member->row, member_node, "Row", ctxt);
-
-	tmp = xmlNewChild (member_node, member_node->ns, CC2XML ("Frequency") , NULL);
-	go_xml_node_set_int (tmp, "direction", member->direction);
-	go_xml_node_set_int (tmp, "repeat", member->repeat);
-	go_xml_node_set_int (tmp, "skip", member->skip);
-	go_xml_node_set_int (tmp, "edge", member->edge);
-
-	xmlAddChild (member_node, xml_write_style (ctxt, member->mstyle));
-
-	return member_node;
-}
-
-static xmlNodePtr
-xml_write_format_template_members (XmlParseContext *ctxt, GnmFormatTemplate const *ft)
-{
-	xmlNode *root, *child;
-	xmlNs   *ns;
-	GSList  *member;
-
-	root = xmlNewDocNode (ctxt->doc, NULL, CC2XML ("FormatTemplate"), NULL);
-	if (root == NULL)
-		return NULL;
-
-	ns = xmlNewNs (root,
-		       CC2XML ("http://www.gnome.org/gnumeric/format-template/v1";),
-		       CC2XML ("gmr"));
-	xmlSetNs (root, ns);
-	ctxt->ns = ns;
-
-	child = xmlNewChild (root, ns, CC2XML ("Information"), NULL);
-	go_xml_node_set_cstr (child, "author", ft->author);
-	go_xml_node_set_cstr (child, "name", ft->name);
-	go_xml_node_set_cstr (child, "description", ft->description);
-
-	child = xmlNewChild (root, ns, CC2XML ("Members"), NULL);
-	for (member = ft->members ; member != NULL ; member = member->next)
-		xmlAddChild (child,
-			xml_write_format_template_member (ctxt, member->data));
-
-	return root;
-}
-#endif
 
 /**
  * format_template_attach_member:
diff --git a/src/xml-io.c b/src/xml-io.c
index 30a4736..48e0e8f 100644
--- a/src/xml-io.c
+++ b/src/xml-io.c
@@ -173,7 +173,7 @@ xml_node_get_value (xmlNodePtr node, char const *name)
 	return value;
 }
 
-GnmColor *
+static GnmColor *
 xml_node_get_color (xmlNodePtr node, char const *name)
 {
 	GnmColor *res = NULL;
@@ -189,17 +189,6 @@ xml_node_get_color (xmlNodePtr node, char const *name)
 	return res;
 }
 
-void
-xml_node_set_color (xmlNodePtr node, char const *name, GnmColor const *val)
-{
-	GdkColor tmp;
-	char str[4 * sizeof (tmp)];
-
-	go_color_to_gdk (val->go_color, &tmp);
-	sprintf (str, "%X:%X:%X", tmp.red, tmp.green, tmp.blue);
-	go_xml_node_set_cstr (node, name, str);
-}
-
 static gboolean
 xml_node_get_cellpos (xmlNodePtr node, char const *name,
 		      GnmCellPos *val, Sheet const *sheet)
diff --git a/src/xml-io.h b/src/xml-io.h
index 8c03f14..3795c5b 100644
--- a/src/xml-io.h
+++ b/src/xml-io.h
@@ -42,9 +42,6 @@ void		 xml_parse_ctx_destroy (XmlParseContext *ctxt);
 GnmCellRegion *xml_cellregion_read  (WorkbookControl *context, Sheet *sheet,
 				     const char *buffer, int length);
 
-GnmColor  *xml_node_get_color	(xmlNodePtr node, char const *name);
-void       xml_node_set_color	(xmlNodePtr node, char const *name, GnmColor const *color);
-
 GnmStyle      *xml_read_style     (XmlParseContext *ctxt, xmlNodePtr tree,
 				   gboolean leave_empty);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]