[gnumeric] Fix writing to xlsx of fil with comments. [#652689]



commit 7363bd2bb95b58b8f858dca1c47ae9270d2d3260
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu Jun 16 13:19:10 2011 -0600

    Fix writing to xlsx of fil with comments. [#652689]
    
    2011-06-16  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* xlsx-write.c (xlsx_write__rich_text): handle NULL attribute
    	list

 NEWS                       |    1 +
 plugins/excel/ChangeLog    |    5 +++++
 plugins/excel/xlsx-write.c |   14 ++++++++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 73b2618..5eafdea 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@ Andreas
 	  completely. [#644496]
 	* Export some cell formatting to xlsx files. [#532635]
 	* Fix reading of diagonal borders from xlsx files. [#652690]
+	* Fix writing to xlsx of fil with comments. [#652689]
 
 Morten:
 	* Fix leaks in SHEET.  [#650761]
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index b3632f8..b0544c4 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,10 @@
 2011-06-16  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* xlsx-write.c (xlsx_write__rich_text): handle NULL attribute 
+	list
+
+2011-06-16  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* xlsx-write.c (xlsx_write_border): write diagonal border element
 	(xlsx_write_borders): support diagonal elements
 	* xlsx-read.c (xlsx_col_border_begin): new
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index 45075ee..3060d11 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -1655,10 +1655,20 @@ xlsx_write_print_info (XLSXWriteState *state, GsfXMLOut *xml)
 static void
 xlsx_write_rich_text (GsfXMLOut *xml, char const *text, PangoAttrList *attrs)
 {
-	PangoAttrIterator *iter =  pango_attr_list_get_iterator (attrs);
+	PangoAttrIterator *iter;
 	PangoAttribute *attr;
-	int start, end, max = strlen (text);
+	int start, end, max;
 	char *buf;
+
+	if (attrs == NULL) {
+		gsf_xml_out_start_element (xml, "t");
+		gsf_xml_out_add_cstr_unchecked (xml, NULL, text);
+		gsf_xml_out_end_element (xml); /* </t> */
+		return;
+	}
+
+	max = strlen (text);
+	iter = pango_attr_list_get_iterator (attrs);
 	do {
 		gsf_xml_out_start_element (xml, "r");
 		gsf_xml_out_start_element (xml, "rPr");



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