[goffice] Do not destroy axes after adding a plot using a restricted set. [#708292]



commit 4aadd6830ab7086d18e2df7bcbf4dc94a01089cc
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sat Sep 21 16:24:26 2013 +0200

    Do not destroy axes after adding a plot using a restricted set. [#708292]

 ChangeLog                 |    5 +++++
 NEWS                      |    3 +++
 goffice/graph/gog-chart.c |    7 ++++---
 3 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index cd37b98..ab10a5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-09-21  Jean Brefort  <jean brefort normalesup org>
+
+       * goffice/graph/gog-chart.c (gog_chart_axis_set_assign): do not remove
+extra axes after adding a plot. [#708292]
+
 2013-09-20  Jean Brefort  <jean brefort normalesup org>
 
        * goffice/graph/gog-color-scale.c (gog_color_scale_view_render): ensure that
diff --git a/NEWS b/NEWS
index 1cd1302..9310f57 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 goffice 0.10.8:
 
+Jean:
+       * Do not destroy axes after adding a plot using a restricted set. [#708292]
+
 --------------------------------------------------------------------------
 goffice 0.10.7:
 
diff --git a/goffice/graph/gog-chart.c b/goffice/graph/gog-chart.c
index ae19b90..3abb5f0 100644
--- a/goffice/graph/gog-chart.c
+++ b/goffice/graph/gog-chart.c
@@ -1055,7 +1055,7 @@ gog_chart_axis_set_assign (GogChart *chart, GogAxisSet axis_set)
                if (!gog_plot_axis_set_assign (ptr->data, axis_set))
                        return FALSE;
 
-       /* remove any existing axis that do not fit this scheme */
+       /* add any existing axis that do not fit this scheme to the set */
        for (ptr = GOG_OBJECT (chart)->children ; ptr != NULL ; ) {
                axis = ptr->data;
                ptr = ptr->next; /* list may change under us */
@@ -1068,8 +1068,9 @@ gog_chart_axis_set_assign (GogChart *chart, GogAxisSet axis_set)
                        }
 
                        if (0 == (axis_set & (1 << type))) {
-                               gog_object_clear_parent (GOG_OBJECT (axis));
-                               g_object_unref (axis);
+                               /* We used to delete those axes but if the first plot use a
+                                restricted set, all other axes are lost, see #708292 */
+                               chart->axis_set |= 1 << type;
                        }
                }
        }


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