[gnumeric] GOArrow: further cleanups.



commit a17a4229a2e4cb6560292cec3949b55260cb8611
Author: Morten Welinder <terra gnome org>
Date:   Wed Oct 14 12:06:08 2009 -0400

    GOArrow: further cleanups.

 plugins/excel/ms-excel-read.c |    2 +-
 src/gnm-so-line.c             |   22 +++++++---------------
 2 files changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index 4bf1ee2..68073cd 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -454,7 +454,7 @@ handle_arrow_head (SheetObject *so, const char *prop_name,
 
 	switch (typ) {
 	case 0:
-		go_arrow_init (&arrow, GO_ARROW_NONE, col, 0, 0, 0);
+		go_arrow_clear (&arrow);
 		break;
 	default:
 	case 1:
diff --git a/src/gnm-so-line.c b/src/gnm-so-line.c
index a55aa00..05c2ac4 100644
--- a/src/gnm-so-line.c
+++ b/src/gnm-so-line.c
@@ -44,13 +44,6 @@ attr_eq (const xmlChar *a, const char *s)
 
 /*****************************************************************************/
 
-static void
-go_arrow_copy (GOArrow *dst, GOArrow const *src)
-{
-	*dst = *src;
-}
-
-/*****************************************************************************/
 typedef struct {
 	SheetObject base;
 
@@ -314,8 +307,8 @@ gnm_so_line_copy (SheetObject *dst, SheetObject const *src)
 
 	g_object_unref (new_sol->style);
 	new_sol->style = go_style_dup (sol->style);
-	go_arrow_copy (&new_sol->start_arrow, &sol->start_arrow);
-	go_arrow_copy (&new_sol->end_arrow, &sol->end_arrow);
+	new_sol->start_arrow = sol->start_arrow;
+	new_sol->end_arrow = sol->end_arrow;
 }
 
 static void
@@ -332,10 +325,10 @@ gnm_so_line_set_property (GObject *obj, guint param_id,
 		break;
 	}
 	case SOL_PROP_START_ARROW:
-		go_arrow_copy (&sol->start_arrow, g_value_get_pointer (value));
+		sol->start_arrow = *((GOArrow *)g_value_get_pointer (value));
 		break;
 	case SOL_PROP_END_ARROW:
-		go_arrow_copy (&sol->end_arrow, g_value_get_pointer (value));
+		sol->end_arrow = *((GOArrow* )g_value_get_pointer (value));
 		break;
 	case SOL_PROP_IS_ARROW:
 		if (g_value_get_boolean (value))
@@ -343,9 +336,7 @@ gnm_so_line_set_property (GObject *obj, guint param_id,
 				       GO_ARROW_TRIANGLE, GO_COLOR_BLACK,
 				       8., 10., 3.);
 		else
-			go_arrow_init (&sol->end_arrow,
-				       GO_ARROW_NONE, GO_COLOR_BLACK,
-				       0., 0., 0.);
+			go_arrow_clear (&sol->end_arrow);
 		break;
 
 	default:
@@ -428,7 +419,8 @@ gnm_so_line_init (GObject *obj)
 {
 	GnmSOLine *sol  = GNM_SO_LINE (obj);
 	sol->style = sol_default_style ();
-
+	go_arrow_clear (&sol->start_arrow);
+	go_arrow_clear (&sol->end_arrow);
 	SHEET_OBJECT (obj)->anchor.base.direction = GOD_ANCHOR_DIR_NONE_MASK;
 }
 



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