[gnumeric] Fix ODF import of styles with inherited conditional styles. [#654214]



commit 4dc924f8d97dd3bc104a4f71031c207309634276
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Fri Jul 8 14:04:37 2011 -0600

    Fix ODF import of styles with inherited conditional styles. [#654214]
    
    2011-07-08  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-read.c (oo_style): don't inherit style conditions

 NEWS                                 |    1 +
 plugins/openoffice/ChangeLog         |    4 ++++
 plugins/openoffice/openoffice-read.c |    8 ++++++--
 3 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 957c82b..9f73a74 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ Andreas:
 	* Fix keyword handling in properties dialog. [#653378]
 	* Allow document properties to be edited and added.
 	* Add an interface for conditional styles.
+	* Fix ODF import of styles with inherited conditional styles. [#654214]  
 
 Morten:
 	* Fix --with-gnome compilation:  [#652802]
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 2c15976..8de23b7 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,7 @@
+2011-07-08  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* openoffice-read.c (oo_style): don't inherit style conditions
+
 2011-06-23  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* openoffice-read.c (odf_parse_range_address_or_expr): new, extracted from
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index a771de7..5d1b949 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -3418,8 +3418,12 @@ oo_style (GsfXMLIn *xin, xmlChar const **attrs)
 		style = (parent_name != NULL)
 			? g_hash_table_lookup (state->styles.cell, parent_name)
 			: NULL;
-		state->cur_style.cells = (style != NULL)
-			? gnm_style_dup (style) : gnm_style_new ();
+		if (style != NULL)
+			state->cur_style.cells = gnm_style_dup (style);
+		else {
+			state->cur_style.cells = gnm_style_new ();
+			gnm_style_set_conditions (state->cur_style.cells, NULL);
+		}
 		gnm_style_ref (state->cur_style.cells); /* We now have 2 references */
 		state->h_align_is_valid = state->repeat_content = FALSE;
 		state->text_align = -2;



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