[gnumeric] Fix some style import from ODF. [#652492]



commit 212a38ca8c5cf32e189ef66f9f7b27e27b126897
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Sat Jun 18 10:41:59 2011 -0600

    Fix some style import from ODF. [#652492]
    
    2011-06-18  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-read.c (oo_cell_start): for merged cells extent any
    	style set by the row or column. Fixes [#652492]

 NEWS                                 |    3 +++
 plugins/openoffice/ChangeLog         |    5 +++++
 plugins/openoffice/openoffice-read.c |   10 ++++++++++
 3 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index 1e9c1d0..9457e14 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 Gnumeric 1.10.17
 
+Andreas:
+	* Fix some style import from ODF. [#652492]
+
 Morten:
 	* Fix --with-gnome compilation:  [#652802]
 
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 4104711..c1c5b77 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-18  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* openoffice-read.c (oo_cell_start): for merged cells extent any
+	style set by the row or column. Fixes [#652492]
+
 2011-06-16  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* openoffice-read.c (styles_dtd): add more elements
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index dc632cd..8f45843 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -2671,6 +2671,16 @@ oo_cell_start (GsfXMLIn *xin, xmlChar const **attrs)
 		gnm_style_set_validation (style, validation);
 	}
 
+	if (style == NULL && (merge_cols > 1 || merge_rows > 1)) {
+		/* We may not have a new style but the current cell may */
+		/* have been assigned a style earlier */
+		GnmStyle const *old_style 
+			= sheet_style_get (state->pos.sheet, state->pos.eval.col, 
+					   state->pos.eval.row);
+		if (old_style != NULL)
+			style = gnm_style_dup (old_style);
+	}
+
 	if (style != NULL) {
 		if (state->col_inc > 1 || state->row_inc > 1) {
 			range_init_cellpos_size (&tmp, &state->pos.eval,



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