[gnumeric] Fixed graph data loading from vectors that are array values. [#697107]
- From: Jean Bréfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Fixed graph data loading from vectors that are array values. [#697107]
- Date: Thu, 4 Apr 2013 15:38:15 +0000 (UTC)
commit ebace44a886ead2aeac9efc973f00a85050c5c07
Author: Jean Brefort <jean brefort normalesup org>
Date: Thu Apr 4 17:44:48 2013 +0200
Fixed graph data loading from vectors that are array values. [#697107]
ChangeLog | 6 ++++++
NEWS | 1 +
src/graph.c | 25 +++++++++++++++++--------
3 files changed, 24 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4403105..0ce88f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-04 Jean Brefort <jean brefort normalesup org>
+
+ * src/graph.c (gnm_go_data_vector_load_values),
+ (gnm_go_data_vector_get_str): fix values and strings loading in case of
+ arrays. [697107]
+
2013-04-03 Morten Welinder <terra gnome org>
* src/wbc-gtk.c (cb_sheet_tab_change): Use g_object_set to set
diff --git a/NEWS b/NEWS
index 1f9ebf3..6b1e147 100644
--- a/NEWS
+++ b/NEWS
@@ -893,6 +893,7 @@ Jean:
* Do not ungrab a not grabbed item. [#620369]
* Always update the right series entry. [#620719]
* Fixed multi-line item edit selection. [#621235]
+ * Fixed graph data loading from vectors that are array values. [#697107]
Morten:
* Make sure windows for help commands show up on right screen.
diff --git a/src/graph.c b/src/graph.c
index 59fe73d..45527b9 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -712,13 +712,18 @@ gnm_go_data_vector_load_values (GODataVector *dat)
case VALUE_ARRAY : {
int last = 0;
- int len = vec->as_col? vec->val->v_array.y: vec->val->v_array.x;
+ int len = vec->val->v_array.y * vec->val->v_array.x;
+ int x = 0, y = vec->val->v_array.y;
+ GnmValue *v;
maximum = - G_MAXDOUBLE;
minimum = G_MAXDOUBLE;
while (len-- > 0) {
- GnmValue *v = vec->as_col
- ? vec->val->v_array.vals [0][len]
- : vec->val->v_array.vals [len][0];
+ if (x == 0) {
+ x = vec->val->v_array.x;
+ y--;
+ }
+ x--;
+ v = vec->val->v_array.vals [x][y];
if (v->type == VALUE_CELLRANGE) {
gnm_rangeref_normalize (&v->v_range.cell,
@@ -863,11 +868,15 @@ gnm_go_data_vector_get_str (GODataVector *dat, unsigned i)
eval_pos_init_dep (&ep, &vec->dep);
if (vec->val->type == VALUE_ARRAY) {
/* we need to cache the strings if needed */
- int len = vec->as_col? vec->val->v_array.y: vec->val->v_array.x;
+ int len = vec->val->v_array.y * vec->val->v_array.x;
+ int x = 0, y = vec->val->v_array.y;
while (len-- > 0) {
- v = vec->as_col
- ? vec->val->v_array.vals [0][len]
- : vec->val->v_array.vals [len][0];
+ if (x == 0) {
+ x = vec->val->v_array.x;
+ y--;
+ }
+ x--;
+ v = vec->val->v_array.vals [x][y];
if (v->type == VALUE_CELLRANGE) {
/* actually we only need to cache in that case */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]