[gnumeric] we need to check unknown text before writing to xml



commit 5bd1625652c1b9fb701422b47ffe65f22f6b5274
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Fri Jun 24 12:42:36 2011 -0600

    we need to check unknown text before writing to xml
    
    2011-06-24  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* xlsx-write.c (xlsx_write_fonts): check the font names
    	just in case
    	(xlsx_write_rich_text): we definitely need to check the text

 plugins/excel/ChangeLog    |    6 ++++++
 plugins/excel/xlsx-write.c |    6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index d2b6930..990eeaf 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,11 @@
 2011-06-24  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* xlsx-write.c (xlsx_write_fonts): check the font names
+	just in case
+	(xlsx_write_rich_text): we definitely need to check the text
+
+2011-06-24  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* xlsx-write.c (xlsx_write_num_formats): the format strings
 	need to be properly encoded for xlm
 
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index c66dc5f..77b507f 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -404,7 +404,7 @@ xlsx_write_fonts (XLSXWriteState *state, GsfXMLOut *xml)
 					 gnm_style_get_font_color (style)->go_color);
 			if (gnm_style_is_element_set (style, MSTYLE_FONT_NAME)) {
 				gsf_xml_out_start_element (xml, "name");
-				gsf_xml_out_add_cstr_unchecked
+				gsf_xml_out_add_cstr
 					(xml, "val", gnm_style_get_font_name (style));
 				gsf_xml_out_end_element (xml);				
 			}
@@ -1677,7 +1677,7 @@ xlsx_write_rich_text (GsfXMLOut *xml, char const *text, PangoAttrList *attrs)
 
 	if (attrs == NULL) {
 		gsf_xml_out_start_element (xml, "t");
-		gsf_xml_out_add_cstr_unchecked (xml, NULL, text);
+		gsf_xml_out_add_cstr (xml, NULL, text);
 		gsf_xml_out_end_element (xml); /* </t> */
 		return;
 	}
@@ -1746,7 +1746,7 @@ xlsx_write_rich_text (GsfXMLOut *xml, char const *text, PangoAttrList *attrs)
 		if (start > end)
 			start = end;
 		buf = g_strndup (text + start, end - start);
-		gsf_xml_out_add_cstr_unchecked (xml, NULL, buf);
+		gsf_xml_out_add_cstr (xml, NULL, buf);
 		g_free (buf);
 		gsf_xml_out_end_element (xml); /* </t> */
 		gsf_xml_out_end_element (xml); /* </r> */



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