[gnumeric] Fix loading string from arrays in charts. [#416]



commit 8924222a2602370128aabe969f6f93b2a20bcdd4
Author: Jean Brefort <jean brefort normalesup org>
Date:   Mon Sep 16 19:55:06 2019 +0200

    Fix loading string from arrays in charts. [#416]

 ChangeLog   | 5 +++++
 NEWS        | 4 ++++
 src/graph.c | 7 +++++++
 3 files changed, 16 insertions(+)
---
diff --git a/ChangeLog b/ChangeLog
index 86058b6eb..884dc3f7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-09-16  Jean Brefort  <jean brefort normalesup org>
+
+       * src/graph.c (gnm_go_data_vector_get_str): load strings from arrays.
+       Fixes #416.
+
 2019-06-27  Morten Welinder  <terra gnome org>
 
        * src/clipboard.c (cellregion_invalidate_sheet): Also invalidate
diff --git a/NEWS b/NEWS
index ec713f1df..288a7f865 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,10 @@ Gnumeric 1.12.46
 Andreas:
        * Fix format import from ODF. [#403]
 
+Jean:
+       * Fix charts size in XLS format. [#414]
+       * Fix loading string from arrays in charts. [#416]
+
 Morten:
        * Fix over-eager guessing of dates in csv.  [#401]
        * Fix Mac build problem.  [#402]
diff --git a/src/graph.c b/src/graph.c
index cd1fcd311..c68a4c387 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -942,6 +942,13 @@ gnm_go_data_vector_get_str (GODataVector *dat, unsigned i)
                                                                             CELL_ITER_IGNORE_FILTERED,
                                                                             &r,
                                                                             (CellIterFunc)cb_assign_string, 
&closure);
+                               } else if (VALUE_IS_EMPTY_OR_ERROR (v)) {
+                                       /* Not sure about what to do */
+                                       /* The use of g_ptr_array_insert there and g-ptr_array_add
+                                        * for cell ranges looks like a bugs nest */
+                                       g_ptr_array_insert (vec->strs, 0, g_strdup (""));
+                               } else {
+                                       g_ptr_array_insert (vec->strs, 0, value_get_as_string (v));
                                }
                        }
                }


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