Commit 76e697fb authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg
Browse files

Default the parse format to General. Eventually we can simply


2000-11-01  Jody Goldberg <jgoldberg@home.com>

	* src/xml-io.c (xml_read_cell) : Default the parse format to General.
	  Eventually we can simply cell_set_value to not guess that the
	  display format == the parse format.  However, that will require
	  changing all of the importers.  For now we can cheat, and supply
	  General as the format.

	* src/functions/fn-string.c (gnumeric_dollar) : use string_get_nocopy.
parent c5883e7c
......@@ -37,6 +37,11 @@ Release Critical
- New xml importer does not support the run length encoding of rows/cols
- cell_set_value is being called from the C locale rather than the selected
locale during xml restore. This is broken because it attempts to render the
entered_text using a format. This is done in the wrong locale.
We should get rid of 'entered_text' soon and just generate it as necessary.
- Fix Borders
Long term breakage
......
2000-11-01 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_read_cell) : Default the parse format to General.
Eventually we can simply cell_set_value to not guess that the
display format == the parse format. However, that will require
changing all of the importers. For now we can cheat, and supply
General as the format.
* src/functions/fn-string.c (gnumeric_dollar) : use string_get_nocopy.
2000-11-01 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (cellref_relocate) : inside is always calculatd based on
......
2000-11-01 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_read_cell) : Default the parse format to General.
Eventually we can simply cell_set_value to not guess that the
display format == the parse format. However, that will require
changing all of the importers. For now we can cheat, and supply
General as the format.
* src/functions/fn-string.c (gnumeric_dollar) : use string_get_nocopy.
2000-11-01 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (cellref_relocate) : inside is always calculatd based on
......
2000-11-01 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_read_cell) : Default the parse format to General.
Eventually we can simply cell_set_value to not guess that the
display format == the parse format. However, that will require
changing all of the importers. For now we can cheat, and supply
General as the format.
* src/functions/fn-string.c (gnumeric_dollar) : use string_get_nocopy.
2000-11-01 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (cellref_relocate) : inside is always calculatd based on
......
2000-11-01 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_read_cell) : Default the parse format to General.
Eventually we can simply cell_set_value to not guess that the
display format == the parse format. However, that will require
changing all of the importers. For now we can cheat, and supply
General as the format.
* src/functions/fn-string.c (gnumeric_dollar) : use string_get_nocopy.
2000-11-01 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (cellref_relocate) : inside is always calculatd based on
......
2000-11-01 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_read_cell) : Default the parse format to General.
Eventually we can simply cell_set_value to not guess that the
display format == the parse format. However, that will require
changing all of the importers. For now we can cheat, and supply
General as the format.
* src/functions/fn-string.c (gnumeric_dollar) : use string_get_nocopy.
2000-11-01 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (cellref_relocate) : inside is always calculatd based on
......
......@@ -1047,7 +1047,6 @@ static char *help_dollar = {
"@SEEALSO=FIXED, TEXT, VALUE")
};
/* FIXME: should use lc->[pn]_sign_posn, mon_thousands_sep, negative_sign */
static Value *
gnumeric_dollar (FunctionEvalInfo *ei, Value **argv)
{
......@@ -1096,8 +1095,7 @@ gnumeric_dollar (FunctionEvalInfo *ei, Value **argv)
/* FIXME: should use *lc->currency_symbol */
s[neg] = '$';
s[len + 1 + neg] = '\0';
v->v_str.val = string_get (s);
g_free (s);
v->v_str.val = string_get_nocopy (s);
value_release(ag[0]);
return v;
......
......@@ -411,6 +411,10 @@ cell_assign_value (Cell *cell, Value *v, StyleFormat *opt_fmt)
* user has assigned a non-std format. We need to improve the parser to handle
* all formats that exist within the workbook.
*
* FIXME FIXME FIXME : This is being called from other locales. however, we
* may be in the C locale while importing. Hence the rendered version of the
* entered_text is in C rather than the used selected locale.
*
* NOTE : This DOES check for array partitioning.
*/
void
......@@ -430,6 +434,7 @@ cell_set_value (Cell *cell, Value *v, StyleFormat *opt_fmt)
cell->value = v;
cell_render_value (cell);
#if 1
/* Be careful that a value passes as a string stays a string */
if (v->type == VALUE_STRING) {
/* TODO : add new string routine to avoid the extra copy */
......@@ -451,6 +456,19 @@ cell_set_value (Cell *cell, Value *v, StyleFormat *opt_fmt)
format_value (format, v, NULL, NULL, -1));
mstyle_unref (mstyle);
}
#else
/* TODO : use this version when we have converted all callers to pass
* in a parse format.
* Gnumeric's xml format is smart enough to store the parse format
* that generated the value. Other file formats (XL) are not as smart.
* as a result we need to guess.
*/
/* Be careful that a value passes as a string stays a string */
cell->entered_text = string_get_nocopy ((v->type == VALUE_STRING)
? g_strconcat ("\'", v->v_str.val->str, NULL)
/* If available use the supplied format, else use General */
: format_value (opt_fmt?opt_fmt:"General", v, NULL, NULL, -1));
#endif
}
/*
......
......@@ -1047,7 +1047,6 @@ static char *help_dollar = {
"@SEEALSO=FIXED, TEXT, VALUE")
};
/* FIXME: should use lc->[pn]_sign_posn, mon_thousands_sep, negative_sign */
static Value *
gnumeric_dollar (FunctionEvalInfo *ei, Value **argv)
{
......@@ -1096,8 +1095,7 @@ gnumeric_dollar (FunctionEvalInfo *ei, Value **argv)
/* FIXME: should use *lc->currency_symbol */
s[neg] = '$';
s[len + 1 + neg] = '\0';
v->v_str.val = string_get (s);
g_free (s);
v->v_str.val = string_get_nocopy (s);
value_release(ag[0]);
return v;
......
......@@ -2052,7 +2052,7 @@ xml_read_cell (XmlParseContext *ctxt, xmlNodePtr tree)
gboolean is_new_cell;
gboolean is_value = FALSE;
ValueType value_type = VALUE_EMPTY; /* Make compiler shut up */
StyleFormat *value_fmt = NULL;
StyleFormat *value_fmt = style_format_new_XL ("General", FALSE);
if (strcmp (tree->name, "Cell")) {
fprintf (stderr,
......
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