[goffice] graph: fix crash.



commit 2241e6a97563d37380bc2b7f287913606b71f75f
Author: Morten Welinder <terra gnome org>
Date:   Tue Jun 1 09:16:40 2010 -0400

    graph: fix crash.

 ChangeLog                |    5 +++++
 NEWS                     |    1 +
 plugins/plot_xy/gog-xy.c |   44 ++++++++++++++++++++++----------------------
 3 files changed, 28 insertions(+), 22 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0bfdd18..93b0410 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-01  Morten Welinder  <terra gnome org>
+
+	* plugins/plot_xy/gog-xy.c (gog_xy_view_render,
+	gog_xy_view_get_data_at_point): Fix crash.  #620198.
+
 2010-05-31  Morten Welinder  <terra gnome org>
 
 	* goffice/utils/go-file.c (go_url_show, go_shell_arg_to_uri)
diff --git a/NEWS b/NEWS
index 46a4a5f..c6a2477 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ goffice 0.8.6:
 
 Morten:
 	* Clean-up some win32 code.
+	* Fix point-on-graph crash.  [#620198]
 
 --------------------------------------------------------------------------
 goffice 0.8.5:
diff --git a/plugins/plot_xy/gog-xy.c b/plugins/plot_xy/gog-xy.c
index 803ac90..d66ca90 100644
--- a/plugins/plot_xy/gog-xy.c
+++ b/plugins/plot_xy/gog-xy.c
@@ -966,22 +966,22 @@ gog_xy_view_get_data_at_point (GogPlotView *view, double x, double y, GogSeries
 			} else {
 				dist = MAX (xc, yc);
 				gse = NULL;
-				if (overrides != NULL) {
-					while (GOG_SERIES_ELEMENT (overrides->data)->index > (unsigned) i)
-						overrides = g_list_previous (overrides);
-					if (GOG_SERIES_ELEMENT (overrides->data)->index == (unsigned) i) {
-						gse = GOG_SERIES_ELEMENT (overrides->data);
-						overrides = g_list_previous (overrides);
-						style = go_styled_object_get_style (GO_STYLED_OBJECT (gse));
-						if (go_style_is_marker_visible (style)) {
-							if (dist <= (go_marker_get_size (style->marker.mark) + 1) / 2) {
-								*series = GOG_SERIES (pseries);
-								goto clean_exit;
-							}
-						} else if (dist <= line_dist) {
+				while (overrides &&
+				       GOG_SERIES_ELEMENT (overrides->data)->index > (unsigned) i)
+					overrides = g_list_previous (overrides);
+				if (overrides &&
+				    GOG_SERIES_ELEMENT (overrides->data)->index == (unsigned) i) {
+					gse = GOG_SERIES_ELEMENT (overrides->data);
+					overrides = g_list_previous (overrides);
+					style = go_styled_object_get_style (GO_STYLED_OBJECT (gse));
+					if (go_style_is_marker_visible (style)) {
+						if (dist <= (go_marker_get_size (style->marker.mark) + 1) / 2) {
 							*series = GOG_SERIES (pseries);
 							goto clean_exit;
 						}
+					} else if (dist <= line_dist) {
+						*series = GOG_SERIES (pseries);
+						goto clean_exit;
 					}
 				}
 				if (gse == NULL && dist <= max_dist) {
@@ -1386,15 +1386,15 @@ gog_xy_view_render (GogView *view, GogViewAllocation const *bbox)
 				gog_renderer_push_style (view->renderer, style);
 				for (k = 0; k < num_markers[j]; k++) {
 					gse = NULL;
-					if (overrides != NULL) {
-						while (GOG_SERIES_ELEMENT (overrides->data)->index < markers[j][k].index)
-							overrides = overrides->next;
-						if (GOG_SERIES_ELEMENT (overrides->data)->index == markers[j][k].index) {
-							gse = GOG_SERIES_ELEMENT (overrides->data);
-							overrides = overrides->next;
-							style = go_styled_object_get_style (GO_STYLED_OBJECT (gse));
-							gog_renderer_push_style (view->renderer, style);
-						}
+					while (overrides &&
+					       GOG_SERIES_ELEMENT (overrides->data)->index < markers[j][k].index)
+						overrides = overrides->next;
+					if (overrides &&
+					    GOG_SERIES_ELEMENT (overrides->data)->index == markers[j][k].index) {
+						gse = GOG_SERIES_ELEMENT (overrides->data);
+						overrides = overrides->next;
+						style = go_styled_object_get_style (GO_STYLED_OBJECT (gse));
+						gog_renderer_push_style (view->renderer, style);
 					}
 					if (is_map) {
 						go_marker_set_outline_color



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