[gnumeric] Fix graph series headers when a multiple selection is used. [#675913]
- From: Jean BrÃfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Fix graph series headers when a multiple selection is used. [#675913]
- Date: Mon, 14 May 2012 06:25:38 +0000 (UTC)
commit 34a5bbb76f227b9a524abae0b3890176e2672ec0
Author: Jean Brefort <jean brefort normalesup org>
Date: Mon May 14 08:25:24 2012 +0200
Fix graph series headers when a multiple selection is used. [#675913]
ChangeLog | 5 +++++
NEWS | 3 +++
src/selection.c | 11 ++++++++---
3 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d119423..c065364 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-14 Jean Brefort <jean brefort normalesup org>
+
+ * src/selection.c (sv_selection_to_plot): when several ranges are selected,
+ use a header for all if at least one has a header. [#675913]
+
2012-05-11 Morten Welinder <terra gnome org>
* src/mstyle.c (gnm_style_update): Include font.script in hash.
diff --git a/NEWS b/NEWS
index a0ba4dd..1ef6fbb 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@ Andreas:
* Correctly read & write rich-text chart titles to/from ODF. [#675821]
* Read and write the graph titles to/from ODF. [#675820]
+Jean:
+ * Fix graph series headers when a multiple selection is used. [#675913]
+
Morten:
* Minor doc improvement for non-C locales. [Part of #675000]
* Fix fullscreen criticals.
diff --git a/src/selection.c b/src/selection.c
index f9fbfb8..377a9cf 100644
--- a/src/selection.c
+++ b/src/selection.c
@@ -1490,7 +1490,7 @@ sv_selection_to_plot (SheetView *sv, GogPlot *go_plot)
GraphDataClosure *data = g_object_get_data (G_OBJECT (graph), "data-closure");
gboolean is_string_vec, first_series = TRUE, first_value_dim = TRUE;
unsigned i, count, cur_dim = 0, num_series = 1;
- gboolean has_header, as_cols;
+ gboolean has_header = FALSE, as_cols;
GOData *shared_x = NULL;
gboolean default_to_cols;
@@ -1569,13 +1569,18 @@ sv_selection_to_plot (SheetView *sv, GogPlot *go_plot)
/* selections are in reverse order so walk them backwards */
cur_dim = 0;
sels = ptr = g_slist_reverse (g_slist_copy (selections));
- for (; ptr != NULL; ptr = ptr->next) {
+ /* first determine if there is a header in at least one range, see #675913 */
+ for (; ptr != NULL && !has_header; ptr = ptr->next) {
+ GnmRange vector = *((GnmRange const *)ptr->data);
+ as_cols = (vector.start.col == vector.end.col || default_to_cols);
+ has_header = sheet_range_has_heading (sheet, &vector, as_cols, TRUE);
+ }
+ for (ptr = sels; ptr != NULL; ptr = ptr->next) {
GnmRange vector = *((GnmRange const *)ptr->data);
/* Special case the handling of a vector rather than a range.
* it should stay in its orientation, only ranges get split */
as_cols = (vector.start.col == vector.end.col || default_to_cols);
- has_header = sheet_range_has_heading (sheet, &vector, as_cols, TRUE);
header.col = vector.start.col;
header.row = vector.start.row;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]