47 static void gnc_num_cell_init (
NumCell *cell);
53 gnc_parse_num (
const char *
string,
long int *num)
63 number = strtol (
string, NULL, 10);
65 if ((number == LONG_MIN) || (number == LONG_MAX))
75 gnc_num_cell_modify_verify (
BasicCell *_cell,
85 gboolean accel = FALSE;
94 gnc_basic_cell_set_value_internal (&cell->cell, newval);
98 change_chars = g_utf8_strlen (change, -1);
100 if ((change_chars == 0) ||
104 gnc_basic_cell_set_value_internal (&cell->cell, newval);
110 is_num = gnc_parse_num (_cell->value, &number);
112 if (is_num && (number < 0))
115 uc = g_utf8_get_char (change);
147 if (accel && !is_num && (g_strcmp0(_cell->value,
"") != 0))
155 number = cell->next_num;
158 snprintf (buff,
sizeof(buff),
"%ld", number);
160 if (g_strcmp0 (buff,
"") == 0)
163 gnc_basic_cell_set_value_internal (&cell->cell, buff);
165 *cursor_position = -1;
170 gnc_basic_cell_set_value_internal (&cell->cell, newval);
174 gnc_num_cell_new (
void)
180 gnc_num_cell_init (cell);
186 gnc_num_cell_set_value_internal (
BasicCell *_cell,
const char *str)
190 if (!cell->next_num_set)
194 if (gnc_parse_num (str, &number))
195 cell->next_num = number + 1;
198 gnc_basic_cell_set_value_internal (_cell, str);
202 gnc_num_cell_set_value (
NumCell *cell,
const char *str)
207 gnc_num_cell_set_value_internal (&cell->cell, str);
211 gnc_num_cell_set_last_num (
NumCell *cell,
const char *str)
218 if (gnc_parse_num (str, &number))
220 cell->next_num = number + 1;
221 cell->next_num_set = TRUE;
229 gnc_num_cell_init (
NumCell *cell)
231 gnc_basic_cell_init (&(cell->cell));
234 cell->next_num_set = FALSE;
236 cell->cell.modify_verify = gnc_num_cell_modify_verify;
237 cell->cell.set_value = gnc_num_cell_set_value_internal;
gboolean gnc_strisnum(const gchar *s)
All type declarations for the whole Gnucash engine.