[goffice] Fixed go_direction_get_name.



commit dc969b5f2044fad4a8d419cddaea6c019e0a27fa
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sun Apr 17 13:12:15 2011 +0200

    Fixed go_direction_get_name.

 goffice/utils/go-geometry.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/goffice/utils/go-geometry.c b/goffice/utils/go-geometry.c
index 1b75982..280011b 100644
--- a/goffice/utils/go-geometry.c
+++ b/goffice/utils/go-geometry.c
@@ -314,6 +314,10 @@ go_direction_get_type (void)
 char const *
 go_direction_get_name (GODirection d)
 {
+	unsigned i;
 	g_return_val_if_fail (d < G_N_ELEMENTS (directions), NULL);
-	return _(directions[d].value_nick);
+	for (i = 0; i < G_N_ELEMENTS (directions); i++)
+		if (d == (GODirection) directions[i].value)
+			return _(directions[i].value_nick);
+	return NULL;
 }



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