Commit b3035e58 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

.gnumeric support for persisting grid colour.

* .gnumeric support for persisting grid colour.

2007-12-13  Jody Goldberg <jody@gnome.org>

	* src/xml-io.c (xml_sheet_read) : support grid colour.
	* src/xml-sax-read.c (xml_sax_sheet_start) : ditto.
	(xml_sax_sheet_name) : ditto.
	* src/xml-sax-write.c (xml_write_sheet) : ditto.
	* gnumeric.xsd : ditto.

svn path=/trunk/; revision=16239
parent 93ad8173
......@@ -77,7 +77,6 @@ Worries
- operand.xls
- pivot-edited.xls : odd colours in the 'the range that contains' box
- hidding col/row headers should not hide outline symbols
- xml persistence of grid colour
- store and persist view modes
- fix bogosity of 'ant' cursors being in sheet_view and having the app contact them.
......
2007-12-13 Jody Goldberg <jody@gnome.org>
* src/xml-io.c (xml_sheet_read) : support grid colour.
* src/xml-sax-read.c (xml_sax_sheet_start) : ditto.
(xml_sax_sheet_name) : ditto.
* src/xml-sax-write.c (xml_write_sheet) : ditto.
* gnumeric.xsd : ditto.
2007-12-13 Jody Goldberg <jody@gnome.org>
* src/sheet-object-cell-comment.c (comment_view_set_bounds) : remove
......
......@@ -9,6 +9,7 @@ Jean:
Jody:
* Fix cell comments in presence on merged cells. [#503392]
* Support enter_moves_dir == NONE. [#500718]
* .gnumeric support for persisting grid colour.
Morten:
* Fix a handful of rich-text editing bugs. [#470089]
......
......@@ -210,6 +210,7 @@
<xs:attribute name="Protected" type="xs:boolean" use="optional" default="false"/>
<xs:attribute name="TabColor" type="gnm:color" use="optional"/>
<xs:attribute name="TabTextColor" type="gnm:color" use="optional"/>
<xs:attribute name="GridColor" type="gnm:color" use="optional"/>
<xs:attribute name="ExprConvention" type="gnm:ExprConvention" use="optional" default="gnumeric:A1"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
......
......@@ -1905,6 +1905,7 @@ xml_sheet_read (XmlParseContext *ctxt, xmlNodePtr tree)
gboolean tmp;
xmlChar *val;
int tmpi;
GnmColor *c;
if (strcmp (tree->name, "Sheet")){
g_printerr ("xml_sheet_read: invalid element type %s, 'Sheet' expected\n",
......@@ -1961,6 +1962,8 @@ xml_sheet_read (XmlParseContext *ctxt, xmlNodePtr tree)
g_object_set (sheet, "visibility", tmpi, NULL);
sheet->tab_color = xml_node_get_color (tree, "TabColor");
sheet->tab_text_color = xml_node_get_color (tree, "TabTextColor");
if (NULL != (c = xml_node_get_color (tree, "GridColor")))
sheet_style_set_auto_pattern_color (sheet, c);
xml_node_get_double (e_xml_get_child_by_name (tree, CC2XML ("Zoom")), NULL,
&zoom_factor);
......
......@@ -316,6 +316,7 @@ typedef struct {
GnmSheetVisibility visibility;
GnmColor *tab_color;
GnmColor *tab_text_color;
GnmColor *grid_color;
/* expressions with ref > 1 a map from index -> expr pointer */
GHashTable *expr_map;
......@@ -565,6 +566,7 @@ xml_sax_sheet_start (GsfXMLIn *xin, xmlChar const **attrs)
state->visibility = GNM_SHEET_VISIBILITY_VISIBLE;
state->tab_color = NULL;
state->tab_text_color = NULL;
state->grid_color = NULL;
state->sheet_zoom = 1.; /* default */
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
......@@ -596,6 +598,8 @@ xml_sax_sheet_start (GsfXMLIn *xin, xmlChar const **attrs)
state->tab_color = color;
else if (xml_sax_attr_color (attrs, "TabTextColor", &color))
state->tab_text_color = color;
else if (xml_sax_attr_color (attrs, "GridColor", &color))
state->grid_color = color;
else
unknown_attr (xin, attrs);
}
......@@ -672,6 +676,8 @@ xml_sax_sheet_name (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
g_object_set (sheet, "visibility", state->visibility, NULL);
sheet->tab_color = state->tab_color;
sheet->tab_text_color = state->tab_text_color;
if (state->grid_color)
sheet_style_set_auto_pattern_color (sheet, state->grid_color);
}
static void
......
......@@ -1100,6 +1100,8 @@ xml_write_objects (GnmOutputXML *state, GSList *objects)
static void
xml_write_sheet (GnmOutputXML *state, Sheet const *sheet)
{
GnmColor *c;
state->sheet = sheet;
gsf_xml_out_start_element (state->output, GNM "Sheet");
......@@ -1138,6 +1140,10 @@ xml_write_sheet (GnmOutputXML *state, Sheet const *sheet)
gnm_xml_out_add_color (state->output, "TabColor", sheet->tab_color);
if (sheet->tab_text_color != NULL)
gnm_xml_out_add_color (state->output, "TabTextColor", sheet->tab_text_color);
if (NULL != (c = sheet_style_get_auto_pattern_color (sheet))) {
gnm_xml_out_add_color (state->output, "GridColor", c);
style_color_unref (c);
}
gsf_xml_out_simple_element (state->output,
GNM "Name", sheet->name_unquoted);
......
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