goffice r2075 - in trunk: . goffice/data



Author: jbrefort
Date: Thu May  8 06:56:27 2008
New Revision: 2075
URL: http://svn.gnome.org/viewvc/goffice?rev=2075&view=rev

Log:
2008-05-08  Jean Brefort  <jean brefort normalesup org>

	* goffice/data/go-data-simple.c: (go_data_matrix_val_get_value),
	(go_data_matrix_val_get_str): do not crash if called before the
	values are loaded. Patch from Hiroyuki Ikezoe, see bug #532105.



Modified:
   trunk/ChangeLog
   trunk/goffice/data/go-data-simple.c

Modified: trunk/goffice/data/go-data-simple.c
==============================================================================
--- trunk/goffice/data/go-data-simple.c	(original)
+++ trunk/goffice/data/go-data-simple.c	Thu May  8 06:56:27 2008
@@ -865,13 +865,17 @@
 static double
 go_data_matrix_val_get_value (GODataMatrix *mat, unsigned i, unsigned j)
 {
-	return mat->values[i * mat->size.columns + j];
+	GODataMatrixVal const *val = (GODataMatrixVal const *)mat;
+
+	return val->val[i * val->size.columns + j];
 }
 
 static char *
 go_data_matrix_val_get_str (GODataMatrix *mat, unsigned i, unsigned j)
 {
-	return g_strdup_printf ("%g", mat->values[i * mat->size.columns + j]);
+	GODataMatrixVal const *val = (GODataMatrixVal const *)mat;
+
+	return g_strdup_printf ("%g", val->val[i * val->size.columns + j]);
 }
 
 static char *



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