[gnumeric] ODF: fix solid colour fills in import



commit 0de89d1fb93dd17b74e9015dd49757ce709c0fec
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Tue Aug 31 16:54:10 2010 -0600

    ODF: fix solid colour fills in import
    
    2010-08-31  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-read.c (odf_apply_style_props): switch auto-colors off
    	* openoffice-write.c (odf_write_standard_series): increase index

 plugins/openoffice/ChangeLog          |    5 +++++
 plugins/openoffice/openoffice-read.c  |    8 +++++++-
 plugins/openoffice/openoffice-write.c |    1 +
 3 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index f8b3758..72bd306 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,10 @@
 2010-08-31  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* openoffice-read.c (odf_apply_style_props): switch auto-colors off
+	* openoffice-write.c (odf_write_standard_series): increase index
+
+2010-08-31  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* openoffice-read.c (oo_dash): new
 	(oo_parse_angle): permit absent unit
 	(odf_match_dash_type): really try to match
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 0a482e2..ee77403 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -584,18 +584,23 @@ odf_apply_style_props (GsfXMLIn *xin, GSList *props, GOStyle *style)
 			char const *val_string = g_value_get_string (&prop->value);
 			if (0 == strcmp (val_string, "solid")) {
 				style->fill.type = GO_STYLE_FILL_PATTERN;
+				style->fill.auto_type = FALSE;
 				style->fill.pattern.pattern = GO_PATTERN_SOLID;
 			} else if (0 == strcmp (val_string, "hatch")) {
 				style->fill.type = GO_STYLE_FILL_PATTERN;
+				style->fill.auto_type = FALSE;
 				has_hatch = TRUE;
 			} else {
 				style->fill.type = GO_STYLE_FILL_NONE;
+				style->fill.auto_type = FALSE;
 			}
 		} else if (0 == strcmp (prop->name, "fill-color")) {
 			GdkColor gdk_color;
 			gchar const *color = g_value_get_string (&prop->value);
-			if (gdk_color_parse (color, &gdk_color))
+			if (gdk_color_parse (color, &gdk_color)) {
 				style->fill.pattern.back = GO_COLOR_FROM_GDK (gdk_color);
+				style->fill.auto_back = FALSE;
+			}
 		} else if (0 == strcmp (prop->name, "fill-hatch-name"))
 			hatch_name = g_value_get_string (&prop->value);
 		else if (0 == strcmp (prop->name, "gnm-pattern"))
@@ -669,6 +674,7 @@ odf_apply_style_props (GsfXMLIn *xin, GSList *props, GOStyle *style)
 				oo_warning (xin, _("Unknown hatch name encountered!"));
 			else {
 				style->fill.pattern.fore = pat->fore;
+				style->fill.auto_fore = FALSE;
 				style->fill.pattern.pattern =  (gnm_hatch > 0) ? 
 					gnm_hatch : pat->pattern;
 			}
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 05af5fe..176c296 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -3903,6 +3903,7 @@ odf_write_standard_series (GnmOOExport *state, GSList const *series)
 					gsf_xml_out_end_element (state->xml); 
 					/* CHART "data-point" */
 					g_free (style);
+					next_index = index + 1;
 				}
 				g_slist_free (points);
 			}



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