goffice r2316 - in trunk: . goffice/graph plugins/plot_radar



Author: jbrefort
Date: Sun Feb 22 10:10:04 2009
New Revision: 2316
URL: http://svn.gnome.org/viewvc/goffice?rev=2316&view=rev

Log:
2009-02-22  Jean Brefort  <jean brefort normalesup org>

	* goffice/graph/gog-chart-map.c: (polar_make_path): return a NULL path
	for cubic splines interpolation (should not happen).
	* goffice/graph/gog-series.c: (gog_series_populate_editor): fix radial
	axis test when populating interpolation combo box. [#572698]
	* plugins/plot_radar/gog-radar.c: (gog_rt_view_render): avoid criticals
	when a path is NULL (anyway this should not happen).



Modified:
   trunk/ChangeLog
   trunk/goffice/graph/gog-chart-map.c
   trunk/goffice/graph/gog-series.c
   trunk/plugins/plot_radar/gog-radar.c

Modified: trunk/goffice/graph/gog-chart-map.c
==============================================================================
--- trunk/goffice/graph/gog-chart-map.c	(original)
+++ trunk/goffice/graph/gog-chart-map.c	Sun Feb 22 10:10:04 2009
@@ -691,6 +691,12 @@
 		case GO_LINE_INTERPOLATION_CLOSED_SPLINE:
 			path = make_path_spline (map, x, y, n_points, TRUE, TRUE, skip_invalid);
 			break;
+		case GO_LINE_INTERPOLATION_CUBIC_SPLINE:
+		case GO_LINE_INTERPOLATION_PARABOLIC_CUBIC_SPLINE:
+		case GO_LINE_INTERPOLATION_CUBIC_CUBIC_SPLINE:
+		case GO_LINE_INTERPOLATION_CLAMPED_CUBIC_SPLINE:
+			/* Not supported in polar plots */
+			break;
 		case GO_LINE_INTERPOLATION_STEP_START:
 		case GO_LINE_INTERPOLATION_STEP_END:
 		case GO_LINE_INTERPOLATION_STEP_CENTER_X:

Modified: trunk/goffice/graph/gog-series.c
==============================================================================
--- trunk/goffice/graph/gog-series.c	(original)
+++ trunk/goffice/graph/gog-series.c	Sun Feb 22 10:10:04 2009
@@ -540,7 +540,7 @@
 			widget = glade_xml_get_widget (gui, "interpolation-table");
 			/* create an interpolation type combo and populate it */
 			combo = GTK_COMBO_BOX (gtk_combo_box_new_text ());
-			if (set & GOG_AXIS_RADIAL)
+			if (set & 1 << GOG_AXIS_RADIAL)
 				for (i = 0; i < GO_LINE_INTERPOLATION_MAX; i++) {
 					if (go_line_interpolation_supports_radial (i))
 						gtk_combo_box_append_text (combo, _(go_line_interpolation_as_label (i)));

Modified: trunk/plugins/plot_radar/gog-radar.c
==============================================================================
--- trunk/plugins/plot_radar/gog-radar.c	(original)
+++ trunk/plugins/plot_radar/gog-radar.c	Sun Feb 22 10:10:04 2009
@@ -506,45 +506,47 @@
 
 		next_path = NULL;
 
-		if (!is_polar) {
-			go_path_close (path);
-			gog_renderer_fill_serie (view->renderer, path, NULL);
-		} else {
-			if (series->base.interpolation == GO_LINE_INTERPOLATION_CLOSED_SPLINE)
-				gog_renderer_fill_serie	(view->renderer, path, NULL);
-			else if (series->base.fill_type != GOG_SERIES_FILL_TYPE_NEXT) {
-				GOPath *close_path;
-
-				close_path = gog_chart_map_make_close_path (chart_map, c_vals, r_vals,
-									    series->base.num_elements,
-									    series->base.fill_type);
-				gog_renderer_fill_serie (view->renderer, path, close_path);
-				if (close_path != NULL)
-					go_path_free (close_path);
+		if (path) {
+			if (!is_polar) {
+				go_path_close (path);
+				gog_renderer_fill_serie (view->renderer, path, NULL);
 			} else {
-				if (ptr->next != NULL) {
-					GogRTSeries *next_series;
-
-					next_series = ptr->next->data;
-					if (gog_series_is_valid (GOG_SERIES (next_series))) {
-						GogStyle *next_style;
-						const double *next_x_vals, *next_y_vals;
-						unsigned int next_n_points;
-
-						next_n_points = gog_series_get_xy_data
-							(GOG_SERIES (next_series),
-							 &next_x_vals, &next_y_vals);
-						next_style = gog_styled_object_get_style
-							(GOG_STYLED_OBJECT (next_series));
-
-						next_path = gog_chart_map_make_path
-							(chart_map, next_x_vals, next_y_vals,
-							 next_n_points, next_series->base.interpolation,
-							 series->base.interpolation_skip_invalid, NULL);
+				if (series->base.interpolation == GO_LINE_INTERPOLATION_CLOSED_SPLINE)
+					gog_renderer_fill_serie	(view->renderer, path, NULL);
+				else if (series->base.fill_type != GOG_SERIES_FILL_TYPE_NEXT) {
+					GOPath *close_path;
+
+					close_path = gog_chart_map_make_close_path (chart_map, c_vals, r_vals,
+										    series->base.num_elements,
+										    series->base.fill_type);
+					gog_renderer_fill_serie (view->renderer, path, close_path);
+					if (close_path != NULL)
+						go_path_free (close_path);
+				} else {
+					if (ptr->next != NULL) {
+						GogRTSeries *next_series;
+
+						next_series = ptr->next->data;
+						if (gog_series_is_valid (GOG_SERIES (next_series))) {
+							GogStyle *next_style;
+							const double *next_x_vals, *next_y_vals;
+							unsigned int next_n_points;
+
+							next_n_points = gog_series_get_xy_data
+								(GOG_SERIES (next_series),
+								 &next_x_vals, &next_y_vals);
+							next_style = gog_styled_object_get_style
+								(GOG_STYLED_OBJECT (next_series));
+
+							next_path = gog_chart_map_make_path
+								(chart_map, next_x_vals, next_y_vals,
+								 next_n_points, next_series->base.interpolation,
+								 series->base.interpolation_skip_invalid, NULL);
 
+						}
 					}
+					gog_renderer_fill_serie (view->renderer, path, next_path);
 				}
-				gog_renderer_fill_serie (view->renderer, path, next_path);
 			}
 		}
 
@@ -571,8 +573,10 @@
 			gog_renderer_pop_style (view->renderer);
 		}
 
-		gog_renderer_stroke_serie (view->renderer, path);
-		go_path_free (path);
+		if (path) {
+			gog_renderer_stroke_serie (view->renderer, path);
+			go_path_free (path);
+		}
 
 		if (is_polar)
 			gog_renderer_pop_clip (view->renderer);



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