[gnumeric] GnmSOLine: used boxed type for arrows.



commit 5dddd55f99aaee4542857fa1768bb860592823e5
Author: Morten Welinder <terra gnome org>
Date:   Wed Oct 14 13:20:29 2009 -0400

    GnmSOLine: used boxed type for arrows.

 plugins/excel/ms-excel-read.c |    8 ++------
 src/gnm-so-line.c             |   18 ++++++++++--------
 2 files changed, 12 insertions(+), 14 deletions(-)
---
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index 68073cd..7f4883d 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -444,21 +444,17 @@ handle_arrow_head (SheetObject *so, const char *prop_name,
 		   MSObjAttrBag *attrs, MSObjAttrID typid)
 {
 	GOArrow arrow;
-	gpointer parrow;
 	GOColor col = GO_COLOR_BLACK;
 
 	int typ = ms_obj_attr_get_int (attrs, typid, 0);
-
-	g_object_get (so, prop_name, &parrow, NULL);
-	arrow = *((GOArrow*)parrow);
-
 	switch (typ) {
 	case 0:
 		go_arrow_clear (&arrow);
 		break;
 	default:
 	case 1:
-		go_arrow_init (&arrow, GO_ARROW_TRIANGLE, col, 8., 10., 3.);
+		go_arrow_init (&arrow, GO_ARROW_TRIANGLE, col,
+			       8., 10., 3.);
 		break;
 	}
 
diff --git a/src/gnm-so-line.c b/src/gnm-so-line.c
index 05c2ac4..b9c89e7 100644
--- a/src/gnm-so-line.c
+++ b/src/gnm-so-line.c
@@ -325,10 +325,10 @@ gnm_so_line_set_property (GObject *obj, guint param_id,
 		break;
 	}
 	case SOL_PROP_START_ARROW:
-		sol->start_arrow = *((GOArrow *)g_value_get_pointer (value));
+		sol->start_arrow = *((GOArrow *)g_value_peek_pointer (value));
 		break;
 	case SOL_PROP_END_ARROW:
-		sol->end_arrow = *((GOArrow* )g_value_get_pointer (value));
+		sol->end_arrow = *((GOArrow* )g_value_peek_pointer (value));
 		break;
 	case SOL_PROP_IS_ARROW:
 		if (g_value_get_boolean (value))
@@ -355,10 +355,10 @@ gnm_so_line_get_property (GObject *obj, guint param_id,
 		g_value_set_object (value, sol->style);
 		break;
 	case SOL_PROP_START_ARROW:
-		g_value_set_pointer (value, &sol->start_arrow);
+		g_value_set_boxed (value, &sol->start_arrow);
 		break;
 	case SOL_PROP_END_ARROW:
-		g_value_set_pointer (value, &sol->end_arrow);
+		g_value_set_boxed (value, &sol->end_arrow);
 		break;
 	case SOL_PROP_IS_ARROW:
 		g_value_set_boolean (value, sol->end_arrow.c > 0);
@@ -404,11 +404,13 @@ gnm_so_line_class_init (GObjectClass *gobject_class)
                  g_param_spec_object ("style", NULL, NULL, GO_TYPE_STYLE,
 			GSF_PARAM_STATIC | G_PARAM_READWRITE));
         g_object_class_install_property (gobject_class, SOL_PROP_START_ARROW,
-                 g_param_spec_pointer ("start-arrow", NULL, NULL,
-			GSF_PARAM_STATIC | G_PARAM_READWRITE));
+                 g_param_spec_boxed ("start-arrow", NULL, NULL,
+				     GO_ARROW_TYPE,
+				     GSF_PARAM_STATIC | G_PARAM_READWRITE));
         g_object_class_install_property (gobject_class, SOL_PROP_END_ARROW,
-                 g_param_spec_pointer ("end-arrow", NULL, NULL,
-			GSF_PARAM_STATIC | G_PARAM_READWRITE));
+                 g_param_spec_boxed ("end-arrow", NULL, NULL,
+				     GO_ARROW_TYPE,
+				     GSF_PARAM_STATIC | G_PARAM_READWRITE));
         g_object_class_install_property (gobject_class, SOL_PROP_IS_ARROW,
                  g_param_spec_boolean ("is-arrow", NULL, NULL, FALSE,
 			GSF_PARAM_STATIC | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));



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