Commit 71a6d208 authored by Jody Goldberg's avatar Jody Goldberg
Browse files

Save the entered text.

parent bb65a5f5
1999-11-12 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_text_simple) : Store the entered text.
* src/formats.c (cell_format_is_number) : Only non simple currencies
require a space.
1999-11-12 Miguel de Icaza <miguel@gnu.org>
* src/format.c (format_number): Use alloca here.
......
1999-11-12 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_text_simple) : Store the entered text.
* src/formats.c (cell_format_is_number) : Only non simple currencies
require a space.
1999-11-12 Miguel de Icaza <miguel@gnu.org>
* src/format.c (format_number): Use alloca here.
......
......@@ -495,6 +495,7 @@ cell_set_text_simple (Cell *cell, const char *text)
}
cell_render_value (cell);
cell->entered_text = string_get (text);
}
}
......
......@@ -373,7 +373,10 @@ draw_format_preview (FormatState *state)
case FMT_CURRENCY :
g_string_append (new_format,
currency_symbols[state->format.currency_index].symbol);
g_string_append_c (new_format, ' ');
/* Non simple currencies require a spacer */
if (currency_symbols[state->format.currency_index].symbol[0] == '[')
g_string_append_c (new_format, ' ');
case FMT_NUMBER :
if (state->format.use_separator) {
......
......@@ -333,19 +333,20 @@ cell_format_is_number (char const * const fmt, FormatCharacteristics *info)
return FMT_UNKNOWN;
/* Check for prepended currency */
if (ptr[0] == '$' || ptr[1] == "") {
if (ptr[0] == '$' || ptr[1] == '') {
info->currency_symbol_index = (ptr[0] == '$') ? 1 : 2;
result = FMT_CURRENCY;
++ptr;
} else if (ptr[0] == '[' && ptr[1] == '$') {
char const * const end = strchr (ptr, ']');
if (end != NULL) {
if (end != NULL && end[1] == ' ') {
/* FIXME : Look up the correct index */
info->currency_symbol_index = 1;
result = FMT_CURRENCY;
ptr = end + 1;
}
} else
return FMT_UNKNOWN;
}
/* Check for thousands seperator */
......
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