[gnumeric] Handle coloured text formatting during ODF import.



commit 2f1220679a83aa021a24af0694acc228499edd7e
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu Apr 26 14:21:30 2012 -0600

    Handle coloured text formatting during ODF import.
    
    2012-04-26  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-read.c (od_style_prop_text): handle colours

 NEWS                                 |    3 +++
 plugins/openoffice/ChangeLog         |    4 ++++
 plugins/openoffice/openoffice-read.c |   21 +++++++++++++++++----
 3 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/NEWS b/NEWS
index fcdeddb..ce65403 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 Gnumeric 1.11.4
 
+Andreas:
+	* Handle coloured text formatting during ODF import.
+
 --------------------------------------------------------------------------
 Gnumeric 1.11.3
 
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index e8e3b2a..fc3640a 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,9 @@
 2012-04-26  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* openoffice-read.c (od_style_prop_text): handle colours
+
+2012-04-26  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* openoffice-write.c (odf_write_character_styles): also write AC-weight1000"
 	* openoffice-read.c (oo_text_p_t): new
 	(OOParseState): new fields
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 8afe6e4..803dcc2 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -6567,6 +6567,7 @@ od_style_prop_text (GsfXMLIn *xin, xmlChar const **attrs)
 	int underline_type = 0;
 	int underline_style = 0;
 	gboolean underline_bold = FALSE;
+	GnmColor *color;
 
 	g_return_if_fail (state->cur_style.text != NULL);
 	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
@@ -6608,10 +6609,22 @@ od_style_prop_text (GsfXMLIn *xin, xmlChar const **attrs)
 			underline_bold = attr_eq (attrs[1], "bold");
 		else if (oo_attr_enum (xin, attrs, OO_NS_STYLE, "text-line-through-style",
 				       line_through_styles, &tmp)) {
-				attr = pango_attr_strikethrough_new (tmp > 0);
-				attr->start_index = 0;
-				attr->end_index = 0;
-				pango_attr_list_insert (state->cur_style.text, attr);
+			attr = pango_attr_strikethrough_new (tmp > 0);
+			attr->start_index = 0;
+			attr->end_index = 0;
+			pango_attr_list_insert (state->cur_style.text, attr);
+		} else if ((color = oo_attr_color (xin, attrs, OO_NS_FO, "color"))) {
+			attr = go_color_to_pango (color->go_color, TRUE);
+			style_color_unref (color);
+			attr->start_index = 0;
+			attr->end_index = 0;
+			pango_attr_list_insert (state->cur_style.text, attr);			
+		} else if ((color = oo_attr_color (xin, attrs, OO_NS_FO, "background-color"))) {
+			attr = go_color_to_pango (color->go_color, FALSE);
+			style_color_unref (color);
+			attr->start_index = 0;
+			attr->end_index = 0;
+			pango_attr_list_insert (state->cur_style.text, attr);
 		}
 
 	if (underline_style > 0) {



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