[goffice] Fixed a limit issue in histograms



commit 18f53493e5a9929b16f848f8caac4edb55520edc
Author: Jean Brefort <jean brefort normalesup org>
Date:   Wed Nov 10 17:57:54 2010 +0100

    Fixed a limit issue in histograms

 ChangeLog                            |    6 ++++++
 plugins/plot_distrib/gog-histogram.c |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 03097cd..e29d489 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
 2010-11-10  Jean Brefort  <jean brefort normalesup org>
 
 	* plugins/plot_distrib/gog-histogram.c
+	(gog_histogram_plot_series_update): fixed a limit issue.
+	* tests/go-demo.c (insert_histogram_data): don't use raw data.
+
+2010-11-10  Jean Brefort  <jean brefort normalesup org>
+
+	* plugins/plot_distrib/gog-histogram.c
 	(gog_histogram_plot_series_update): fixed memory errors.
 	* plugins/plot_surface/gog-contour.c
 	(gog_contour_plot_foreach_elem): ditto.
diff --git a/plugins/plot_distrib/gog-histogram.c b/plugins/plot_distrib/gog-histogram.c
index b03775d..9a38c82 100644
--- a/plugins/plot_distrib/gog-histogram.c
+++ b/plugins/plot_distrib/gog-histogram.c
@@ -1012,6 +1012,8 @@ gog_histogram_plot_series_update (GogObject *obj)
 				if (go_finite (y[i])) {
 					while (max < x_len - 1 && y[i] > series->real_x[max])
 						max++;
+					if (y[i] >  series->real_x[max])
+						break;
 					series->real_y[max-1]++;
 			}
 			if (y__len > 0) {



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