Commit bff9fb97 authored by Morten Welinder's avatar Morten Welinder

Prune includes. Return boolean Values more often.

parent c78f0825
......@@ -42,6 +42,9 @@ Nick Lamb
* Fixed absolute shared formulae cell references.
* Supplied a spreadsheet to check date functions.
Jody Goldberg
* Supplied many new error and error checking functions.
Several translations updated: thanks to our translators
And lots of bugs fixed.
Sun Jun 13 14:16:16 1999 Morten Welinder <welinder@rentec.com>
1999-06-13 Morten Welinder <terra@diku.dk>
* src/fn-information.c: Prune includes.
* src/fn-string.c: Ditto.
* src/fn-sheet.c: Ditto.
* src/fn-misc.c: Ditto.
* src/fn-financial.c: Ditto.
* src/fn-date.c: Ditto.
* src/fn-database.c: Ditto.
* src/fn-lookup.c: Ditto.
* src/fn-stat.c: Ditto.
* src/fn-math.c: Ditto.
* src/fn-logical.c: Ditto.
* src/cell.h: Fix includes.
* src/fn-information.c (gnumeric_isblank): Return boolean.
(gnumeric_iseven): Ditto.
......@@ -10,11 +25,12 @@ Sun Jun 13 14:16:16 1999 Morten Welinder <welinder@rentec.com>
(gnumeric_istext): Ditto.
(gnumeric_n): Ditto.
1999-06-13 Morten Welinder <terra@diku.dk>
* src/expr.c (value_new_bool): New function.
(eval_expr): Return boolean Values.
* src/fn-misc.c (gnumeric_iserr, gnumeric_iserror, gnumeric_isna):
Return boolean;
* src/fn-logical.c (callback_function_and): Simplify.
(callback_function_or): Ditto.
(gnumeric_and): Simplify and return boolean Values.
......
Sun Jun 13 14:16:16 1999 Morten Welinder <welinder@rentec.com>
1999-06-13 Morten Welinder <terra@diku.dk>
* src/fn-information.c: Prune includes.
* src/fn-string.c: Ditto.
* src/fn-sheet.c: Ditto.
* src/fn-misc.c: Ditto.
* src/fn-financial.c: Ditto.
* src/fn-date.c: Ditto.
* src/fn-database.c: Ditto.
* src/fn-lookup.c: Ditto.
* src/fn-stat.c: Ditto.
* src/fn-math.c: Ditto.
* src/fn-logical.c: Ditto.
* src/cell.h: Fix includes.
* src/fn-information.c (gnumeric_isblank): Return boolean.
(gnumeric_iseven): Ditto.
......@@ -10,11 +25,12 @@ Sun Jun 13 14:16:16 1999 Morten Welinder <welinder@rentec.com>
(gnumeric_istext): Ditto.
(gnumeric_n): Ditto.
1999-06-13 Morten Welinder <terra@diku.dk>
* src/expr.c (value_new_bool): New function.
(eval_expr): Return boolean Values.
* src/fn-misc.c (gnumeric_iserr, gnumeric_iserror, gnumeric_isna):
Return boolean;
* src/fn-logical.c (callback_function_and): Simplify.
(callback_function_or): Ditto.
(gnumeric_and): Simplify and return boolean Values.
......
Sun Jun 13 14:16:16 1999 Morten Welinder <welinder@rentec.com>
1999-06-13 Morten Welinder <terra@diku.dk>
* src/fn-information.c: Prune includes.
* src/fn-string.c: Ditto.
* src/fn-sheet.c: Ditto.
* src/fn-misc.c: Ditto.
* src/fn-financial.c: Ditto.
* src/fn-date.c: Ditto.
* src/fn-database.c: Ditto.
* src/fn-lookup.c: Ditto.
* src/fn-stat.c: Ditto.
* src/fn-math.c: Ditto.
* src/fn-logical.c: Ditto.
* src/cell.h: Fix includes.
* src/fn-information.c (gnumeric_isblank): Return boolean.
(gnumeric_iseven): Ditto.
......@@ -10,11 +25,12 @@ Sun Jun 13 14:16:16 1999 Morten Welinder <welinder@rentec.com>
(gnumeric_istext): Ditto.
(gnumeric_n): Ditto.
1999-06-13 Morten Welinder <terra@diku.dk>
* src/expr.c (value_new_bool): New function.
(eval_expr): Return boolean Values.
* src/fn-misc.c (gnumeric_iserr, gnumeric_iserror, gnumeric_isna):
Return boolean;
* src/fn-logical.c (callback_function_and): Simplify.
(callback_function_or): Ditto.
(gnumeric_and): Simplify and return boolean Values.
......
Sun Jun 13 14:16:16 1999 Morten Welinder <welinder@rentec.com>
1999-06-13 Morten Welinder <terra@diku.dk>
* src/fn-information.c: Prune includes.
* src/fn-string.c: Ditto.
* src/fn-sheet.c: Ditto.
* src/fn-misc.c: Ditto.
* src/fn-financial.c: Ditto.
* src/fn-date.c: Ditto.
* src/fn-database.c: Ditto.
* src/fn-lookup.c: Ditto.
* src/fn-stat.c: Ditto.
* src/fn-math.c: Ditto.
* src/fn-logical.c: Ditto.
* src/cell.h: Fix includes.
* src/fn-information.c (gnumeric_isblank): Return boolean.
(gnumeric_iseven): Ditto.
......@@ -10,11 +25,12 @@ Sun Jun 13 14:16:16 1999 Morten Welinder <welinder@rentec.com>
(gnumeric_istext): Ditto.
(gnumeric_n): Ditto.
1999-06-13 Morten Welinder <terra@diku.dk>
* src/expr.c (value_new_bool): New function.
(eval_expr): Return boolean Values.
* src/fn-misc.c (gnumeric_iserr, gnumeric_iserror, gnumeric_isna):
Return boolean;
* src/fn-logical.c (callback_function_and): Simplify.
(callback_function_or): Ditto.
(gnumeric_and): Simplify and return boolean Values.
......
......@@ -5,10 +5,7 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
#include "sheet.h"
......@@ -1225,4 +1222,3 @@ FunctionDefinition database_functions [] = {
NULL, gnumeric_dvarp },
{ NULL, NULL },
};
......@@ -6,10 +6,8 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
#include "number-match.h"
......
......@@ -8,10 +8,8 @@
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -6,11 +6,7 @@
* Jody Goldberg (jgoldberg@home.com)
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -6,9 +6,7 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -7,11 +7,7 @@
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "numbers.h"
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -6,10 +6,8 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -7,12 +7,9 @@
* Morten Welinder <terra@diku.dk>
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "mathfunc.h"
#include "numbers.h"
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -7,11 +7,9 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
#ifndef GNUMERIC_CELL_H
#define GNUMERIC_CELL_H
#include <glib.h>
/* Forward references for structures. */
typedef struct _Cell Cell;
typedef struct _CellRegion CellRegion;
......
......@@ -5,10 +5,7 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
#include "sheet.h"
......@@ -1225,4 +1222,3 @@ FunctionDefinition database_functions [] = {
NULL, gnumeric_dvarp },
{ NULL, NULL },
};
......@@ -6,10 +6,8 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
#include "number-match.h"
......
......@@ -8,10 +8,8 @@
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -6,11 +6,7 @@
* Jody Goldberg (jgoldberg@home.com)
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -6,9 +6,7 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -7,11 +7,7 @@
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "numbers.h"
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -6,10 +6,8 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -6,10 +6,7 @@
*
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......@@ -52,18 +49,17 @@ static Value *
gnumeric_iserror (Sheet *sheet, GList *expr_node_list,
int eval_col, int eval_row, char **error_string)
{
int res, retval = 0;
int res;
res = gnumeric_check_for_err (sheet, expr_node_list,
eval_col, eval_row, error_string);
if (res < 0)
return NULL;
if (res > 0)
{
if (res > 0) {
*error_string = NULL;
retval = 1; /* We do not care what type */
return value_new_bool (TRUE);
}
return value_new_int (retval);
return value_new_bool (FALSE);
}
......@@ -85,19 +81,18 @@ static Value *
gnumeric_isna (Sheet *sheet, GList *expr_node_list,
int eval_col, int eval_row, char **error_string)
{
int res, retval = 0;
int res;
res = gnumeric_check_for_err (sheet, expr_node_list,
eval_col, eval_row, error_string);
if (res < 0)
return NULL;
if (res > 0)
{
if (!strcmp (gnumeric_err_NA, *error_string))
retval = 1; /* Only for N/A */
if (res > 0) {
gboolean is_NA = (strcmp (gnumeric_err_NA, *error_string) == 0);
*error_string = NULL;
return value_new_bool (is_NA);
}
return value_new_int (retval);
}
return value_new_bool (FALSE);
}
static char *help_iserr = {
......@@ -114,18 +109,17 @@ static Value *
gnumeric_iserr (Sheet *sheet, GList *expr_node_list,
int eval_col, int eval_row, char **error_string)
{
int res, retval = 0;
int res;
res = gnumeric_check_for_err (sheet, expr_node_list,
eval_col, eval_row, error_string);
if (res < 0)
return NULL;
if (res > 0)
{
if (strcmp (gnumeric_err_NA, *error_string))
retval = 1; /* Any error accept N/A */
if (res > 0) {
gboolean is_NA = (strcmp (gnumeric_err_NA, *error_string) == 0);
*error_string = NULL;
}
return value_new_int (retval);
return value_new_bool (!is_NA);
}
return value_new_bool (FALSE);
}
......
......@@ -6,9 +6,7 @@
*
*/
#include <config.h>
#include <gnome.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -7,12 +7,9 @@
* Morten Welinder <terra@diku.dk>
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "mathfunc.h"
#include "numbers.h"
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -7,11 +7,9 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -5,10 +5,7 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
#include "sheet.h"
......@@ -1225,4 +1222,3 @@ FunctionDefinition database_functions [] = {
NULL, gnumeric_dvarp },
{ NULL, NULL },
};
......@@ -6,10 +6,8 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
#include "number-match.h"
......
......@@ -8,10 +8,8 @@
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -6,11 +6,7 @@
* Jody Goldberg (jgoldberg@home.com)
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -6,9 +6,7 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -7,11 +7,7 @@
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "numbers.h"
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -6,10 +6,8 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -6,10 +6,7 @@
*
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......@@ -52,18 +49,17 @@ static Value *
gnumeric_iserror (Sheet *sheet, GList *expr_node_list,
int eval_col, int eval_row, char **error_string)
{
int res, retval = 0;
int res;
res = gnumeric_check_for_err (sheet, expr_node_list,
eval_col, eval_row, error_string);
if (res < 0)
return NULL;
if (res > 0)
{
if (res > 0) {
*error_string = NULL;
retval = 1; /* We do not care what type */
return value_new_bool (TRUE);
}
return value_new_int (retval);
return value_new_bool (FALSE);
}
......@@ -85,19 +81,18 @@ static Value *
gnumeric_isna (Sheet *sheet, GList *expr_node_list,
int eval_col, int eval_row, char **error_string)
{
int res, retval = 0;
int res;
res = gnumeric_check_for_err (sheet, expr_node_list,
eval_col, eval_row, error_string);
if (res < 0)
return NULL;
if (res > 0)
{
if (!strcmp (gnumeric_err_NA, *error_string))
retval = 1; /* Only for N/A */
if (res > 0) {
gboolean is_NA = (strcmp (gnumeric_err_NA, *error_string) == 0);
*error_string = NULL;
return value_new_bool (is_NA);
}
return value_new_int (retval);
}
return value_new_bool (FALSE);
}
static char *help_iserr = {
......@@ -114,18 +109,17 @@ static Value *
gnumeric_iserr (Sheet *sheet, GList *expr_node_list,
int eval_col, int eval_row, char **error_string)
{
int res, retval = 0;
int res;
res = gnumeric_check_for_err (sheet, expr_node_list,
eval_col, eval_row, error_string);
if (res < 0)
return NULL;
if (res > 0)
{
if (strcmp (gnumeric_err_NA, *error_string))
retval = 1; /* Any error accept N/A */
if (res > 0) {
gboolean is_NA = (strcmp (gnumeric_err_NA, *error_string) == 0);
*error_string = NULL;
}
return value_new_int (retval);
return value_new_bool (!is_NA);
}
return value_new_bool (FALSE);
}
......
......@@ -6,9 +6,7 @@
*
*/
#include <config.h>
#include <gnome.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -7,12 +7,9 @@
* Morten Welinder <terra@diku.dk>
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "mathfunc.h"
#include "numbers.h"
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
......@@ -7,11 +7,9 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include <math.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "utils.h"
#include "func.h"
......
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