[gnumeric] Fix regression in ms_excel_chart_read. [#623960]
- From: Jean Bréfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Fix regression in ms_excel_chart_read. [#623960]
- Date: Sat, 10 Jul 2010 19:45:38 +0000 (UTC)
commit 14bd272100d2ce2e6621dfca6b65c240ba2bee19
Author: Jean Brefort <jean brefort normalesup org>
Date: Sat Jul 10 21:44:05 2010 +0200
Fix regression in ms_excel_chart_read. [#623960]
ChangeLog | 5 +++++
NEWS | 1 +
plugins/excel/ChangeLog | 5 +++++
plugins/excel/ms-chart.c | 2 +-
src/graph.c | 22 ++++++++++++----------
5 files changed, 24 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c5552a7..e1d9581 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-10 Jean Brefort <jean brefort normalesup org>
+
+ * src/graph.c (gnm_go_data_vector_load_len): don't crash with an
+ empty GSList.
+
2010-07-09 Morten Welinder <terra gnome org>
* src/wbc-gtk.c (cb_graph_dim_editor_update): Use the right enum
diff --git a/NEWS b/NEWS
index 7a93d3d..20f7fcf 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,7 @@ Andreas:
Jean:
* Fix strong/weak cursor display. [#623241]
+ * Fix crash regression in ms_excel_chart_read. [#623960]
Morten:
* Ask user to locate solver binaries when plain search fails.
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 3668ba8..116b6b8 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-10 Jean Brefort <jean brefort normalesup org>
+
+ * ms-chart.c (end): do not crash when a chart has more than one
+ plot. [#623960]
+
2010-07-09 Morten Welinder <terra gnome org>
* ms-excel-write.c (excel_write_SETUP): Avoid right-shift bigger
diff --git a/plugins/excel/ms-chart.c b/plugins/excel/ms-chart.c
index e63fa5b..08fdcea 100644
--- a/plugins/excel/ms-chart.c
+++ b/plugins/excel/ms-chart.c
@@ -3114,7 +3114,7 @@ not_a_matrix:
GogPlot *plot = GOG_PLOT (gog_object_get_child_by_name (GOG_OBJECT (s->chart), "Plot"));
/* check if the chart has an epty title and the plot only one series,
* in that case Excel uses the series label as title */
- if (g_slist_length (plot->series) == 1) {
+ if (plot && g_slist_length (plot->series) == 1) {
GogObject *title = gog_object_get_child_by_name (GOG_OBJECT (s->chart), "Title");
if (title) {
GOData *dat = gog_dataset_get_dim (GOG_DATASET (title), 0);
diff --git a/src/graph.c b/src/graph.c
index a94b36f..ef93791 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -485,18 +485,20 @@ gnm_go_data_vector_load_len (GODataVector *dat)
if (gnm_expr_is_rangeref (vec->dep.texpr->expr)) {
GSList *l = gnm_expr_top_get_ranges (vec->dep.texpr);
unsigned len = g_slist_length (l);
- if (l->next == NULL) /* only one range */
- vec->val = (GnmValue *) l->data;
- else {
- GSList *cur = l;
- unsigned i;
- vec->val = value_new_array_empty (len, 1);
- for (i = 0; i < len; i++) {
- vec->val->v_array.vals[i][0] = (GnmValue *) cur->data;
- cur = cur->next;
+ if (l) {
+ if (l->next == NULL) /* only one range */
+ vec->val = (GnmValue *) l->data;
+ else {
+ GSList *cur = l;
+ unsigned i;
+ vec->val = value_new_array_empty (len, 1);
+ for (i = 0; i < len; i++) {
+ vec->val->v_array.vals[i][0] = (GnmValue *) cur->data;
+ cur = cur->next;
+ }
}
+ g_slist_free (l);
}
- g_slist_free (l);
} else {
vec->val = gnm_expr_top_eval (vec->dep.texpr, &ep,
GNM_EXPR_EVAL_PERMIT_NON_SCALAR | GNM_EXPR_EVAL_PERMIT_EMPTY);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]