Commit 311bf977 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Use error constant for all the regular errors. (Thus, don't refer to the

2002-04-19  Morten Welinder  <terra@diku.dk>

	* src/expr.c (gnm_expr_new_error): Use error constant for all the
	regular errors.  (Thus, don't refer to the NA function.)
parent a94c1b97
2002-04-19 Morten Welinder <terra@diku.dk>
* src/expr.c (gnm_expr_new_error): Use error constant for all the
regular errors. (Thus, don't refer to the NA function.)
* src/func-builtin.c (gnumeric_selection, gnumeric_version): Moved
from fn-sheet.
......
2002-04-19 Morten Welinder <terra@diku.dk>
* src/expr.c (gnm_expr_new_error): Use error constant for all the
regular errors. (Thus, don't refer to the NA function.)
* src/func-builtin.c (gnumeric_selection, gnumeric_version): Moved
from fn-sheet.
......
2002-04-19 Morten Welinder <terra@diku.dk>
* src/expr.c (gnm_expr_new_error): Use error constant for all the
regular errors. (Thus, don't refer to the NA function.)
* src/func-builtin.c (gnumeric_selection, gnumeric_version): Moved
from fn-sheet.
......
......@@ -69,13 +69,18 @@ gnm_expr_new_error (char const *txt)
FunctionDefinition *func;
GnmExprList *args = NULL;
if (strcmp (txt, gnumeric_err_NA) != 0) {
func = func_lookup_by_name ("ERROR", NULL);
args = gnm_expr_list_prepend (NULL,
gnm_expr_new_constant (value_new_string (txt)));
} else
func = func_lookup_by_name ("NA", NULL);
if (strcmp (txt, gnumeric_err_NA) == 0 ||
strcmp (txt, gnumeric_err_DIV0) == 0 ||
strcmp (txt, gnumeric_err_VALUE) == 0 ||
strcmp (txt, gnumeric_err_REF) == 0 ||
strcmp (txt, gnumeric_err_NAME) == 0 ||
strcmp (txt, gnumeric_err_NUM) == 0 ||
strcmp (txt, gnumeric_err_NA) == 0)
return gnm_expr_new_constant (value_new_error (NULL, txt));
func = func_lookup_by_name ("ERROR", NULL);
args = gnm_expr_list_prepend (NULL,
gnm_expr_new_constant (value_new_string (txt)));
func_ref (func);
return gnm_expr_new_funcall (func, args);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment