[gnumeric] TABLE: Restrict to array context.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] TABLE: Restrict to array context.
- Date: Fri, 3 Jul 2015 15:24:10 +0000 (UTC)
commit d87a0628537dbba79860b4c8fb7b0e8b09d6a719
Author: Morten Welinder <terra gnome org>
Date: Fri Jul 3 11:23:22 2015 -0400
TABLE: Restrict to array context.
ChangeLog | 5 +++++
NEWS | 1 +
src/func-builtin.c | 8 +++++---
3 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 12791df..c16262c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-03 Morten Welinder <terra gnome org>
+
+ * src/func-builtin.c (gnumeric_table): Return #REF! outside array
+ context.
+
2015-06-30 Morten Welinder <terra gnome org>
* src/expr.c (gnm_expr_eval): Don't crash if an empty array makes
diff --git a/NEWS b/NEWS
index d1fb342..1a36c10 100644
--- a/NEWS
+++ b/NEWS
@@ -41,6 +41,7 @@ Morten:
* Protect database functions against malformed database. [#751392]
* Fix csv problem with invalid UTF-8 data. [#751577]
* Fix GROWTH. [#751658]
+ * Restrict TABLE to array context. [#751871]
--------------------------------------------------------------------------
Gnumeric 1.12.22
diff --git a/src/func-builtin.c b/src/func-builtin.c
index ddee837..c47b214 100644
--- a/src/func-builtin.c
+++ b/src/func-builtin.c
@@ -128,12 +128,13 @@ gnumeric_table_link (GnmFuncEvalInfo *ei, gboolean qlink)
if (!qlink)
return DEPENDENT_NO_FLAG;
+ if (!eval_pos_is_array_context (ei->pos))
+ return DEPENDENT_IGNORE_ARGS;
+
rr.a.col_relative = rr.a.row_relative =
rr.b.col_relative = rr.b.row_relative = FALSE;
rr.a.sheet = rr.b.sheet = dep->sheet;
- g_return_val_if_fail (eval_pos_is_array_context (ei->pos), DEPENDENT_IGNORE_ARGS);
-
g_return_val_if_fail (ei->pos->eval.col > 0, DEPENDENT_IGNORE_ARGS);
rr.a.col = rr.b.col = ei->pos->eval.col - 1;
rr.a.row = ei->pos->eval.row;
@@ -162,7 +163,8 @@ gnumeric_table (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv)
if (argc != 2 ||
ei->pos->eval.col < 1 ||
- ei->pos->eval.row < 1)
+ ei->pos->eval.row < 1 ||
+ !eval_pos_is_array_context (ei->pos))
return value_new_error_REF (ei->pos);
for (x = 0; x < 2 ; x++) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]