[gnumeric] More xls unexisting series issues fixed.
- From: Jean Bréfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] More xls unexisting series issues fixed.
- Date: Thu, 25 Jun 2015 14:57:52 +0000 (UTC)
commit 527dec7a568970fb5999e5cd9476fa115e92f41d
Author: Jean Brefort <jean brefort normalesup org>
Date: Thu Jun 25 16:57:10 2015 +0200
More xls unexisting series issues fixed.
plugins/excel/ChangeLog | 4 ++++
plugins/excel/ms-chart.c | 27 ++++++++++++++++++++++-----
samples/chart-tests.gnumeric | Bin 807390 -> 21671530 bytes
3 files changed, 26 insertions(+), 5 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 97de5cf..982c85b 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,7 @@
+2015-06-25 Jean Brefort <jean brefort normalesup org>
+
+ * ms-chart.c (end): more unexisting series issues. See #751270, comment #2
+
2015-06-24 Jean Brefort <jean brefort normalesup org>
* ms-chart.c (end), (ms_excel_chart_read): don't use unexisting series and
diff --git a/plugins/excel/ms-chart.c b/plugins/excel/ms-chart.c
index 56b526e..6bd1ba1 100644
--- a/plugins/excel/ms-chart.c
+++ b/plugins/excel/ms-chart.c
@@ -2981,8 +2981,10 @@ not_a_matrix:
eseries->chart_group != s->plot_counter)
if (l != 0)
l--;
- else
+ else {
eseries = NULL;
+ break;
+ }
gog_object_add_by_name (GOG_OBJECT (s->chart), "Plot", plot);
gog_object_reorder (plot, TRUE, FALSE);
added_plots++;
@@ -3002,7 +3004,11 @@ not_a_matrix:
eseries->extra_dim = GOG_MS_DIM_END;
}
while (eseries = g_ptr_array_index (s->series, k++),
- eseries && eseries->chart_group != s->plot_counter);
+ eseries && eseries->chart_group != s->plot_counter)
+ if (k == s->series->len) {
+ eseries = NULL;
+ break;
+ }
if (eseries) {
if (eseries->data [GOG_MS_DIM_VALUES].data != NULL) {
gog_series_set_XL_dim (series, GOG_MS_DIM_START,
@@ -3028,7 +3034,11 @@ not_a_matrix:
gog_object_reorder (plot, TRUE, FALSE);
series = gog_plot_new_series (GOG_PLOT (plot));
while (eseries = g_ptr_array_index (s->series, k++),
- eseries && eseries->chart_group != s->plot_counter);
+ eseries && eseries->chart_group != s->plot_counter)
+ if (k == s->series->len) {
+ eseries = NULL;
+ break;
+ }
if (eseries != NULL) {
if (eseries->data [GOG_MS_DIM_CATEGORIES].data != NULL) {
gog_series_set_XL_dim (series, GOG_MS_DIM_CATEGORIES,
@@ -3042,8 +3052,15 @@ not_a_matrix:
} else
eseries->extra_dim = GOG_MS_DIM_HIGH;
}
- while (eseries = g_ptr_array_index (s->series, k++),
- eseries && eseries->chart_group != s->plot_counter);
+ if (k == s->series->len)
+ eseries = NULL;
+ else while (eseries = g_ptr_array_index (s->series, k++),
+ eseries && eseries->chart_group != s->plot_counter) {
+ if (k == s->series->len) {
+ eseries = NULL;
+ break;
+ }
+ }
if (eseries != NULL) {
if (eseries->data [GOG_MS_DIM_VALUES].data != NULL) {
gog_series_set_XL_dim (series, GOG_MS_DIM_LOW,
diff --git a/samples/chart-tests.gnumeric b/samples/chart-tests.gnumeric
index ac28bbc..1043e95 100644
Binary files a/samples/chart-tests.gnumeric and b/samples/chart-tests.gnumeric differ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]