[gnumeric] expr: remove wrong, but dead, code.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] expr: remove wrong, but dead, code.
- Date: Tue, 2 Jan 2018 01:46:29 +0000 (UTC)
commit 15d20c4297f9196a40a4737674304954d94df34b
Author: Morten Welinder <terra gnome org>
Date: Mon Jan 1 20:45:55 2018 -0500
expr: remove wrong, but dead, code.
Update copyright year.
ChangeLog | 5 +++++
src/dialogs/dialog-about.c | 2 +-
src/expr.c | 14 +++++---------
3 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b31b4bf..b844101 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-01 Morten Welinder <terra gnome org>
+
+ * src/expr.c (gnm_expr_simplify_if): Remove non-working,
+ non-reachable code relating to true() and false() conditions.
+
2017-12-30 Morten Welinder <terra gnome org>
* src/expr.c (gnm_expr_top_get_array_corner): Remove. All callers
diff --git a/src/dialogs/dialog-about.c b/src/dialogs/dialog-about.c
index 6961673..e4a7ed2 100644
--- a/src/dialogs/dialog-about.c
+++ b/src/dialogs/dialog-about.c
@@ -543,7 +543,7 @@ dialog_about (WBCGtk *wbcg)
"website", PACKAGE_URL,
"website-label", _("Visit the Gnumeric website"),
"logo-icon-name", "gnumeric",
- "copyright", _("Copyright \xc2\xa9 1998-2017"),
+ "copyright", _("Copyright \xc2\xa9 1998-2018"),
"comments", _("Free, Fast, Accurate - Pick Any Three!"),
NULL);
state->dialog = w;
diff --git a/src/expr.c b/src/expr.c
index 506339e..30d3ca1 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -4,7 +4,7 @@
*
* Copyright (C) 2001-2006 Jody Goldberg (jody gnome org)
* Copyright (C) 1998-2000 Miguel de Icaza (miguel gnu org)
- * Copyright (C) 2000-2009 Morten Welinder (terra gnome org)
+ * Copyright (C) 2000-2018 Morten Welinder (terra gnome org)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -1576,16 +1576,12 @@ gnm_expr_simplify_if (GnmExpr const *expr)
c = value_get_as_bool (condval, &err);
if (err)
return NULL;
- } else if (GNM_EXPR_GET_OPER (cond) == GNM_EXPR_OP_FUNCALL) {
- if (cond->func.func != gnm_func_lookup ("true", NULL))
- c = TRUE;
- else if (cond->func.func != gnm_func_lookup ("false", NULL))
- c = FALSE;
- else
- return NULL;
} else
return NULL;
+ // We used to test for true() and false() as conditions too, but the code
+ // never worked and has been unreachable until now.
+
return gnm_expr_copy (expr->func.argv[c ? 1 : 2]);
}
@@ -2890,7 +2886,7 @@ cb_get_ranges (GnmExpr const *expr, GnmExprWalk *data)
{
GSList **pranges = data->user;
- /* There's no real reason to exclude ranges here, except that
+ /* There's no real reason to exclude names here, except that
we used to do so. */
if (GNM_EXPR_GET_OPER (expr) != GNM_EXPR_OP_NAME) {
GnmValue *v = gnm_expr_get_range (expr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]