[gnumeric] Fuzzed file fix [#751744]



commit 0811b8f41970106c9e838f991ef5ecfbed808f7e
Author: Jean Brefort <jean brefort normalesup org>
Date:   Fri Jul 3 11:12:32 2015 +0200

    Fuzzed file fix [#751744]

 NEWS                     |    4 ++--
 plugins/excel/ChangeLog  |    4 ++++
 plugins/excel/ms-chart.c |   12 +++++++++++-
 3 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index f1d1453..d1fb342 100644
--- a/NEWS
+++ b/NEWS
@@ -6,7 +6,7 @@ Andreas:
        * Improve function import to ODF. [#750627]
        * Add CONFIDENCE.T, MODE.MULT, PERCENTILE.EXC, PERCENTRANK.EXC
          and QUARTILE.EXC.
-       * Fuzzed file fixes.  [#751060] [#751501] [#751851]
+       * Fuzzed file fixes.  [#751060] [#751501]
        * Fix ODF import of named expressions. [#750627]
        * Import reference unions from ODF. [#750627]
        * Improve CONVERT function.
@@ -15,7 +15,7 @@ Jean:
        * Fix xlsx import of plot area manual layout. [#748016]
        * Fix out of bounds read. [#749121]
        * Fuzzed file fixes.  [#750042] [#751217] [#751270] [#751271]
-          [#751383] [#751384] [#751758]
+          [#751383] [#751384] [#751758] [751744]
 
 Morten:
        * Fix import/export of graph backplane.
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index e877036..9233603 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,7 @@
+2015-07-03  Jean Brefort  <jean brefort normalesup org>
+
+       * ms-chart.c (end): fix Y and Z axes exchange in 3D plots. Fixes #751744.
+
 2015-07-02  Morten Welinder  <terra gnome org>
 
        * ms-obj.c (read_pre_biff8_read_expr): Check record length.
diff --git a/plugins/excel/ms-chart.c b/plugins/excel/ms-chart.c
index 06afc69..9b12f0c 100644
--- a/plugins/excel/ms-chart.c
+++ b/plugins/excel/ms-chart.c
@@ -2678,26 +2678,36 @@ BC_R(end)(XLChartHandler const *handle,
                        gboolean as_col = FALSE; /* makes gcc happy */
                        GOData *cur;
                        int row_start = 0, col_start = 0, row = 0, col = -1, last = 0;
-                       GSList *axisY, *axisZ, *l;
+                       GSList *axisY, *axisZ, *l, *contributors, *ptr;
 
                        /* exchange axis */
                        l = axisY = gog_chart_get_axes (s->chart, GOG_AXIS_Y);
                        axisZ = gog_chart_get_axes (s->chart, GOG_AXIS_Z);
                        while (l) {
+                               contributors = g_slist_copy ((GSList*) gog_axis_contributors (GOG_AXIS 
(l->data)));
+                               gog_axis_clear_contributors (GOG_AXIS (l->data));
                                gog_object_clear_parent (GOG_OBJECT (l->data));
                                g_object_set (G_OBJECT (l->data), "type",
                                        ((s->is_contour)? GOG_AXIS_PSEUDO_3D: GOG_AXIS_Z), NULL);
                                gog_object_add_by_name (GOG_OBJECT (s->chart),
                                        ((s->is_contour)? "Pseudo-3D-Axis": "Z-Axis"),
                                        GOG_OBJECT (l->data));
+                               for (ptr = contributors; ptr != NULL; ptr = ptr->next)
+                                       gog_axis_add_contributor (GOG_AXIS (l->data), GOG_OBJECT (ptr->data));
+                               g_slist_free (contributors);
                                l = l->next;
                        }
                        g_slist_free (axisY);
                        l = axisZ;
                        while (l) {
+                               contributors = g_slist_copy ((GSList*) gog_axis_contributors (GOG_AXIS 
(l->data)));
+                               gog_axis_clear_contributors (GOG_AXIS (l->data));
                                gog_object_clear_parent (GOG_OBJECT (l->data));
                                g_object_set (G_OBJECT (l->data), "type", GOG_AXIS_Y, NULL);
                                gog_object_add_by_name (GOG_OBJECT (s->chart), "Y-Axis", GOG_OBJECT 
(l->data));
+                               for (ptr = contributors; ptr != NULL; ptr = ptr->next)
+                                       gog_axis_add_contributor (GOG_AXIS (l->data), GOG_OBJECT (ptr->data));
+                               g_slist_free (contributors);
                                l = l->next;
                        }
                        g_slist_free (axisZ);


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