[goffice] Do not load invalid data labels in XYcolor plots. [#765155]



commit c2885197447b7b79fb0019616ccd5a36fcf3d04d
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sun Apr 17 10:48:07 2016 +0200

    Do not load invalid data labels in XYcolor plots. [#765155]

 ChangeLog                |    5 +++++
 NEWS                     |    3 +++
 plugins/plot_xy/gog-xy.c |    5 +++--
 3 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b907ef4..e5acedf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-04-17  Jean Brefort  <jean brefort normalesup org>
+
+       * plugins/plot_xy/gog-xy.c (gog_xy_view_render): do not load invalid data
+       labels in XYcolor plots. [#765155]
+
 2016-03-24  Morten Welinder  <terra gnome org>
 
        * goffice/math/go-complex.c (go_complex_sqrt): Avoid extreme-case
diff --git a/NEWS b/NEWS
index a6a4de8..8d4e24b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 goffice 0.10.29:
 
+Jean:
+       * Do not load invalid data labels in XYcolor plots. [#765155]
+
 Morten:
        * Improve go_complex_sqrt.
        * Improve go_complex_div.
diff --git a/plugins/plot_xy/gog-xy.c b/plugins/plot_xy/gog-xy.c
index ba724b6..8d11d74 100644
--- a/plugins/plot_xy/gog-xy.c
+++ b/plugins/plot_xy/gog-xy.c
@@ -1527,7 +1527,8 @@ gog_xy_view_render (GogView *view, GogViewAllocation const *bbox)
                                if (zmin > zmax) zmax = zmin;
                        }
                        n = gog_series_get_xyz_data (GOG_SERIES (series), &x_vals, &y_vals, &z_vals);
-               }
+               } else if (GOG_IS_XY_COLOR_PLOT (model))
+                       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) {
@@ -1566,7 +1567,7 @@ gog_xy_view_render (GogView *view, GogViewAllocation const *bbox)
                                alloc.x = gog_axis_map_to_view (x_map, x);
                                alloc.y = gog_axis_map_to_view (y_map, y);
                                Elt = gog_series_labels_vector_get_element (lbls, i - 1);
-                               if (Elt->point) {
+                               if (Elt && Elt->point) {
                                        g_object_get (Elt->point, "offset", &cur_offset, NULL);
                                        cur_position = gog_data_label_get_position (GOG_DATA_LABEL 
(Elt->point));
                                } else {


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