Commit 169f4952 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Style now needs to be initialised before formats.

2000-05-24  Morten Welinder  <terra@diku.dk>

	* src/main.c (gnumeric_main): Style now needs to be initialised
 	before formats.

	* src/number-match.c (format_match): Take a StyleFormat ** instead
 	of a char ** for the suggested format.  All callers changed.
	(format_parse_t): rename member format to format_str and
 	introduce new member format, a StyleFormat *.
	(format_match_define): Get a style at this point.

	* src/datetime.c (datetime_value_to_serial_raw): Don't supply a
 	format return variable to format_match since we aren't interested
 	in the result.

	* src/parse-util.c (parse_text_value_or_expr): Return a
 	StyleFormat * instead of a char *.  All callers changed.

	* src/expr.c (expr_parse_string): Take a StyleFormat ** instead of
 	a char ** for the suggested format.  All callers changed.

	* src/parser.y (make_string_return): Turn parser_desired_format
 	into a StyleFormat **.
	(gnumeric_expr_parser): Take a StyleFormat ** instead of a char **
 	for the suggested format.  All callers changed.

	* src/auto-format.c (auto_style_format_suggest): New function.


	* src/sheet-style.c (sheet_style_optimize): Include adjacent
 	ranges in the list of styles to consider.  Handle intervening
 	styles better.  Don't stop searching for matching pairs just
 	because we merge -- only when the merge kills the slave.

	* src/ranges.c (range_dump): Don't print "\n".  All callers
 	changed as needed.

	* src/sheet-style.c (sheet_style_optimize, sheet_styles_dump):
 	Send all debugging output to stderr.  (As opposed to half stderr
 	and half stdout.)
parent 45e0d807
2000-05-24 Morten Welinder <terra@diku.dk>
* src/main.c (gnumeric_main): Style now needs to be initialised
before formats.
* src/number-match.c (format_match): Take a StyleFormat ** instead
of a char ** for the suggested format. All callers changed.
(format_parse_t): rename member format to format_str and
introduce new member format, a StyleFormat *.
(format_match_define): Get a style at this point.
* src/datetime.c (datetime_value_to_serial_raw): Don't supply a
format return variable to format_match since we aren't interested
in the result.
* src/parse-util.c (parse_text_value_or_expr): Return a
StyleFormat * instead of a char *. All callers changed.
* src/expr.c (expr_parse_string): Take a StyleFormat ** instead of
a char ** for the suggested format. All callers changed.
* src/parser.y (make_string_return): Turn parser_desired_format
into a StyleFormat **.
(gnumeric_expr_parser): Take a StyleFormat ** instead of a char **
for the suggested format. All callers changed.
* src/auto-format.c (auto_style_format_suggest): New function.
* src/sheet-style.c (sheet_style_optimize): Include adjacent
ranges in the list of styles to consider. Handle intervening
styles better. Don't stop searching for matching pairs just
because we merge -- only when the merge kills the slave.
* src/ranges.c (range_dump): Don't print "\n". All callers
changed as needed.
* src/sheet-style.c (sheet_style_optimize, sheet_styles_dump):
Send all debugging output to stderr. (As opposed to half stderr
and half stdout.)
2000-05-24 Jody Goldberg <jgoldberg@home.com> 2000-05-24 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_expr_internal) : Actually assign the format * src/cell.c (cell_set_expr_internal) : Actually assign the format
......
2000-05-24 Morten Welinder <terra@diku.dk>
* src/main.c (gnumeric_main): Style now needs to be initialised
before formats.
* src/number-match.c (format_match): Take a StyleFormat ** instead
of a char ** for the suggested format. All callers changed.
(format_parse_t): rename member format to format_str and
introduce new member format, a StyleFormat *.
(format_match_define): Get a style at this point.
* src/datetime.c (datetime_value_to_serial_raw): Don't supply a
format return variable to format_match since we aren't interested
in the result.
* src/parse-util.c (parse_text_value_or_expr): Return a
StyleFormat * instead of a char *. All callers changed.
* src/expr.c (expr_parse_string): Take a StyleFormat ** instead of
a char ** for the suggested format. All callers changed.
* src/parser.y (make_string_return): Turn parser_desired_format
into a StyleFormat **.
(gnumeric_expr_parser): Take a StyleFormat ** instead of a char **
for the suggested format. All callers changed.
* src/auto-format.c (auto_style_format_suggest): New function.
* src/sheet-style.c (sheet_style_optimize): Include adjacent
ranges in the list of styles to consider. Handle intervening
styles better. Don't stop searching for matching pairs just
because we merge -- only when the merge kills the slave.
* src/ranges.c (range_dump): Don't print "\n". All callers
changed as needed.
* src/sheet-style.c (sheet_style_optimize, sheet_styles_dump):
Send all debugging output to stderr. (As opposed to half stderr
and half stdout.)
2000-05-24 Jody Goldberg <jgoldberg@home.com> 2000-05-24 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_expr_internal) : Actually assign the format * src/cell.c (cell_set_expr_internal) : Actually assign the format
......
...@@ -3,6 +3,11 @@ Gnumeric 0.55 ...@@ -3,6 +3,11 @@ Gnumeric 0.55
Jody: Jody:
* Speedup workbook exit, copy/paste. * Speedup workbook exit, copy/paste.
Morten:
* Changed a bunch of internals to work with StyleFormats instead
of throwing strings around.
* Improved the optimization of styles.
Translations: Translations:
* Updated: de (Karl), ja (Oka), no (Kjartan), and more. * Updated: de (Karl), ja (Oka), no (Kjartan), and more.
* Updates not new, but not mentioned the last time: it (Leandro) * Updates not new, but not mentioned the last time: it (Leandro)
......
2000-05-24 Morten Welinder <terra@diku.dk>
* src/main.c (gnumeric_main): Style now needs to be initialised
before formats.
* src/number-match.c (format_match): Take a StyleFormat ** instead
of a char ** for the suggested format. All callers changed.
(format_parse_t): rename member format to format_str and
introduce new member format, a StyleFormat *.
(format_match_define): Get a style at this point.
* src/datetime.c (datetime_value_to_serial_raw): Don't supply a
format return variable to format_match since we aren't interested
in the result.
* src/parse-util.c (parse_text_value_or_expr): Return a
StyleFormat * instead of a char *. All callers changed.
* src/expr.c (expr_parse_string): Take a StyleFormat ** instead of
a char ** for the suggested format. All callers changed.
* src/parser.y (make_string_return): Turn parser_desired_format
into a StyleFormat **.
(gnumeric_expr_parser): Take a StyleFormat ** instead of a char **
for the suggested format. All callers changed.
* src/auto-format.c (auto_style_format_suggest): New function.
* src/sheet-style.c (sheet_style_optimize): Include adjacent
ranges in the list of styles to consider. Handle intervening
styles better. Don't stop searching for matching pairs just
because we merge -- only when the merge kills the slave.
* src/ranges.c (range_dump): Don't print "\n". All callers
changed as needed.
* src/sheet-style.c (sheet_style_optimize, sheet_styles_dump):
Send all debugging output to stderr. (As opposed to half stderr
and half stdout.)
2000-05-24 Jody Goldberg <jgoldberg@home.com> 2000-05-24 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_expr_internal) : Actually assign the format * src/cell.c (cell_set_expr_internal) : Actually assign the format
......
2000-05-24 Morten Welinder <terra@diku.dk>
* src/main.c (gnumeric_main): Style now needs to be initialised
before formats.
* src/number-match.c (format_match): Take a StyleFormat ** instead
of a char ** for the suggested format. All callers changed.
(format_parse_t): rename member format to format_str and
introduce new member format, a StyleFormat *.
(format_match_define): Get a style at this point.
* src/datetime.c (datetime_value_to_serial_raw): Don't supply a
format return variable to format_match since we aren't interested
in the result.
* src/parse-util.c (parse_text_value_or_expr): Return a
StyleFormat * instead of a char *. All callers changed.
* src/expr.c (expr_parse_string): Take a StyleFormat ** instead of
a char ** for the suggested format. All callers changed.
* src/parser.y (make_string_return): Turn parser_desired_format
into a StyleFormat **.
(gnumeric_expr_parser): Take a StyleFormat ** instead of a char **
for the suggested format. All callers changed.
* src/auto-format.c (auto_style_format_suggest): New function.
* src/sheet-style.c (sheet_style_optimize): Include adjacent
ranges in the list of styles to consider. Handle intervening
styles better. Don't stop searching for matching pairs just
because we merge -- only when the merge kills the slave.
* src/ranges.c (range_dump): Don't print "\n". All callers
changed as needed.
* src/sheet-style.c (sheet_style_optimize, sheet_styles_dump):
Send all debugging output to stderr. (As opposed to half stderr
and half stdout.)
2000-05-24 Jody Goldberg <jgoldberg@home.com> 2000-05-24 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_expr_internal) : Actually assign the format * src/cell.c (cell_set_expr_internal) : Actually assign the format
......
2000-05-24 Morten Welinder <terra@diku.dk>
* src/main.c (gnumeric_main): Style now needs to be initialised
before formats.
* src/number-match.c (format_match): Take a StyleFormat ** instead
of a char ** for the suggested format. All callers changed.
(format_parse_t): rename member format to format_str and
introduce new member format, a StyleFormat *.
(format_match_define): Get a style at this point.
* src/datetime.c (datetime_value_to_serial_raw): Don't supply a
format return variable to format_match since we aren't interested
in the result.
* src/parse-util.c (parse_text_value_or_expr): Return a
StyleFormat * instead of a char *. All callers changed.
* src/expr.c (expr_parse_string): Take a StyleFormat ** instead of
a char ** for the suggested format. All callers changed.
* src/parser.y (make_string_return): Turn parser_desired_format
into a StyleFormat **.
(gnumeric_expr_parser): Take a StyleFormat ** instead of a char **
for the suggested format. All callers changed.
* src/auto-format.c (auto_style_format_suggest): New function.
* src/sheet-style.c (sheet_style_optimize): Include adjacent
ranges in the list of styles to consider. Handle intervening
styles better. Don't stop searching for matching pairs just
because we merge -- only when the merge kills the slave.
* src/ranges.c (range_dump): Don't print "\n". All callers
changed as needed.
* src/sheet-style.c (sheet_style_optimize, sheet_styles_dump):
Send all debugging output to stderr. (As opposed to half stderr
and half stdout.)
2000-05-24 Jody Goldberg <jgoldberg@home.com> 2000-05-24 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_expr_internal) : Actually assign the format * src/cell.c (cell_set_expr_internal) : Actually assign the format
......
2000-05-24 Morten Welinder <terra@diku.dk>
* src/main.c (gnumeric_main): Style now needs to be initialised
before formats.
* src/number-match.c (format_match): Take a StyleFormat ** instead
of a char ** for the suggested format. All callers changed.
(format_parse_t): rename member format to format_str and
introduce new member format, a StyleFormat *.
(format_match_define): Get a style at this point.
* src/datetime.c (datetime_value_to_serial_raw): Don't supply a
format return variable to format_match since we aren't interested
in the result.
* src/parse-util.c (parse_text_value_or_expr): Return a
StyleFormat * instead of a char *. All callers changed.
* src/expr.c (expr_parse_string): Take a StyleFormat ** instead of
a char ** for the suggested format. All callers changed.
* src/parser.y (make_string_return): Turn parser_desired_format
into a StyleFormat **.
(gnumeric_expr_parser): Take a StyleFormat ** instead of a char **
for the suggested format. All callers changed.
* src/auto-format.c (auto_style_format_suggest): New function.
* src/sheet-style.c (sheet_style_optimize): Include adjacent
ranges in the list of styles to consider. Handle intervening
styles better. Don't stop searching for matching pairs just
because we merge -- only when the merge kills the slave.
* src/ranges.c (range_dump): Don't print "\n". All callers
changed as needed.
* src/sheet-style.c (sheet_style_optimize, sheet_styles_dump):
Send all debugging output to stderr. (As opposed to half stderr
and half stdout.)
2000-05-24 Jody Goldberg <jgoldberg@home.com> 2000-05-24 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_expr_internal) : Actually assign the format * src/cell.c (cell_set_expr_internal) : Actually assign the format
......
2000-05-24 Morten Welinder <terra@diku.dk>
* src/main.c (gnumeric_main): Style now needs to be initialised
before formats.
* src/number-match.c (format_match): Take a StyleFormat ** instead
of a char ** for the suggested format. All callers changed.
(format_parse_t): rename member format to format_str and
introduce new member format, a StyleFormat *.
(format_match_define): Get a style at this point.
* src/datetime.c (datetime_value_to_serial_raw): Don't supply a
format return variable to format_match since we aren't interested
in the result.
* src/parse-util.c (parse_text_value_or_expr): Return a
StyleFormat * instead of a char *. All callers changed.
* src/expr.c (expr_parse_string): Take a StyleFormat ** instead of
a char ** for the suggested format. All callers changed.
* src/parser.y (make_string_return): Turn parser_desired_format
into a StyleFormat **.
(gnumeric_expr_parser): Take a StyleFormat ** instead of a char **
for the suggested format. All callers changed.
* src/auto-format.c (auto_style_format_suggest): New function.
* src/sheet-style.c (sheet_style_optimize): Include adjacent
ranges in the list of styles to consider. Handle intervening
styles better. Don't stop searching for matching pairs just
because we merge -- only when the merge kills the slave.
* src/ranges.c (range_dump): Don't print "\n". All callers
changed as needed.
* src/sheet-style.c (sheet_style_optimize, sheet_styles_dump):
Send all debugging output to stderr. (As opposed to half stderr
and half stdout.)
2000-05-24 Jody Goldberg <jgoldberg@home.com> 2000-05-24 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_expr_internal) : Actually assign the format * src/cell.c (cell_set_expr_internal) : Actually assign the format
......
...@@ -796,7 +796,6 @@ static Value * ...@@ -796,7 +796,6 @@ static Value *
gnumeric_n (FunctionEvalInfo *ei, Value **argv) gnumeric_n (FunctionEvalInfo *ei, Value **argv)
{ {
const char *str; const char *str;
char *format;
Value *v; Value *v;
if (argv[0]->type == VALUE_BOOLEAN) if (argv[0]->type == VALUE_BOOLEAN)
...@@ -809,7 +808,7 @@ gnumeric_n (FunctionEvalInfo *ei, Value **argv) ...@@ -809,7 +808,7 @@ gnumeric_n (FunctionEvalInfo *ei, Value **argv)
return value_new_error (ei->pos, gnumeric_err_NUM); return value_new_error (ei->pos, gnumeric_err_NUM);
str = argv[0]->v_str.val->str; str = argv[0]->v_str.val->str;
if (NULL != (v = format_match (str, &format))) if (NULL != (v = format_match (str, NULL)))
return v; return v;
return value_new_float (0); return value_new_float (0);
} }
......
...@@ -756,8 +756,7 @@ gnumeric_text (FunctionEvalInfo *ei, Value **args) ...@@ -756,8 +756,7 @@ gnumeric_text (FunctionEvalInfo *ei, Value **args)
} }
if (arg->type == VALUE_STRING) { if (arg->type == VALUE_STRING) {
char *format = NULL; Value *match = format_match (arg->v_str.val->str, NULL);
Value *match = format_match (arg->v_str.val->str, &format);
ok = (match != NULL); ok = (match != NULL);
if (ok) if (ok)
tmp = match; tmp = match;
...@@ -894,7 +893,6 @@ gnumeric_value (FunctionEvalInfo *ei, Value **argv) ...@@ -894,7 +893,6 @@ gnumeric_value (FunctionEvalInfo *ei, Value **argv)
{ {
char *arg, *p, *q; char *arg, *p, *q;
Value *v; Value *v;
char *format;
switch (argv[0]->type) { switch (argv[0]->type) {
case VALUE_EMPTY: case VALUE_EMPTY:
...@@ -911,7 +909,7 @@ gnumeric_value (FunctionEvalInfo *ei, Value **argv) ...@@ -911,7 +909,7 @@ gnumeric_value (FunctionEvalInfo *ei, Value **argv)
} }
*q = 0; *q = 0;
v = format_match (arg, &format); v = format_match (arg, NULL);
free (arg); free (arg);
if (v) if (v)
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "expr.h" #include "expr.h"
#include "cell.h" #include "cell.h"
#include "workbook.h" #include "workbook.h"
#include "style.h"
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/* /*
...@@ -110,7 +111,7 @@ cb_af_suggest (Sheet *sheet, int col, int row, Cell *cell, void *_data) ...@@ -110,7 +111,7 @@ cb_af_suggest (Sheet *sheet, int col, int row, Cell *cell, void *_data)
} }
static AutoFormatTypes static AutoFormatTypes
do_af_suggest (const ExprTree *expr, EvalPos const *epos, char **explicit) do_af_suggest (const ExprTree *expr, const EvalPos *epos, char **explicit)
{ {
switch (expr->any.oper) { switch (expr->any.oper) {
case OPER_EQUAL: case OPER_EQUAL:
...@@ -251,7 +252,7 @@ do_af_suggest (const ExprTree *expr, EvalPos const *epos, char **explicit) ...@@ -251,7 +252,7 @@ do_af_suggest (const ExprTree *expr, EvalPos const *epos, char **explicit)
} }
static AutoFormatTypes static AutoFormatTypes
do_af_suggest_list (GList *list, EvalPos const *epos, char **explicit) do_af_suggest_list (GList *list, const EvalPos *epos, char **explicit)
{ {
AutoFormatTypes typ = AF_UNKNOWN; AutoFormatTypes typ = AF_UNKNOWN;
while (list && (typ == AF_UNKNOWN || typ == AF_UNITLESS)) { while (list && (typ == AF_UNKNOWN || typ == AF_UNITLESS)) {
...@@ -264,7 +265,7 @@ do_af_suggest_list (GList *list, EvalPos const *epos, char **explicit) ...@@ -264,7 +265,7 @@ do_af_suggest_list (GList *list, EvalPos const *epos, char **explicit)
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
char * char *
auto_format_suggest (const ExprTree *expr, EvalPos *epos) auto_format_suggest (const ExprTree *expr, const EvalPos *epos)
{ {
char *explicit = NULL; char *explicit = NULL;
...@@ -306,3 +307,20 @@ auto_format_suggest (const ExprTree *expr, EvalPos *epos) ...@@ -306,3 +307,20 @@ auto_format_suggest (const ExprTree *expr, EvalPos *epos)
} }
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/* This is just a StyleFormat version of the above. Eventually, this needs */
/* to be the primitive and the above should go away. */
StyleFormat *
auto_style_format_suggest (const ExprTree *expr, const EvalPos *epos)
{
char *format;
StyleFormat *result = NULL;
format = auto_format_suggest (expr, epos);
if (format) {
result = style_format_new (format);
g_free (format);
}
return result;
}
/* ------------------------------------------------------------------------- */
...@@ -56,6 +56,7 @@ void auto_format_init (void); ...@@ -56,6 +56,7 @@ void auto_format_init (void);
void auto_format_shutdown (void); void auto_format_shutdown (void);
void auto_format_function_result (FunctionDefinition *fd, AutoFormatTypes res); void auto_format_function_result (FunctionDefinition *fd, AutoFormatTypes res);
char *auto_format_suggest (const ExprTree *expr, EvalPos *ppos); char *auto_format_suggest (const ExprTree *expr, const EvalPos *ppos);
StyleFormat *auto_style_format_suggest (const ExprTree *expr, const EvalPos *epos);
#endif #endif
...@@ -278,7 +278,7 @@ cell_relocate (Cell *cell, gboolean check_bounds, gboolean unlink) ...@@ -278,7 +278,7 @@ cell_relocate (Cell *cell, gboolean check_bounds, gboolean unlink)
void void
cell_set_text (Cell *cell, char const *text) cell_set_text (Cell *cell, char const *text)
{ {
char const *format; StyleFormat *format;
Value *val; Value *val;
ExprTree *expr; ExprTree *expr;
EvalPos pos; EvalPos pos;
...@@ -292,19 +292,17 @@ cell_set_text (Cell *cell, char const *text) ...@@ -292,19 +292,17 @@ cell_set_text (Cell *cell, char const *text)
NULL /* TODO : Use assigned format ? */); NULL /* TODO : Use assigned format ? */);
if (val != NULL) { /* String was a value */ if (val != NULL) { /* String was a value */
/* If there was a prefered format remember it */
StyleFormat * const fmt = (format != NULL)
? style_format_new (format) : NULL;
cell_cleanout (cell); cell_cleanout (cell);
cell->cell_flags &= ~CELL_HAS_EXPRESSION; cell->cell_flags &= ~CELL_HAS_EXPRESSION;
cell->value = val; cell->value = val;
cell->u.entered_text = string_get (text); cell->u.entered_text = string_get (text);
cell->format = fmt; cell->format = format;
cell_render_value (cell); cell_render_value (cell);
} else { /* String was an expression */ } else { /* String was an expression */
cell_set_expr (cell, expr, format); /* FIXME */
cell_set_expr (cell, expr, format ? format->format : NULL);
if (format) style_format_unref (format);
expr_tree_unref (expr); expr_tree_unref (expr);
} }
cell_dirty (cell); cell_dirty (cell);
......
...@@ -76,11 +76,13 @@ datetime_value_to_serial_raw (const Value *v) ...@@ -76,11 +76,13 @@ datetime_value_to_serial_raw (const Value *v)
if (VALUE_IS_NUMBER (v)) if (VALUE_IS_NUMBER (v))
serial = value_get_as_float (v); serial = value_get_as_float (v);
else { else {
char *str, *format; char *str;
Value *conversion; Value *conversion;
str = value_get_as_string (v); str = value_get_as_string (v);
if (NULL != (conversion = format_match (str, &format))) { conversion = format_match (str, NULL);
if (conversion) {
if (VALUE_IS_NUMBER (conversion)) if (VALUE_IS_NUMBER (conversion))
serial = value_get_as_float (conversion); serial = value_get_as_float (conversion);
else else
......
...@@ -477,7 +477,6 @@ stf_preview_format_line (RenderData_t *renderdata, GSList *data, int colcount) ...@@ -477,7 +477,6 @@ stf_preview_format_line (RenderData_t *renderdata, GSList *data, int colcount)
Value *value; Value *value;
StyleFormat *sf; StyleFormat *sf;
StyleColor *color; StyleColor *color;
char *format;
char *celltext; char *celltext;
if (!iterator || !iterator->data) { if (!iterator || !iterator->data) {
...@@ -487,7 +486,7 @@ stf_preview_format_line (RenderData_t *renderdata, GSList *data, int colcount) ...@@ -487,7 +486,7 @@ stf_preview_format_line (RenderData_t *renderdata, GSList *data, int colcount)
} }
/* Formatting */ /* Formatting */
if (NULL == (value = format_match (iterator->data, &format))) if (NULL == (value = format_match (iterator->data, NULL)))
value = value_new_string (iterator->data); value = value_new_string (iterator->data);
sf = style_format_new (g_ptr_array_index (renderdata->colformats, col)); sf = style_format_new (g_ptr_array_index (renderdata->colformats, col));
......
...@@ -184,7 +184,7 @@ expr_tree_get_const_str (ExprTree const *expr) ...@@ -184,7 +184,7 @@ expr_tree_get_const_str (ExprTree const *expr)
ExprTree * ExprTree *
expr_parse_string (char const *expr, ParsePos const *pp, expr_parse_string (char const *expr, ParsePos const *pp,
char **desired_format, char **error_msg) StyleFormat **desired_format, char **error_msg)
{ {
ExprTree *tree; ExprTree *tree;
g_return_val_if_fail (expr != NULL, NULL); g_return_val_if_fail (expr != NULL, NULL);
......
...@@ -147,7 +147,7 @@ struct _NamedExpression { ...@@ -147,7 +147,7 @@ struct _NamedExpression {
}; };
ExprTree *expr_parse_string (char const *expr, ParsePos const *pp, ExprTree *expr_parse_string (char const *expr, ParsePos const *pp,
char **desired_format, char **error_msg); StyleFormat **desired_format, char **error_msg);
ExprTree *expr_tree_duplicate (ExprTree *expr); ExprTree *expr_tree_duplicate (ExprTree *expr);
char *expr_decode_tree (ExprTree *tree, ParsePos const *fp); char *expr_decode_tree (ExprTree *tree, ParsePos const *fp);
......
...@@ -796,7 +796,6 @@ static Value * ...@@ -796,7 +796,6 @@ static Value *
gnumeric_n (FunctionEvalInfo *ei, Value **argv) gnumeric_n (FunctionEvalInfo *ei, Value **argv)
{ {
const char *str; const char *str;
char *format;
Value *v; Value *v;
if (argv[0]->type == VALUE_BOOLEAN) if (argv[0]->type == VALUE_BOOLEAN)
...@@ -809,7 +808,7 @@ gnumeric_n (FunctionEvalInfo *ei, Value **argv) ...@@ -809,7 +808,7 @@ gnumeric_n (FunctionEvalInfo *ei, Value **argv)
return value_new_error (ei->pos, gnumeric_err_NUM); return value_new_error (ei->pos, gnumeric_err_NUM);
str = argv[0]->v_str.val->str; str = argv[0]->v_str.val->str;
if (NULL != (v = format_match (str, &format))) if (NULL != (v = format_match (str, NULL)))
return v; return v;
return value_new_float (0); return value_new_float (0);
}