[gnumeric: 1/3] fix html export



commit ede2a751e3c6c8c65a063ae72eb69ff19bba178c
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Wed May 13 14:40:08 2009 -0600

    fix html export
    
    2009-05-13  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* html.c (html_write_cell_content): remember that not
    	every string has markup
---
 plugins/html/ChangeLog |    5 +++++
 plugins/html/html.c    |   12 ++++++------
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/plugins/html/ChangeLog b/plugins/html/ChangeLog
index 6c9794c..04ce1b9 100644
--- a/plugins/html/ChangeLog
+++ b/plugins/html/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-13  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* html.c (html_write_cell_content): remember that not 
+	every string has markup
+	
 2009-05-12  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* html.c (cb_html_add_chars): new
diff --git a/plugins/html/html.c b/plugins/html/html.c
index 8c73bf1..2ffadc9 100644
--- a/plugins/html/html.c
+++ b/plugins/html/html.c
@@ -278,21 +278,21 @@ html_write_cell_content (GsfOutput *output, GnmCell *cell, GnmStyle const *style
 			gsf_output_printf (output, "<a href=\"%s\">", hlink_target);
 
 		if (cell != NULL) {
+			const PangoAttrList * markup = NULL;
+
 			if (style != NULL && version != HTML40) {
 				html_get_text_color (cell, style, &r, &g, &b);
 				if (r > 0 || g > 0 || b > 0)
 					gsf_output_printf (output, "<font color=\"#%02X%02X%02X\">", r, g, b);
 			}
 
-			if (cell->value->type == VALUE_STRING) {
+			if ((cell->value->type == VALUE_STRING) && (VALUE_FMT (cell->value) != NULL))
+				markup = go_format_get_markup (VALUE_FMT (cell->value));
+			
+			if (markup != NULL) {
 				GString *str = g_string_new ("");
-				const PangoAttrList * markup;
-				
 				value_get_as_gstring (cell->value, str, NULL);
-				markup = go_format_get_markup (VALUE_FMT (cell->value));
-				
 				html_new_markup (output, markup, str->str, version);
-				
 				g_string_free (str, TRUE);
 			} else {
 				rendered_string = gnm_cell_get_rendered_text (cell);



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