[goffice] Protect colored xy and bubble plots against NULL z values.



commit ae566d9436a0d8c81ce6ae65b6ec4c2ce26b51c2
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sat Mar 28 17:22:46 2015 +0100

    Protect colored xy and bubble plots against NULL z values.

 ChangeLog                |    5 +++++
 NEWS                     |    1 +
 plugins/plot_xy/gog-xy.c |    4 ++--
 3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 083e626..9998841 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-28  Jean Brefort  <jean brefort normalesup org>
+
+       * plugins/plot_xy/gog-xy.c (gog_xy_view_render): protect colored xy and
+       bubble plots against NULL z values.
+
 2015-03-25  Morten Welinder  <terra gnome org>
 
        * plugins/plot_radar/gog-radar.c (gog_rt_plot_update): Handle log
diff --git a/NEWS b/NEWS
index b400201..c18c1bb 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ goffice 0.10.22:
 
 Jean:
        * Fix selection of axes using only part fo the plot area. [#746456]
+       * Protect colored xy and bubble plots against NULL z values.
 
 Johannes Deutsch:
        * Do not draw the line over the arrow head at start. [#745736]
diff --git a/plugins/plot_xy/gog-xy.c b/plugins/plot_xy/gog-xy.c
index 50dd0a5..1c17edd 100644
--- a/plugins/plot_xy/gog-xy.c
+++ b/plugins/plot_xy/gog-xy.c
@@ -1046,7 +1046,7 @@ gog_xy_view_render (GogView *view, GogViewAllocation const *bbox)
        GogViewAllocation const *area;
        GOPath *path = NULL, *next_path = NULL;
        GSList *ptr;
-       double const *y_vals, *x_vals, *z_vals;
+       double const *y_vals, *x_vals, *z_vals =  NULL;
        double x = 0., y = 0., z = 0., x_canvas = 0., y_canvas = 0.;
        double zmax, rmax = 0., x_left, y_bottom, x_right, y_top;
        double x_margin_min, x_margin_max, y_margin_min, y_margin_max, margin;
@@ -1120,7 +1120,7 @@ gog_xy_view_render (GogView *view, GogViewAllocation const *bbox)
                        n = gog_series_get_xyz_data (GOG_SERIES (series), &x_vals, &y_vals, &z_vals);
                else
                        n = gog_series_get_xy_data (GOG_SERIES (series), &x_vals, &y_vals);
-               if (n < 1 || y_vals == NULL)
+               if (n < 1 || y_vals == NULL || ((is_map || GOG_IS_BUBBLE_PLOT(model)) && z_vals == NULL))
                        continue;
 
                style = go_styled_object_get_style (GO_STYLED_OBJECT (series));


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