Commit d38098dc authored by Jukka-Pekka Iivonen's avatar Jukka-Pekka Iivonen Committed by jpekka
Browse files

New directory created for tools.

2002-03-06  Jukka-Pekka Iivonen  <jiivonen@hutcs.cs.hut.fi>

        * src/tools: New directory created for tools.

        * src/tools/solver: Moved src/solver-lp.c into here and split it
        into two files: src/tools/solver/solver.c and
        src/tools/solver/reports.c.  A _major_ rewrite.

        * src/tools/solver/lp_solve: Integrated key parts of an LGPLed
        linear programming toolkit called LP Solve 3.2.  (The whole
        package can be found from ftp://ftp.ics.ele.tue.nl/pub/lp_solve).
        Major clean up for making it to look like GNOME code.  LP Solve is
        written by Michel Berkelaar and others.  Thanks for the great
        work!

        * configure.in: Added src/tools/Makefile, src/tools/solver/Makefile,
        and src/tools/solver/lp_solve/Makefile.

        * src/Makefile.am: Added tools subdirectory.

        * src/mathfunc.[ch]: Removed all solver related functions.

        * src/solver.h, src/sheet.c: solver_lp_new renamed as
        solver_param_new.  solver_lp_destroy renamed as
        solver_param_destroy.

        * src/xml-io.c: Solver related changes.

        * samples/solver/production-plan.gnumeric: A Solver sample file.
parent 96c4750d
2002-03-06 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* src/tools: New directory created for tools.
* src/tools/solver: Moved src/solver-lp.c into here and split it
into two files: src/tools/solver/solver.c and
src/tools/solver/reports.c. A _major_ rewrite.
* src/tools/solver/lp_solve: Integrated key parts of an LGPLed
linear programming toolkit called LP Solve 3.2. (The whole
package can be found from ftp://ftp.ics.ele.tue.nl/pub/lp_solve).
Major clean up for making it to look like GNOME code. LP Solve is
written by Michel Berkelaar and others. Thanks for the great
work!
* configure.in: Added src/tools/Makefile, src/tools/solver/Makefile,
and src/tools/solver/lp_solve/Makefile.
* src/Makefile.am: Added tools subdirectory.
* src/mathfunc.[ch]: Removed all solver related functions.
* src/solver.h, src/sheet.c: solver_lp_new renamed as
solver_param_new. solver_lp_destroy renamed as
solver_param_destroy.
* src/xml-io.c: Solver related changes.
* samples/solver/production-plan.gnumeric: A Solver sample file.
2002-03-06 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/gui-util.c (gnumeric_error_info_dialog_show) : remove
......
......@@ -73,6 +73,10 @@ Jon K
Joshua R. Odom:
* Reorganize the custom pixmaps.
Jukka:
* Major rewrite of the Solver. Integrated key parts of the LP
Solve 3.2 written by Michel Berkelaar and others.
Morten:
* Fix DATE2UNIX. (Bug 70814.)
* Fix compiler warnings. (Well, fix the bugs they pointed out.)
......
2002-03-06 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* src/tools: New directory created for tools.
* src/tools/solver: Moved src/solver-lp.c into here and split it
into two files: src/tools/solver/solver.c and
src/tools/solver/reports.c. A _major_ rewrite.
* src/tools/solver/lp_solve: Integrated key parts of an LGPLed
linear programming toolkit called LP Solve 3.2. (The whole
package can be found from ftp://ftp.ics.ele.tue.nl/pub/lp_solve).
Major clean up for making it to look like GNOME code. LP Solve is
written by Michel Berkelaar and others. Thanks for the great
work!
* configure.in: Added src/tools/Makefile, src/tools/solver/Makefile,
and src/tools/solver/lp_solve/Makefile.
* src/Makefile.am: Added tools subdirectory.
* src/mathfunc.[ch]: Removed all solver related functions.
* src/solver.h, src/sheet.c: solver_lp_new renamed as
solver_param_new. solver_lp_destroy renamed as
solver_param_destroy.
* src/xml-io.c: Solver related changes.
* samples/solver/production-plan.gnumeric: A Solver sample file.
2002-03-06 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/gui-util.c (gnumeric_error_info_dialog_show) : remove
......
2002-03-06 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* src/tools: New directory created for tools.
* src/tools/solver: Moved src/solver-lp.c into here and split it
into two files: src/tools/solver/solver.c and
src/tools/solver/reports.c. A _major_ rewrite.
* src/tools/solver/lp_solve: Integrated key parts of an LGPLed
linear programming toolkit called LP Solve 3.2. (The whole
package can be found from ftp://ftp.ics.ele.tue.nl/pub/lp_solve).
Major clean up for making it to look like GNOME code. LP Solve is
written by Michel Berkelaar and others. Thanks for the great
work!
* configure.in: Added src/tools/Makefile, src/tools/solver/Makefile,
and src/tools/solver/lp_solve/Makefile.
* src/Makefile.am: Added tools subdirectory.
* src/mathfunc.[ch]: Removed all solver related functions.
* src/solver.h, src/sheet.c: solver_lp_new renamed as
solver_param_new. solver_lp_destroy renamed as
solver_param_destroy.
* src/xml-io.c: Solver related changes.
* samples/solver/production-plan.gnumeric: A Solver sample file.
2002-03-06 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/gui-util.c (gnumeric_error_info_dialog_show) : remove
......
......@@ -564,6 +564,9 @@ src/dialogs/Makefile
src/functions/Makefile
src/pixmaps/Makefile
src/widgets/Makefile
src/tools/Makefile
src/tools/solver/Makefile
src/tools/solver/lp_solve/Makefile
doc/Makefile
doc/C/Makefile
doc/de/Makefile
......
......@@ -254,6 +254,8 @@ mps_create_sheet (MpsInputContext *ctxt, WorkbookView *wbv)
MpsRow *row;
GSList *current;
gint i, n;
static const SolverConstraintType type_map[] = { SolverEQ, SolverLE,
SolverGE };
static const gchar *type_str[] = { "=", "<=", ">=" };
Cell *cell;
SolverParameters *param = sh->solver_parameters;
......@@ -442,7 +444,7 @@ mps_create_sheet (MpsInputContext *ctxt, WorkbookView *wbv)
c->lhs.row = i + CONSTRAINT_ROW;
c->rhs.col = ctxt->n_cols + 3;
c->rhs.row = i + CONSTRAINT_ROW;
c->type = (char *)(type_str[row->type]); /* const_cast */
c->type = type_map[row->type]; /* const_cast */
c->cols = 1;
c->rows = 1;
c->str = write_constraint_str (c->lhs.col, c->lhs.row,
......
......@@ -2,7 +2,7 @@
# Gnumeric's Makefile.
# Author: Miguel de Icaza (miguel@kernel.org)
SUBDIRS = dialogs functions pixmaps widgets
SUBDIRS = dialogs functions pixmaps widgets tools
bin_PROGRAMS = gnumeric
#noinst_PROGRAMS = number-match
......@@ -199,7 +199,6 @@ GNUMERIC_BASE = \
sheet-control-gui.c \
sheet-control-gui.h \
sheet-control-gui-priv.h \
solver-lp.c \
solver.h \
sort.c \
sort.h \
......@@ -300,7 +299,11 @@ gnumeric_LDFLAGS = -export-dynamic
gnumeric_app_libs = \
dialogs/libdialogs.a \
widgets/libwidgets.a \
functions/libfunctions.a
functions/libfunctions.a \
tools/libtools.a \
tools/solver/libsolver.a \
tools/solver/lp_solve/liblp_solve.a
gnm-marshalers.h : gnm-marshalers.list $(GLIB_GENMARSHAL)
$(GLIB_GENMARSHAL) $< --header --prefix=gnm_ > $@
......
2002-03-06 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* dialog-solver.c: Solver rewrite related changes. Things are not
quite done yet.
2002-03-04 Andreas J. Guelzow <aguelzow@taliesin.ca>
* dialog-cell-comment.c (cb_cell_comment_ok_clicked) : use
......
......@@ -59,7 +59,6 @@ typedef struct {
} SolverState;
/* Different constraint types */
static char const * constraint_strs_untranslated[] = {
N_("<="),
......@@ -77,19 +76,11 @@ typedef struct {
Sheet *sheet;
} constraint_conversion_t;
typedef enum {
CONSTRAINT_LESS_EQUAL = 0,
CONSTRAINT_GREATER_EQUAL = 1,
CONSTRAINT_EQUAL = 2,
CONSTRAINT_INTEGER = 3,
CONSTRAINT_BOOLEAN = 4,
CONSTRAINT_NOSUCH_TYPE = 3
} constraint_type_t;
typedef struct {
Value * lhs_value;
Value * rhs_value;
constraint_type_t type;
Value *lhs_value;
Value *rhs_value;
SolverConstraintType type;
} constraint_t;
static const char *problem_type_group[] = {
......@@ -156,10 +147,11 @@ dialog_set_sec_button_sensitivity (GtkWidget *dummy, SolverState *state)
select_ready = (state->selected_row > -1);
ready = gnm_expr_entry_is_cell_ref (state->lhs_entry, state->sheet, TRUE) &&
((gnumeric_option_menu_get_selected_index (state->type_combo)
== CONSTRAINT_INTEGER)
== SolverINT)
|| (gnumeric_option_menu_get_selected_index (state->type_combo)
== CONSTRAINT_BOOLEAN)
|| (is_hom_row_or_col_ref (state->lhs_entry, state->rhs_entry, state->sheet)));
== SolverBOOL)
|| (is_hom_row_or_col_ref (state->lhs_entry, state->rhs_entry,
state->sheet)));
gtk_widget_set_sensitive (state->add_button, ready);
gtk_widget_set_sensitive (state->change_button, select_ready && ready);
......@@ -254,35 +246,38 @@ cb_dialog_add_clicked (GtkWidget *button, SolverState *state)
char *texts[2] = {NULL, NULL};
constraint_t *the_constraint = g_new (constraint_t, 1);
the_constraint->lhs_value = gnm_expr_entry_parse_as_value (state->lhs_entry,
state->sheet);
the_constraint->type = gnumeric_option_menu_get_selected_index (state->type_combo);
if ((the_constraint->type != CONSTRAINT_INTEGER) &&
(the_constraint->type != CONSTRAINT_BOOLEAN)) {
the_constraint->rhs_value = gnm_expr_entry_parse_as_value (state->rhs_entry,
state->sheet);
the_constraint->lhs_value = gnm_expr_entry_parse_as_value
(state->lhs_entry, state->sheet);
the_constraint->type = gnumeric_option_menu_get_selected_index
(state->type_combo);
if ((the_constraint->type != SolverINT) &&
(the_constraint->type != SolverBOOL)) {
the_constraint->rhs_value = gnm_expr_entry_parse_as_value
(state->rhs_entry, state->sheet);
/* FIXMEE: We are dropping cross sheet references!! */
texts[0] = write_constraint_str (the_constraint->lhs_value->v_range.cell.a.col,
the_constraint->lhs_value->v_range.cell.a.row,
the_constraint->rhs_value->v_range.cell.a.col,
the_constraint->rhs_value->v_range.cell.a.row,
constraint_strs_untranslated[the_constraint->type],
the_constraint->lhs_value->v_range.cell.b.col -
the_constraint->lhs_value->v_range.cell.a.col + 1,
the_constraint->lhs_value->v_range.cell.b.row -
the_constraint->lhs_value->v_range.cell.a.row + 1);
texts[0] = write_constraint_str
(the_constraint->lhs_value->v_range.cell.a.col,
the_constraint->lhs_value->v_range.cell.a.row,
the_constraint->rhs_value->v_range.cell.a.col,
the_constraint->rhs_value->v_range.cell.a.row,
the_constraint->type,
the_constraint->lhs_value->v_range.cell.b.col -
the_constraint->lhs_value->v_range.cell.a.col + 1,
the_constraint->lhs_value->v_range.cell.b.row -
the_constraint->lhs_value->v_range.cell.a.row + 1);
} else {
the_constraint->rhs_value = NULL;
/* FIXME: We are dropping cross sheet references!! */
texts[0] = write_constraint_str (the_constraint->lhs_value->v_range.cell.a.col,
the_constraint->lhs_value->v_range.cell.a.row,
0, 0,
constraint_strs_untranslated[the_constraint->type],
the_constraint->lhs_value->v_range.cell.b.col -
the_constraint->lhs_value->v_range.cell.a.col + 1,
the_constraint->lhs_value->v_range.cell.b.row -
the_constraint->lhs_value->v_range.cell.a.row + 1);
texts[0] = write_constraint_str
(the_constraint->lhs_value->v_range.cell.a.col,
the_constraint->lhs_value->v_range.cell.a.row,
0, 0,
the_constraint->type,
the_constraint->lhs_value->v_range.cell.b.col -
the_constraint->lhs_value->v_range.cell.a.col + 1,
the_constraint->lhs_value->v_range.cell.b.row -
the_constraint->lhs_value->v_range.cell.a.row + 1);
}
selection = gtk_clist_insert (state->constraint_list,
state->selected_row + 1, texts);
......@@ -324,9 +319,11 @@ dialog_set_main_button_sensitivity (GtkWidget *dummy, SolverState *state)
{
gboolean ready = FALSE;
ready = gnm_expr_entry_is_cell_ref (state->target_entry, state->sheet, FALSE)
&& gnm_expr_entry_is_cell_ref (state->change_cell_entry, state->sheet, TRUE);
gtk_widget_set_sensitive (state->solve_button, ready);
ready = gnm_expr_entry_is_cell_ref (state->target_entry, state->sheet,
FALSE)
&& gnm_expr_entry_is_cell_ref (state->change_cell_entry,
state->sheet, TRUE);
gtk_widget_set_sensitive (state->solve_button, TRUE);
}
/**
......@@ -344,9 +341,9 @@ cb_dialog_set_rhs_sensitivity (GtkWidget *dummy, SolverState *state)
/* Unfortunately this confuses the widget: */
if ((gnumeric_option_menu_get_selected_index (state->type_combo)
== CONSTRAINT_INTEGER)
== SolverINT)
|| (gnumeric_option_menu_get_selected_index (state->type_combo)
== CONSTRAINT_BOOLEAN)) {
== SolverBOOL)) {
gtk_widget_set_sensitive (GTK_WIDGET (state->rhs_entry), FALSE);
} else {
gtk_widget_set_sensitive (GTK_WIDGET (state->rhs_entry), TRUE);
......@@ -383,7 +380,8 @@ dialog_destroy (GtkObject *w, SolverState *state)
g_return_val_if_fail (state != NULL, FALSE);
if (state->ov_stack != NULL) {
g_slist_foreach (state->ov_stack, (GFunc)free_original_values, NULL);
g_slist_foreach (state->ov_stack, (GFunc)free_original_values,
NULL);
g_slist_free (state->ov_stack);
state->ov_stack = NULL;
g_slist_free (state->ov_cell_stack);
......@@ -445,7 +443,8 @@ cb_dialog_cancel_clicked (GtkWidget *button, SolverState *state)
cells = cells->next;
ov = ov ->next;
}
g_slist_foreach (state->ov_stack, (GFunc)free_original_values, NULL);
g_slist_foreach (state->ov_stack, (GFunc)free_original_values,
NULL);
g_slist_free (state->ov_cell_stack);
g_slist_free (state->ov_stack);
state->ov_cell_stack = NULL;
......@@ -496,13 +495,15 @@ check_int_constraints (Value *input_range, GtkCList *constraint_list)
gint i;
for (i = 0; ; i++) {
const constraint_t *a_constraint = gtk_clist_get_row_data (constraint_list, i);
const constraint_t *a_constraint = gtk_clist_get_row_data
(constraint_list, i);
if (a_constraint == NULL)
break;
if ((a_constraint->type != CONSTRAINT_INTEGER) &&
(a_constraint->type != CONSTRAINT_BOOLEAN))
if ((a_constraint->type != SolverINT) &&
(a_constraint->type != SolverBOOL))
continue;
if (!global_range_contained (a_constraint->lhs_value, input_range))
if (!global_range_contained (a_constraint->lhs_value,
input_range))
return i;
}
return -1;
......@@ -527,16 +528,19 @@ convert_constraint_format (constraint_conversion_t *conv)
break;
engine_constraint = g_new (SolverConstraint, 1);
engine_constraint->lhs.col = a_constraint->lhs_value->v_range.cell.a.col;
engine_constraint->lhs.row = a_constraint->lhs_value->v_range.cell.a.row;
engine_constraint->rows = a_constraint->lhs_value->v_range.cell.b.row
engine_constraint->lhs.col =
a_constraint->lhs_value->v_range.cell.a.col;
engine_constraint->lhs.row =
a_constraint->lhs_value->v_range.cell.a.row;
engine_constraint->rows =
a_constraint->lhs_value->v_range.cell.b.row
- a_constraint->lhs_value->v_range.cell.a.row +1;
engine_constraint->cols = a_constraint->lhs_value->v_range.cell.b.col
engine_constraint->cols =
a_constraint->lhs_value->v_range.cell.b.col
- a_constraint->lhs_value->v_range.cell.a.col +1;
engine_constraint->type = g_strdup (constraint_strs_untranslated
[a_constraint->type]);
if ((a_constraint->type == CONSTRAINT_INTEGER)
|| (a_constraint->type == CONSTRAINT_BOOLEAN)) {
engine_constraint->type = a_constraint->type;
if ((a_constraint->type == SolverINT)
|| (a_constraint->type == SolverBOOL)) {
engine_constraint->rhs.col = 0;
engine_constraint->rhs.row = 0;
} else {
......@@ -548,29 +552,13 @@ convert_constraint_format (constraint_conversion_t *conv)
engine_constraint->str = write_constraint_str (
engine_constraint->lhs.col, engine_constraint->lhs.row,
engine_constraint->rhs.col, engine_constraint->rhs.row,
constraint_strs_untranslated[a_constraint->type],
a_constraint->type,
engine_constraint->cols,
engine_constraint->rows);
conv->c_list = g_slist_prepend (conv->c_list, engine_constraint);
}
}
/*
* get_constraint_type:
* @type_str:
*
*/
static constraint_type_t
get_constraint_type (const char* type_str)
{
constraint_type_t i;
for (i = 0; constraint_strs_untranslated[i] != NULL; i++)
if (strcmp (type_str, constraint_strs_untranslated[i]) == 0)
return i;
return CONSTRAINT_NOSUCH_TYPE;
}
/*
* revert_constraint_format:
* @conv:
......@@ -585,7 +573,8 @@ revert_constraint_format (constraint_conversion_t * conv)
gchar *text[2] = {NULL, NULL};
while (engine_constraint_list != NULL) {
const SolverConstraint *engine_constraint = engine_constraint_list->data;
const SolverConstraint *engine_constraint =
engine_constraint_list->data;
Range r;
constraint_t *a_constraint = g_new (constraint_t, 1);
......@@ -593,18 +582,21 @@ revert_constraint_format (constraint_conversion_t * conv)
r.start.row = engine_constraint->lhs.row;
r.end.col = r.start.col + engine_constraint->cols - 1;
r.end.row = r.start.row + engine_constraint->rows - 1;
a_constraint->lhs_value = value_new_cellrange_r (conv->sheet, &r);
a_constraint->lhs_value = value_new_cellrange_r (conv->sheet,
&r);
r.start.col = engine_constraint->rhs.col;
r.start.row = engine_constraint->rhs.row;
r.end.col = r.start.col + engine_constraint->cols - 1;
r.end.row = r.start.row + engine_constraint->rows - 1;
a_constraint->rhs_value = value_new_cellrange_r (conv->sheet, &r);
a_constraint->rhs_value = value_new_cellrange_r (conv->sheet,
&r);
a_constraint->type = get_constraint_type (engine_constraint->type);
a_constraint->type = engine_constraint->type;
text[0] = engine_constraint->str;
gtk_clist_set_row_data_full (conv->c_listing,
gtk_clist_prepend (conv->c_listing, text),
gtk_clist_prepend (conv->c_listing,
text),
a_constraint,
(GtkDestroyNotify) release_constraint);
engine_constraint_list = engine_constraint_list->next;
......@@ -669,6 +661,7 @@ cb_dialog_solve_clicked (GtkWidget *button, SolverState *state)
CellPos cellpos = {0, 0};
gint i;
gboolean answer, sensitivity, limits;
gchar *errmsg;
if (state->warning_dialog != NULL)
gtk_widget_destroy (state->warning_dialog);
......@@ -676,12 +669,15 @@ cb_dialog_solve_clicked (GtkWidget *button, SolverState *state)
pos = g_new (EvalPos, 1);
pos = eval_pos_init(pos, state->sheet, &cellpos);
target_range = gnm_expr_entry_parse_as_value (state->target_entry, state->sheet);
input_range = gnm_expr_entry_parse_as_value (state->change_cell_entry, state->sheet);
target_range = gnm_expr_entry_parse_as_value (state->target_entry,
state->sheet);
input_range = gnm_expr_entry_parse_as_value (state->change_cell_entry,
state->sheet);
if (state->sheet->solver_parameters->input_entry_str != NULL)
g_free (state->sheet->solver_parameters->input_entry_str);
state->sheet->solver_parameters->input_entry_str = value_get_as_string (input_range);
state->sheet->solver_parameters->input_entry_str = value_get_as_string
(input_range);
state->sheet->solver_parameters->target_cell =
sheet_cell_fetch (state->sheet,
......@@ -716,8 +712,9 @@ cb_dialog_solve_clicked (GtkWidget *button, SolverState *state)
conv.c_listing = state->constraint_list;
convert_constraint_format (&conv);
if (state->sheet->solver_parameters->constraints != NULL) {
g_slist_foreach (state->sheet->solver_parameters->constraints,
cb_destroy, NULL);
g_slist_foreach
(state->sheet->solver_parameters->constraints,
cb_destroy, NULL);
g_slist_free (state->sheet->solver_parameters->constraints);
state->sheet->solver_parameters->constraints = NULL;
}
......@@ -727,18 +724,25 @@ cb_dialog_solve_clicked (GtkWidget *button, SolverState *state)
(state->sheet->solver_parameters->target_cell->value);
state->ov = save_original_values (input_cells);
state->ov_stack = g_slist_prepend (state->ov_stack, state->ov);
state->ov_cell_stack = g_slist_prepend (state->ov_cell_stack, input_cells);
state->ov_cell_stack = g_slist_prepend (state->ov_cell_stack,
input_cells);
if (state->sheet->solver_parameters->options.assume_linear_model) {
int res;
SolverResults *res;
gnum_float *opt_x, *sh_pr;
gboolean ilp;
res = solver (WORKBOOK_CONTROL (state->wbcg),
state->sheet, &errmsg);
res = solver_lp (WORKBOOK_CONTROL (state->wbcg),
state->sheet, &opt_x, &sh_pr, &ilp);
workbook_recalc (state->sheet->workbook);
if (res == SOLVER_LP_OPTIMAL) {
if (res == NULL)
gnumeric_notice_nonmodal
((GtkWindow *) state->dialog,
&(state->warning_dialog),
GTK_MESSAGE_WARNING, errmsg);
else if (1 /*res == SOLVER_LP_OPTIMAL*/) {
gnumeric_notice_nonmodal ((GtkWindow *) state->dialog,
&(state->warning_dialog),
GTK_MESSAGE_INFO,
......@@ -747,7 +751,7 @@ cb_dialog_solve_clicked (GtkWidget *button, SolverState *state)
"are satisfied.\n"));
} else {
char *str;
if (res == SOLVER_LP_UNBOUNDED) {
if (0 /*res == SOLVER_LP_UNBOUNDED*/) {
str = g_strdup_printf
(_("The Target Cell value does "
"not converge!"));
......@@ -764,8 +768,7 @@ cb_dialog_solve_clicked (GtkWidget *button, SolverState *state)
}
solver_lp_reports (WORKBOOK_CONTROL (state->wbcg),
state->sheet, state->ov, state->ov_target,
opt_x, sh_pr,
state->sheet, res,
answer, sensitivity, limits);
} else {
......@@ -826,7 +829,8 @@ dialog_init (SolverState *state)
"clicked",
G_CALLBACK (cb_dialog_close_clicked), state);
state->cancel_button = glade_xml_get_widget (state->gui, "cancelbutton");
state->cancel_button = glade_xml_get_widget (state->gui,
"cancelbutton");
g_signal_connect (G_OBJECT (state->cancel_button),
"clicked",
G_CALLBACK (cb_dialog_cancel_clicked), state);
......@@ -854,8 +858,8 @@ dialog_init (SolverState *state)
table = GTK_TABLE (glade_xml_get_widget (state->gui, "parameter_table"));
state->target_entry = gnumeric_expr_entry_new (state->wbcg, TRUE);
gnm_expr_entry_set_flags (state->target_entry,
GNUM_EE_SINGLE_RANGE | GNUM_EE_SHEET_OPTIONAL,
GNUM_EE_MASK);
GNUM_EE_SINGLE_RANGE | GNUM_EE_SHEET_OPTIONAL,
GNUM_EE_MASK);
gnm_expr_entry_set_scg (state->target_entry, wbcg_cur_scg (state->wbcg));
gtk_table_attach (table, GTK_WIDGET (state->target_entry),
1, 2, 0, 1,
......@@ -872,9 +876,10 @@ dialog_init (SolverState *state)
table = GTK_TABLE (glade_xml_get_widget (state->gui, "parameter_table"));
state->change_cell_entry = gnumeric_expr_entry_new (state->wbcg, TRUE);
gnm_expr_entry_set_flags (state->change_cell_entry,
GNUM_EE_SINGLE_RANGE | GNUM_EE_SHEET_OPTIONAL,
GNUM_EE_MASK);
gnm_expr_entry_set_scg (state->change_cell_entry, wbcg_cur_scg (state->wbcg));
GNUM_EE_SINGLE_RANGE | GNUM_EE_SHEET_OPTIONAL,
GNUM_EE_MASK);
gnm_expr_entry_set_scg (state->change_cell_entry,
wbcg_cur_scg (state->wbcg));
gtk_table_attach (table, GTK_WIDGET (state->change_cell_entry),
1, 2, 2, 3,
GTK_EXPAND | GTK_FILL, 0,
......@@ -891,8 +896,8 @@ dialog_init (SolverState *state)
table = GTK_TABLE (glade_xml_get_widget (state->gui, "edit-table"));
state->lhs_entry = gnumeric_expr_entry_new (state->wbcg, TRUE);
gnm_expr_entry_set_flags (state->lhs_entry,
GNUM_EE_SINGLE_RANGE | GNUM_EE_SHEET_OPTIONAL,
GNUM_EE_MASK);
GNUM_EE_SINGLE_RANGE | GNUM_EE_SHEET_OPTIONAL,
GNUM_EE_MASK);
gnm_expr_entry_set_scg (state->lhs_entry, wbcg_cur_scg (state->wbcg));
gtk_table_attach (table, GTK_WIDGET (state->lhs_entry),
0, 1, 1, 2,
......@@ -909,8 +914,8 @@ dialog_init (SolverState *state)
table = GTK_TABLE (glade_xml_get_widget (state->gui, "edit-table"));
state->rhs_entry = gnumeric_expr_entry_new (state->wbcg, TRUE);
gnm_expr_entry_set_flags (state->rhs_entry,
GNUM_EE_SINGLE_RANGE | GNUM_EE_SHEET_OPTIONAL,
GNUM_EE_MASK);
GNUM_EE_SINGLE_RANGE | GNUM_EE_SHEET_OPTIONAL,
GNUM_EE_MASK);
gnm_expr_entry_set_scg (state->rhs_entry, wbcg_cur_scg (state->wbcg));
gtk_table_attach (table, GTK_WIDGET (state->rhs_entry),
2, 3, 1, 2,
......@@ -933,7 +938,8 @@ dialog_init (SolverState *state)
G_CALLBACK (cb_dialog_set_rhs_sensitivity), state);
/* constraint_list */
state->constraint_list = GTK_CLIST (glade_xml_get_widget (state->gui, "constraint_list"));
state->constraint_list = GTK_CLIST (glade_xml_get_widget
(state->gui, "constraint_list"));
state->selected_row = -1;
g_signal_connect (G_OBJECT (state->constraint_list),
"select-row",
......<