Commit e39fd491 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Do not hard code the argument seperator, it needs to change depending on


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

	* src/expr.c (do_expr_tree_to_string) : Do not hard code the argument
	  seperator, it needs to change depending on the locale.
	* src/dialogs/dialog-function-wizard.c (formula_guru_set_expr) :
	  Ditto.
parent a8cf3f69
2000-08-11 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (do_expr_tree_to_string) : Do not hard code the argument
seperator, it needs to change depending on the locale.
* src/dialogs/dialog-function-wizard.c (formula_guru_set_expr) :
Ditto.
2000-08-10 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c : All callers to float_range_function ignore
blanks.
* src/functions/fn-math.c : Ditto.
* src/functions/fn-database.c (find_column_of_field) : Use
cell_get_rendered_text rather than entered_text.
......
2000-08-11 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (do_expr_tree_to_string) : Do not hard code the argument
seperator, it needs to change depending on the locale.
* src/dialogs/dialog-function-wizard.c (formula_guru_set_expr) :
Ditto.
2000-08-10 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c : All callers to float_range_function ignore
blanks.
* src/functions/fn-math.c : Ditto.
* src/functions/fn-database.c (find_column_of_field) : Use
cell_get_rendered_text rather than entered_text.
......
......@@ -8,7 +8,7 @@ Jody:
* Applix support mostly functional.
* Improve support for named expressions.
* Name and Graph gurus support range selection.
* Deadkey support.
* Improve internation keyboard support.
* Fix XIRR and friends.
John Gill:
......
2000-08-11 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (do_expr_tree_to_string) : Do not hard code the argument
seperator, it needs to change depending on the locale.
* src/dialogs/dialog-function-wizard.c (formula_guru_set_expr) :
Ditto.
2000-08-10 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c : All callers to float_range_function ignore
blanks.
* src/functions/fn-math.c : Ditto.
* src/functions/fn-database.c (find_column_of_field) : Use
cell_get_rendered_text rather than entered_text.
......
2000-08-11 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (do_expr_tree_to_string) : Do not hard code the argument
seperator, it needs to change depending on the locale.
* src/dialogs/dialog-function-wizard.c (formula_guru_set_expr) :
Ditto.
2000-08-10 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c : All callers to float_range_function ignore
blanks.
* src/functions/fn-math.c : Ditto.
* src/functions/fn-database.c (find_column_of_field) : Use
cell_get_rendered_text rather than entered_text.
......
2000-08-11 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (do_expr_tree_to_string) : Do not hard code the argument
seperator, it needs to change depending on the locale.
* src/dialogs/dialog-function-wizard.c (formula_guru_set_expr) :
Ditto.
2000-08-10 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c : All callers to float_range_function ignore
blanks.
* src/functions/fn-math.c : Ditto.
* src/functions/fn-database.c (find_column_of_field) : Use
cell_get_rendered_text rather than entered_text.
......
2000-08-11 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (do_expr_tree_to_string) : Do not hard code the argument
seperator, it needs to change depending on the locale.
* src/dialogs/dialog-function-wizard.c (formula_guru_set_expr) :
Ditto.
2000-08-10 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c : All callers to float_range_function ignore
blanks.
* src/functions/fn-math.c : Ditto.
* src/functions/fn-database.c (find_column_of_field) : Use
cell_get_rendered_text rather than entered_text.
......
2000-08-11 Jody Goldberg <jgoldberg@home.com>
* src/expr.c (do_expr_tree_to_string) : Do not hard code the argument
seperator, it needs to change depending on the locale.
* src/dialogs/dialog-function-wizard.c (formula_guru_set_expr) :
Ditto.
2000-08-10 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-stat.c : All callers to float_range_function ignore
blanks.
* src/functions/fn-math.c : Ditto.
* src/functions/fn-database.c (find_column_of_field) : Use
cell_get_rendered_text rather than entered_text.
......
/* vim: set sw=8:
* $Id$
*/
/* vim: set sw=8: */
/*
* dialog-function-wizard.c: The formula guru
......@@ -34,6 +32,7 @@
#include "cell.h"
#include "expr.h"
#include "func.h"
#include <locale.h>
#define MAX_ARGS_DISPLAYED 4
......@@ -93,6 +92,8 @@ formula_guru_set_expr (FormulaGuruState *state, int index, gboolean set_text)
GtkEntry *entry;
GString *str;
int pos = 0, i;
char sep;
struct lconv *locinfo;
g_return_if_fail (state != NULL);
g_return_if_fail (state->fd != NULL);
......@@ -106,13 +107,21 @@ formula_guru_set_expr (FormulaGuruState *state, int index, gboolean set_text)
g_string_append (str, function_def_get_name (state->fd));
g_string_append_c (str, '(');
/* Use comma as the arg seperator unless the decimal point is a
* comma, in which case use a semi-colon
*/
sep = ',';
locinfo = localeconv ();
if (locinfo->decimal_point && !strcmp (locinfo->decimal_point, ","))
sep = ';';
for (i = 0; i < state->args->len; i++) {
ArgumentState *as = g_ptr_array_index (state->args, i);
gchar *val = gtk_entry_get_text (as->entry);
if (!as->is_optional || i <= state->max_arg || i <= index || strlen (val)) {
if (i > 0)
g_string_append_c (str, ',');
g_string_append_c (str, sep);
if (i == index)
pos = str->len +
gtk_editable_get_position (GTK_EDITABLE (as->entry));
......@@ -621,6 +630,8 @@ formula_guru_init (FormulaGuruState *state, ExprTree const *expr, Cell const *ce
gtk_widget_show_all (state->arg_table);
}
/* Lifecyle management */
workbook_edit_attach_guru (state->wb, state->dialog);
gtk_signal_connect (GTK_OBJECT (state->dialog), "destroy",
GTK_SIGNAL_FUNC (cb_formula_guru_destroy),
state);
......@@ -639,7 +650,6 @@ formula_guru_init (FormulaGuruState *state, ExprTree const *expr, Cell const *ce
gtk_window_set_transient_for (GTK_WINDOW (state->dialog),
GTK_WINDOW (state->wb->toplevel));
workbook_edit_attach_guru (state->wb, state->dialog);
formula_guru_set_expr (state, 0, TRUE);
formula_guru_set_rolled_state (state, FALSE);
......
/* vim: set sw=8:
* $Id$
*/
/* vim: set sw=8: */
/*
* dialog-function-wizard.c: The formula guru
......@@ -34,6 +32,7 @@
#include "cell.h"
#include "expr.h"
#include "func.h"
#include <locale.h>
#define MAX_ARGS_DISPLAYED 4
......@@ -93,6 +92,8 @@ formula_guru_set_expr (FormulaGuruState *state, int index, gboolean set_text)
GtkEntry *entry;
GString *str;
int pos = 0, i;
char sep;
struct lconv *locinfo;
g_return_if_fail (state != NULL);
g_return_if_fail (state->fd != NULL);
......@@ -106,13 +107,21 @@ formula_guru_set_expr (FormulaGuruState *state, int index, gboolean set_text)
g_string_append (str, function_def_get_name (state->fd));
g_string_append_c (str, '(');
/* Use comma as the arg seperator unless the decimal point is a
* comma, in which case use a semi-colon
*/
sep = ',';
locinfo = localeconv ();
if (locinfo->decimal_point && !strcmp (locinfo->decimal_point, ","))
sep = ';';
for (i = 0; i < state->args->len; i++) {
ArgumentState *as = g_ptr_array_index (state->args, i);
gchar *val = gtk_entry_get_text (as->entry);
if (!as->is_optional || i <= state->max_arg || i <= index || strlen (val)) {
if (i > 0)
g_string_append_c (str, ',');
g_string_append_c (str, sep);
if (i == index)
pos = str->len +
gtk_editable_get_position (GTK_EDITABLE (as->entry));
......@@ -621,6 +630,8 @@ formula_guru_init (FormulaGuruState *state, ExprTree const *expr, Cell const *ce
gtk_widget_show_all (state->arg_table);
}
/* Lifecyle management */
workbook_edit_attach_guru (state->wb, state->dialog);
gtk_signal_connect (GTK_OBJECT (state->dialog), "destroy",
GTK_SIGNAL_FUNC (cb_formula_guru_destroy),
state);
......@@ -639,7 +650,6 @@ formula_guru_init (FormulaGuruState *state, ExprTree const *expr, Cell const *ce
gtk_window_set_transient_for (GTK_WINDOW (state->dialog),
GTK_WINDOW (state->wb->toplevel));
workbook_edit_attach_guru (state->wb, state->dialog);
formula_guru_set_expr (state, 0, TRUE);
formula_guru_set_rolled_state (state, FALSE);
......
......@@ -1115,10 +1115,19 @@ do_expr_tree_to_string (ExprTree const *tree, ParsePos const *pp,
argc = g_list_length (arg_list);
if (argc) {
struct lconv *locinfo;
int i, len = 0;
args = g_malloc (sizeof (char *) * argc);
/* Use comma as the arg seperator unless the decimal point is a
* comma, in which case use a semi-colon
*/
char *sep = ",";
locinfo = localeconv ();
if (locinfo->decimal_point && !strcmp (locinfo->decimal_point, ","))
sep = ";";
i = 0;
args = g_malloc (sizeof (char *) * argc);
for (l = arg_list; l; l = l->next, i++) {
ExprTree *t = l->data;
......@@ -1133,7 +1142,7 @@ do_expr_tree_to_string (ExprTree const *tree, ParsePos const *pp,
for (l = arg_list; l; l = l->next, i++) {
strcat (sum, args [i]);
if (l->next)
strcat (sum, ",");
strcat (sum, sep);
}
res = g_strconcat (function_def_get_name (fd),
......
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