[gnumeric] make sure the background color white is transparent.



commit 528c403526b68c5999ec7fd10de48ebfb41610d5
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Tue May 19 02:59:52 2009 -0600

    make sure the background color white is transparent.
    
    2009-05-19  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-write.c (gnm_xml_out_add_hex_color): make our background
    	  transparent.
---
 plugins/openoffice/ChangeLog          |    5 +++++
 plugins/openoffice/openoffice-write.c |   21 ++++++++++++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index d851922..14f885c 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,10 @@
 2009-05-19  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* openoffice-write.c (gnm_xml_out_add_hex_color): make our background 
+	  transparent.
+
+2009-05-19  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* openoffice-write.c (odf_save_automatic_character_styles): we
 	  also need to save the formats associated with any empty cell
 	(odf_write_empty_cell): also write attached formatting info to empty
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 3acf8e2..3d5748a 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -438,11 +438,22 @@ gnm_xml_out_add_hex_color (GsfXMLOut *o, char const *id, GnmColor const *c)
 {
 	char *color;
 	g_return_if_fail (c != NULL);
-	
-	color = g_strdup_printf ("#%.2x%.2x%.2x", 
-				 c->gdk_color.red/256, c->gdk_color.green/256, c->gdk_color.blue/256);
-	gsf_xml_out_add_cstr_unchecked (o, id, color);
-	g_free (color);
+
+/* FIXME! there should be a difference between white and transparent */
+
+	if ((UINT_RGBA_A (c->go_color) == 0) &&
+	    c->gdk_color.red/256 == 0xFF &&
+	    c->gdk_color.green/256 == 0xFF &&
+	    c->gdk_color.blue/256 == 0xFF)
+		gsf_xml_out_add_cstr_unchecked (o, id, "transparent");
+	else {
+		color = g_strdup_printf ("#%.2x%.2x%.2x", 
+					 c->gdk_color.red/256, 
+					 c->gdk_color.green/256, 
+					 c->gdk_color.blue/256);
+		gsf_xml_out_add_cstr_unchecked (o, id, color);
+		g_free (color);
+	}
 }
 
 static char *



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