[goffice] fixed style issues



commit deefac6c0ab99daed9f1c87d88cd7e72b897a78a
Author: Jean Brefort <jean brefort normalesup org>
Date:   Thu Sep 24 13:03:36 2009 +0200

    fixed style issues

 ChangeLog                      |    9 +++++++++
 goffice/canvas/goc-circle.c    |    4 +++-
 goffice/canvas/goc-ellipse.c   |    4 +++-
 goffice/canvas/goc-polygon.c   |    4 +++-
 goffice/canvas/goc-rectangle.c |    4 +++-
 goffice/utils/go-style.c       |    4 ----
 6 files changed, 21 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ca3d158..fd64fe3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-09-24  Jean Brefort  <jean brefort normalesup org>
+
+	* goffice/canvas/goc-circle.c (goc_circle_init_style): crrectly set
+	background and forground.
+	* goffice/canvas/goc-ellipse.c (goc_ellipse_init_style): ditto.
+	* goffice/canvas/goc-polygon.c (goc_polygon_init_style): ditto.
+	* goffice/canvas/goc-rectangle.c (goc_rectangle_init_style): ditto.
+	* goffice/utils/go-style.c (go_style_assign): don't ref an image twice.
+
 2009-09-20  Jean Brefort  <jean brefort normalesup org>
 
 	* goffice/canvas/goc-text.c (goc_text_draw): purge cairo path.
diff --git a/goffice/canvas/goc-circle.c b/goffice/canvas/goc-circle.c
index 44de3df..89ce16c 100644
--- a/goffice/canvas/goc-circle.c
+++ b/goffice/canvas/goc-circle.c
@@ -144,7 +144,9 @@ goc_circle_init_style (G_GNUC_UNUSED GocStyledItem *item, GOStyle *style)
 	if (style->fill.auto_type)
 		style->fill.type  = GO_STYLE_FILL_PATTERN;
 	if (style->fill.auto_fore)
-		go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
+		style->fill.pattern.fore = GO_COLOR_BLACK;
+	if (style->fill.auto_back)
+		style->fill.pattern.back = GO_COLOR_WHITE;
 }
 
 static void
diff --git a/goffice/canvas/goc-ellipse.c b/goffice/canvas/goc-ellipse.c
index dabac50..976e15d 100644
--- a/goffice/canvas/goc-ellipse.c
+++ b/goffice/canvas/goc-ellipse.c
@@ -197,7 +197,9 @@ goc_ellipse_init_style (G_GNUC_UNUSED GocStyledItem *item, GOStyle *style)
 	if (style->fill.auto_type)
 		style->fill.type  = GO_STYLE_FILL_PATTERN;
 	if (style->fill.auto_fore)
-		go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
+		style->fill.pattern.fore = GO_COLOR_BLACK;
+	if (style->fill.auto_back)
+		style->fill.pattern.back = GO_COLOR_WHITE;
 }
 
 static void
diff --git a/goffice/canvas/goc-polygon.c b/goffice/canvas/goc-polygon.c
index 0784ee7..a7c5eef 100644
--- a/goffice/canvas/goc-polygon.c
+++ b/goffice/canvas/goc-polygon.c
@@ -219,7 +219,9 @@ goc_polygon_init_style (G_GNUC_UNUSED GocStyledItem *item, GOStyle *style)
 	if (style->fill.auto_type)
 		style->fill.type  = GO_STYLE_FILL_PATTERN;
 	if (style->fill.auto_fore)
-		go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
+		style->fill.pattern.fore = GO_COLOR_BLACK;
+	if (style->fill.auto_back)
+		style->fill.pattern.back = GO_COLOR_WHITE;
 }
 
 static void
diff --git a/goffice/canvas/goc-rectangle.c b/goffice/canvas/goc-rectangle.c
index 8e34ff3..cadbc02 100644
--- a/goffice/canvas/goc-rectangle.c
+++ b/goffice/canvas/goc-rectangle.c
@@ -178,7 +178,9 @@ goc_rectangle_init_style (G_GNUC_UNUSED GocStyledItem *item, GOStyle *style)
 	if (style->fill.auto_type)
 		style->fill.type  = GO_STYLE_FILL_PATTERN;
 	if (style->fill.auto_fore)
-		go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
+		style->fill.pattern.fore = GO_COLOR_BLACK;
+	if (style->fill.auto_back)
+		style->fill.pattern.back = GO_COLOR_WHITE;
 }
 
 static void
diff --git a/goffice/utils/go-style.c b/goffice/utils/go-style.c
index 8b31f87..0b1bfe0 100644
--- a/goffice/utils/go-style.c
+++ b/goffice/utils/go-style.c
@@ -1052,10 +1052,6 @@ go_style_assign (GOStyle *dst, GOStyle const *src)
 
 	g_return_if_fail (GO_IS_STYLE (src));
 	g_return_if_fail (GO_IS_STYLE (dst));
-
-	if (GO_STYLE_FILL_IMAGE == src->fill.type &&
-	    src->fill.image.image != NULL)
-		g_object_ref (src->fill.image.image);
 	if (GO_STYLE_FILL_IMAGE == dst->fill.type) {
 		if (dst->fill.image.image != NULL)
 			g_object_unref (dst->fill.image.image);



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