[goffice] Build color from color names usung gdk_parse_color. [#601114]



commit e1b829abad77574329ac57f6a420e8227c76c873
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sun Nov 8 08:26:57 2009 +0100

    Build color from color names usung gdk_parse_color. [#601114]

 ChangeLog                |    5 +++++
 NEWS                     |    1 +
 goffice/utils/go-color.c |    9 +++++++++
 3 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index df9d7e8..a163400 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-11-08  Jean Brefort  <jean brefort normalesup org>
 
+	* goffice/utils/go-color.c (go_color_from_str): call gdk_parse_color when
+	needed. [#601114]
+
+2009-11-08  Jean Brefort  <jean brefort normalesup org>
+
 	* plugins/plot_pie/gog-pie.c (find_element), (gog_pie_view_render): make
 	points work when negative values are skipped.
 
diff --git a/NEWS b/NEWS
index eff96f7..0e7d611 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Jean:
 	* Implement error bars in radar and polar plots. [#572720]
 	* Add an option for negative values display in pies and rings. [#152614]
 	* Add trend lines to legend. [#383518]
+	* Build color from color names usung gdk_parse_color. [#601114]
 
 --------------------------------------------------------------------------
 goffice 0.7.15:
diff --git a/goffice/utils/go-color.c b/goffice/utils/go-color.c
index 378c234..16af3d2 100644
--- a/goffice/utils/go-color.c
+++ b/goffice/utils/go-color.c
@@ -41,6 +41,15 @@ go_color_from_str (gchar const *str, GOColor *res)
 		*res = GO_COLOR_FROM_RGBA (r, g, b, a);
 		return TRUE;
 	}
+#ifdef GOFFICE_WITH_GTK
+	 else {
+		GdkColor color;
+		if (gdk_color_parse (str, &color)) {
+			*res = GO_COLOR_FROM_GDK (color);
+			return TRUE;
+		}
+	}
+#endif
 	return FALSE;
 }
 



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