GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit a383aea0 authored by Morten Welinder's avatar Morten Welinder

White space...

parent f98b359a
......@@ -70,7 +70,7 @@ dialog_about (WorkbookControlGUI *wbcg)
int i;
for (i = 0; authors[i] != NULL; i++){
authors [i] = _(authors [i]);
authors[i] = _(authors[i]);
}
}
#endif
......
......@@ -27,7 +27,7 @@
static gboolean unique_only_flag;
static void
unique_only_toggled(GtkWidget *widget, gpointer ignored)
unique_only_toggled (GtkWidget *widget, gpointer ignored)
{
unique_only_flag = GTK_TOGGLE_BUTTON (widget)->active;
}
......@@ -112,7 +112,7 @@ typedef struct {
} filter_t;
static void
in_place_toggled(GtkWidget *widget, filter_t *filter)
in_place_toggled (GtkWidget *widget, filter_t *filter)
{
if (GTK_TOGGLE_BUTTON (widget)->active) {
filter->type = InPlace;
......@@ -121,7 +121,7 @@ in_place_toggled(GtkWidget *widget, filter_t *filter)
}
static void
copy_to_toggled(GtkWidget *widget, filter_t *filter)
copy_to_toggled (GtkWidget *widget, filter_t *filter)
{
if (GTK_TOGGLE_BUTTON (widget)->active) {
filter->type = CopyTo;
......@@ -130,7 +130,7 @@ copy_to_toggled(GtkWidget *widget, filter_t *filter)
}
static void
new_sheet_toggled(GtkWidget *widget, filter_t *filter)
new_sheet_toggled (GtkWidget *widget, filter_t *filter)
{
if (GTK_TOGGLE_BUTTON (widget)->active) {
filter->type = NewSheet;
......@@ -139,7 +139,7 @@ new_sheet_toggled(GtkWidget *widget, filter_t *filter)
}
static void
new_workbook_toggled(GtkWidget *widget, filter_t *filter)
new_workbook_toggled (GtkWidget *widget, filter_t *filter)
{
if (GTK_TOGGLE_BUTTON (widget)->active) {
filter->type = NewWorkbook;
......@@ -148,7 +148,7 @@ new_workbook_toggled(GtkWidget *widget, filter_t *filter)
}
static void
dialog_help_cb(GtkWidget *button, gchar *helpfile)
dialog_help_cb (GtkWidget *button, gchar *helpfile)
{
if (helpfile != NULL) {
GnomeHelpMenuEntry help_ref;
......@@ -213,7 +213,7 @@ dialog_advanced_filter (WorkbookControlGUI *wbcg)
gtk_signal_connect (GTK_OBJECT (radiobutton), "toggled",
GTK_SIGNAL_FUNC (new_workbook_toggled),
&f);
helpbutton = glade_xml_get_widget(gui, "helpbutton");
helpbutton = glade_xml_get_widget (gui, "helpbutton");
gtk_signal_connect (GTK_OBJECT (helpbutton), "clicked",
GTK_SIGNAL_FUNC (dialog_help_cb), helpfile);
......@@ -256,9 +256,9 @@ loop:
_("You should introduce a valid cell names "
"in 'List Range:'"));
gtk_widget_grab_focus (list_range);
gtk_entry_set_position(GTK_ENTRY (list_range), 0);
gtk_entry_select_region(GTK_ENTRY (list_range), 0,
GTK_ENTRY(list_range)->text_length);
gtk_entry_set_position (GTK_ENTRY (list_range), 0);
gtk_entry_select_region (GTK_ENTRY (list_range), 0,
GTK_ENTRY (list_range)->text_length);
goto loop;
}
......@@ -270,9 +270,9 @@ loop:
_("You should introduce a valid cell names "
"in 'Criteria Range:'"));
gtk_widget_grab_focus (criteria_range);
gtk_entry_set_position(GTK_ENTRY (criteria_range), 0);
gtk_entry_select_region(GTK_ENTRY (criteria_range), 0,
GTK_ENTRY(criteria_range)->text_length);
gtk_entry_set_position (GTK_ENTRY (criteria_range), 0);
gtk_entry_select_region (GTK_ENTRY (criteria_range), 0,
GTK_ENTRY (criteria_range)->text_length);
goto loop;
}
......@@ -289,9 +289,9 @@ loop:
_("You should introduce a valid "
"cell range in 'Copy To:'"));
gtk_widget_grab_focus (copy_to);
gtk_entry_set_position(GTK_ENTRY (copy_to), 0);
gtk_entry_select_region(GTK_ENTRY (copy_to), 0,
GTK_ENTRY(copy_to)->text_length);
gtk_entry_set_position (GTK_ENTRY (copy_to), 0);
gtk_entry_select_region (GTK_ENTRY (copy_to), 0,
GTK_ENTRY (copy_to)->text_length);
goto loop;
}
}
......@@ -336,9 +336,9 @@ loop:
"columns in the `List Range' and in "
"`Criteria Range:'"));
gtk_widget_grab_focus (list_range);
gtk_entry_set_position(GTK_ENTRY (list_range), 0);
gtk_entry_select_region(GTK_ENTRY (list_range), 0,
GTK_ENTRY(list_range)->text_length);
gtk_entry_set_position (GTK_ENTRY (list_range), 0);
gtk_entry_select_region (GTK_ENTRY (list_range), 0,
GTK_ENTRY (list_range)->text_length);
goto loop;
}
}
......@@ -3769,7 +3769,7 @@ dialog_data_analysis (WorkbookControlGUI *wbcg, Sheet *sheet)
GTK_SIGNAL_FUNC (selection_made), NULL);
for (i=0; tools[i].fun; i++) {
char *tmp [2];
char *tmp[2];
tmp[0] = _(tools[i].name);
tmp[1] = NULL;
gtk_clist_append (GTK_CLIST (tool_list), tmp);
......
......@@ -46,7 +46,7 @@ gint fl_row, in_row;
/* Add the name of the days on your language if they are always capitalized.
*/
static char *autocorrect_day [] = {
static char *autocorrect_day[] = {
/* English */
"monday", "tuesday", "wednesday", "thursday",
"friday", "saturday", "sunday", NULL
......
......@@ -104,7 +104,7 @@ typedef struct _FormatState
Value *value;
StyleFormat *parse_format;
MStyle *style, *result;
StyleBorder *borders [STYLE_BORDER_EDGE_MAX];
StyleBorder *borders[STYLE_BORDER_EDGE_MAX];
int selection_mask;
gboolean enable_edit;
......@@ -245,7 +245,7 @@ cb_toggle_changed (GtkToggleButton *button, PatternPicker *picker)
{
if (gtk_toggle_button_get_active (button) &&
picker->current_pattern != button) {
gtk_toggle_button_set_active(picker->current_pattern, FALSE);
gtk_toggle_button_set_active (picker->current_pattern, FALSE);
picker->current_pattern = button;
picker->cur_index =
GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (button), "index"));
......@@ -270,9 +270,9 @@ setup_pattern_button (GladeXML *gui,
if (tmp != NULL) {
GtkButton *button = GTK_BUTTON (tmp);
if (flag) {
GtkWidget * image = gnumeric_load_image(name);
GtkWidget * image = gnumeric_load_image (name);
if (image != NULL)
gtk_container_add(GTK_CONTAINER (tmp), image);
gtk_container_add (GTK_CONTAINER (tmp), image);
}
if (picker->current_pattern == NULL) {
......@@ -369,7 +369,7 @@ init_button_image (GladeXML *gui, char const * const name)
{
GtkWidget *tmp = glade_xml_get_widget (gui, name);
if (tmp != NULL) {
GtkWidget * image = gnumeric_load_image(name);
GtkWidget * image = gnumeric_load_image (name);
if (image != NULL)
gtk_container_add (GTK_CONTAINER (tmp), image);
}
......@@ -525,7 +525,7 @@ draw_format_preview (FormatState *state)
preview = format_value (sf, state->value, NULL, -1);
if (strlen (preview) > FORMAT_PREVIEW_MAX)
strcpy (&preview [FORMAT_PREVIEW_MAX - 5], " ...");
strcpy (&preview[FORMAT_PREVIEW_MAX - 5], " ...");
gtk_label_set_text (state->format.preview, preview);
g_free (preview);
......@@ -620,7 +620,7 @@ fmt_dialog_init_fmt_list (GtkCList *cl, char const * const *formats,
for (j = 0; formats[j]; ++j) {
gchar *t[1];
t [0] = style_format_str_as_XL (formats[j], TRUE);
t[0] = style_format_str_as_XL (formats[j], TRUE);
gtk_clist_append (cl, t);
g_free (t[0]);
......@@ -718,7 +718,7 @@ fmt_dialog_enable_widgets (FormatState *state, int page)
for (; start <= end ; ++start)
select = fmt_dialog_init_fmt_list (cl,
cell_formats [start],
cell_formats[start],
state->format.spec,
select, &count);
gtk_clist_thaw (cl);
......@@ -798,7 +798,7 @@ cb_format_currency_select (GtkEditable *w, FormatState *state)
/* There must be a better way than this */
int i;
for (i = 0; currency_symbols[i].symbol != NULL ; ++i)
if (!strcmp (_(currency_symbols [i].description), tmp)) {
if (!strcmp (_(currency_symbols[i].description), tmp)) {
state->format.currency_index = i;
break;
}
......@@ -876,7 +876,7 @@ fmt_dialog_init_format_page (FormatState *state)
StyleFormat const *fmt = mstyle_get_format (state->style);
format = style_format_as_XL (fmt, FALSE);
} else
format = g_strdup (cell_formats [0][0]);
format = g_strdup (cell_formats[0][0]);
if (!strcmp (format, "General") && state->parse_format != NULL) {
g_free (format);
......@@ -989,14 +989,14 @@ fmt_dialog_init_format_page (FormatState *state)
gtk_entry_set_editable (GTK_ENTRY (combo->entry), FALSE);
for (i = 0; currency_symbols[i].symbol != NULL ; ++i) {
gchar *descr = _(currency_symbols [i].description);
gchar *descr = _(currency_symbols[i].description);
l = g_list_append (l, descr);
}
gtk_combo_set_popdown_strings (combo, l);
g_list_free (l);
gtk_entry_set_text (GTK_ENTRY (combo->entry),
_(currency_symbols [state->format.currency_index].description));
_(currency_symbols[state->format.currency_index].description));
gtk_signal_connect (GTK_OBJECT (combo->entry),
"changed", GTK_SIGNAL_FUNC (cb_format_currency_select),
......@@ -1005,7 +1005,7 @@ fmt_dialog_init_format_page (FormatState *state)
/* Setup special handler for Custom */
gtk_signal_connect (GTK_OBJECT (state->format.widget[F_ENTRY]),
"changed", GTK_SIGNAL_FUNC(cb_format_entry),
"changed", GTK_SIGNAL_FUNC (cb_format_entry),
state);
gnome_dialog_editable_enters (GNOME_DIALOG (state->dialog),
GTK_EDITABLE (state->format.widget[F_ENTRY]));
......@@ -1209,7 +1209,7 @@ fmt_dialog_init_align_page (FormatState *state)
static void
cb_font_changed (GtkWidget *widget, MStyle *mstyle, FormatState *state)
{
static MStyleElementType const font_types [] = {
static MStyleElementType const font_types[] = {
MSTYLE_FONT_NAME,
MSTYLE_FONT_SIZE,
MSTYLE_FONT_BOLD,
......@@ -1229,7 +1229,7 @@ cb_font_changed (GtkWidget *widget, MStyle *mstyle, FormatState *state)
return;
for (i = 0 ; i < num_font_types; i++) {
MStyleElementType const t = font_types [i];
MStyleElementType const t = font_types[i];
if (mstyle_is_element_set (mstyle, t)) {
mstyle_replace_element (mstyle, state->result, t);
changed = TRUE;
......@@ -1757,7 +1757,7 @@ draw_border_preview (FormatState *state)
}
for (j = 6 ; --j >= 0 ;)
points->coords [j] = corners[i][j];
points->coords[j] = corners[i][j];
gnome_canvas_item_new (group,
gnome_canvas_line_get_type (),
......@@ -1771,7 +1771,7 @@ draw_border_preview (FormatState *state)
points = gnome_canvas_points_new (2);
for (i = 0; line_info[i].states != 0 ; ++i ) {
for (j = 4; --j >= 0 ; )
points->coords [j] = line_info[i].points[j];
points->coords[j] = line_info[i].points[j];
if (line_info[i].states & state->selection_mask) {
BorderPicker const * p =
......@@ -2416,7 +2416,7 @@ cb_fmt_dialog_dialog_apply (GtkObject *w, int page, FormatState *state)
mstyle_ref (state->result);
for (i = STYLE_BORDER_TOP; i < STYLE_BORDER_EDGE_MAX; i++)
borders [i] = border_get_mstyle (state, i);
borders[i] = border_get_mstyle (state, i);
cmd_format (WORKBOOK_CONTROL (state->wbcg),
state->sheet, state->result, borders, NULL);
......@@ -2676,8 +2676,8 @@ fmt_dialog_impl (FormatState *state, FormatDialogPosition_t pageno)
GtkWidget * tmp = init_button_image (state->gui, name);
if (tmp != NULL) {
init_border_button (state, i, tmp,
state->borders [i]);
style_border_unref (state->borders [i]);
state->borders[i]);
style_border_unref (state->borders[i]);
}
}
......@@ -2732,11 +2732,11 @@ fmt_dialog_impl (FormatState *state, FormatDialogPosition_t pageno)
GTK_SIGNAL_FUNC (gnome_help_pbox_goto), &help_ref);
gtk_signal_connect (GTK_OBJECT (dialog), "apply",
GTK_SIGNAL_FUNC (cb_fmt_dialog_dialog_apply), state);
gtk_signal_connect (GTK_OBJECT(dialog), "destroy",
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
GTK_SIGNAL_FUNC (cb_fmt_dialog_dialog_destroy),
state);
gtk_signal_connect (GTK_OBJECT(dialog), "set-focus",
GTK_SIGNAL_FUNC(cb_fmt_dialog_set_focus),
gtk_signal_connect (GTK_OBJECT (dialog), "set-focus",
GTK_SIGNAL_FUNC (cb_fmt_dialog_set_focus),
state);
set_initial_focus (state);
......
......@@ -227,7 +227,7 @@ order_box_new (GtkWidget * parent, const gchar *frame_text,
GTK_SIGNAL_FUNC (dialog_cell_sort_adv), orderbox);
gtk_container_add (GTK_CONTAINER (orderbox->main_frame), hbox);
gtk_box_pack_start (GTK_BOX (parent), GTK_WIDGET(orderbox->main_frame),
gtk_box_pack_start (GTK_BOX (parent), GTK_WIDGET (orderbox->main_frame),
FALSE, TRUE, 0);
return orderbox;
......@@ -373,7 +373,7 @@ dialog_cell_sort_del_clause (SortFlow *sf)
}
static void
dialog_cell_sort_add_clause(SortFlow *sf, WorkbookControlGUI *wbcg)
dialog_cell_sort_add_clause (SortFlow *sf, WorkbookControlGUI *wbcg)
{
if ((sf->num_clause >= sf->max_col_clause && sf->top)
|| (sf->num_clause >= sf->max_row_clause && !(sf->top)))
......@@ -396,7 +396,7 @@ dialog_cell_sort_add_clause(SortFlow *sf, WorkbookControlGUI *wbcg)
}
static void
dialog_cell_sort_set_clauses(SortFlow *sf, int clauses) {
dialog_cell_sort_set_clauses (SortFlow *sf, int clauses) {
int i;
if (sf->num_clause <= clauses) return;
......@@ -439,14 +439,14 @@ dialog_cell_sort_header_toggled (GtkWidget *widget, SortFlow *sf)
static void
dialog_cell_sort_rows_toggled(GtkWidget *widget, SortFlow *sf)
dialog_cell_sort_rows_toggled (GtkWidget *widget, SortFlow *sf)
{
int i;
sf->top = !(GTK_TOGGLE_BUTTON (widget)->active);
if (!(sf->top)) {
if (sf->num_clause > sf->max_row_clause)
dialog_cell_sort_set_clauses(sf, sf->max_row_clause);
dialog_cell_sort_set_clauses (sf, sf->max_row_clause);
for (i=0; i<sf->num_clause; i++) {
if (sf->header)
gtk_combo_set_popdown_strings
......@@ -561,7 +561,7 @@ dialog_cell_sort (WorkbookControlGUI *wbcg, Sheet *sheet)
sort_flow.clauses[lp] = NULL;
/* Build the rest of the dialog */
gnome_dialog_close_hides(GNOME_DIALOG (sort_flow.dialog), TRUE);
gnome_dialog_close_hides (GNOME_DIALOG (sort_flow.dialog), TRUE);
sort_flow.clause_box = gtk_vbox_new (FALSE, FALSE);
gtk_table_attach_defaults (GTK_TABLE (table),
......
......@@ -381,7 +381,7 @@ setup_widgets (ConsolidateState *state, GladeXML *glade_gui)
gnumeric_expr_entry_set_scg (state->gui.source, wb_control_gui_cur_sheet (state->wbcg));
gnumeric_editable_enters (GTK_WINDOW (state->gui.dialog),
GTK_EDITABLE(state->gui.destination));
GTK_EDITABLE (state->gui.destination));
gnumeric_editable_enters (GTK_WINDOW (state->gui.dialog),
GTK_EDITABLE (state->gui.source));
......
......@@ -247,7 +247,7 @@ static void
cb_name_guru_select_name (GtkWidget *list, NameGuruState *state)
{
NamedExpression *expr_name;
GList *sel = GTK_LIST(list)->selection;
GList *sel = GTK_LIST (list)->selection;
if (sel == NULL || state->updating)
return;
......@@ -549,7 +549,7 @@ name_guru_init (NameGuruState *state, WorkbookControlGUI *wbcg)
GTK_SIGNAL_FUNC (cb_name_guru_update_sensitivity), state);
gnumeric_editable_enters (GTK_WINDOW (state->dialog),
GTK_EDITABLE(state->name));
GTK_EDITABLE (state->name));
gnumeric_editable_enters (GTK_WINDOW (state->dialog),
GTK_EDITABLE (state->expr_text));
gnumeric_keyed_dialog (state->wbcg, GTK_WINDOW (state->dialog),
......
......@@ -42,7 +42,7 @@ dialog_delete_cells_impl (WorkbookControlGUI *wbcg, GladeXML *gui,
res = gnumeric_dialog_run (wbcg, GNOME_DIALOG (dialog));
if (res == GNOME_OK) {
i = gtk_radio_group_get_selected
(GTK_RADIO_BUTTON(radio_0)->group);
(GTK_RADIO_BUTTON (radio_0)->group);
cols = sel->end.col - sel->start.col + 1;
rows = sel->end.row - sel->start.row + 1;
......
......@@ -42,7 +42,7 @@ category_list_fill (FunctionSelectState *state)
gtk_clist_clear (list);
for (i = cur_row = 0 ;; ++i) {
gchar *cols [1];
gchar *cols[1];
FunctionCategory const * const cat =
function_category_get_nth (i);
if (cat == NULL)
......@@ -71,7 +71,7 @@ function_list_fill (FunctionSelectState *state)
gtk_clist_clear (list);
for (p = cat->functions; p ; p = g_list_next (p)) {
gchar *cols [1];
gchar *cols[1];
FunctionDefinition const * const func = p->data;
cols[0] = (gchar *)function_def_get_name (func); /* Const cast */
......
......@@ -256,7 +256,7 @@ gnumeric_goal_seek (GoalSeekState *state)
* Provide help.
**/
static void
dialog_help_cb(GtkWidget *button, GoalSeekState *state)
dialog_help_cb (GtkWidget *button, GoalSeekState *state)
{
if (state->helpfile != NULL) {
GnomeHelpMenuEntry help_ref;
......@@ -311,7 +311,7 @@ dialog_destroy (GtkObject *w, GoalSeekState *state)
* Close (destroy) the dialog
**/
static void
cb_dialog_cancel_clicked(GtkWidget *button, GoalSeekState *state)
cb_dialog_cancel_clicked (GtkWidget *button, GoalSeekState *state)
{
if ((state->old_cell != NULL) && (state->old_value != NULL)) {
sheet_cell_set_value (state->old_cell, state->old_value, NULL);
......@@ -330,7 +330,7 @@ cb_dialog_cancel_clicked(GtkWidget *button, GoalSeekState *state)
* Close (destroy) the dialog
**/
static void
cb_dialog_close_clicked(GtkWidget *button, GoalSeekState *state)
cb_dialog_close_clicked (GtkWidget *button, GoalSeekState *state)
{
gtk_widget_destroy (state->dialog);
return;
......@@ -344,7 +344,7 @@ cb_dialog_close_clicked(GtkWidget *button, GoalSeekState *state)
* Close (destroy) the dialog
**/
static void
cb_dialog_apply_clicked(GtkWidget *button, GoalSeekState *state)
cb_dialog_apply_clicked (GtkWidget *button, GoalSeekState *state)
{
char *text;
char *status_str;
......@@ -365,7 +365,7 @@ cb_dialog_apply_clicked(GtkWidget *button, GoalSeekState *state)
if (!parse_cell_name (text, &state->set_cell_col, &state->set_cell_row, TRUE, NULL)){
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
_("You should introduce a valid cell name in 'Set Cell:'!"));
focus_on_entry (GTK_WIDGET(state->set_cell_entry));
focus_on_entry (GTK_WIDGET (state->set_cell_entry));
return;
}
......@@ -373,7 +373,7 @@ cb_dialog_apply_clicked(GtkWidget *button, GoalSeekState *state)
if (state->set_cell == NULL || !cell_has_expr (state->set_cell)) {
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
_("The cell named in 'Set Cell:' must contain a formula!"));
focus_on_entry (GTK_WIDGET(state->set_cell_entry));
focus_on_entry (GTK_WIDGET (state->set_cell_entry));
return;
}
......@@ -382,7 +382,7 @@ cb_dialog_apply_clicked(GtkWidget *button, GoalSeekState *state)
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
_("You should introduce a valid cell "
"name in 'By Changing Cell:'!"));
focus_on_entry (GTK_WIDGET(state->change_cell_entry));
focus_on_entry (GTK_WIDGET (state->change_cell_entry));
return;
}
......@@ -391,7 +391,7 @@ cb_dialog_apply_clicked(GtkWidget *button, GoalSeekState *state)
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
_("The cell named in 'By changing cell' "
"must not contain a formula."));
focus_on_entry (GTK_WIDGET(state->change_cell_entry));
focus_on_entry (GTK_WIDGET (state->change_cell_entry));
return;
}
......@@ -404,53 +404,53 @@ cb_dialog_apply_clicked(GtkWidget *button, GoalSeekState *state)
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
_("The value given in 'To Value:' "
"is not valid."));
focus_on_entry (GTK_WIDGET(state->to_value_entry));
focus_on_entry (GTK_WIDGET (state->to_value_entry));
return;
}
state->target_value = value_get_as_float(value);
target_str = format_value(target_value_format, value, NULL, 0);
state->target_value = value_get_as_float (value);
target_str = format_value (target_value_format, value, NULL, 0);
gtk_entry_set_text (GTK_ENTRY (state->to_value_entry), target_str);
g_free(target_str);
value_release(value);
g_free (target_str);
value_release (value);
format = mstyle_get_format (cell_get_mstyle (state->change_cell));
text = g_strdup(gtk_entry_get_text (GTK_ENTRY (state->at_least_entry)));
g_strstrip(text);
if (strlen(text) > 0) {
text = g_strdup (gtk_entry_get_text (GTK_ENTRY (state->at_least_entry)));
g_strstrip (text);
if (strlen (text) > 0) {
value = format_match_number (text, format, &min_value_format);
if (format != NULL)
min_value_format = format;
} else {
value = NULL;
}
g_free(text);
g_free (text);
if (value != NULL) {
state->xmin = value_get_as_float(value);
text = format_value(min_value_format, value, NULL, 0);
state->xmin = value_get_as_float (value);
text = format_value (min_value_format, value, NULL, 0);
gtk_entry_set_text (GTK_ENTRY (state->at_least_entry), text);
g_free(text);
value_release(value);
g_free (text);
value_release (value);
} else {
state->xmin = - max_range_val;
gtk_entry_set_text (GTK_ENTRY (state->at_least_entry), "");
}
text = g_strdup(gtk_entry_get_text (GTK_ENTRY (state->at_most_entry)));
g_strstrip(text);
if (strlen(text) > 0) {
text = g_strdup (gtk_entry_get_text (GTK_ENTRY (state->at_most_entry)));
g_strstrip (text);
if (strlen (text) > 0) {
value = format_match_number (text, format, &max_value_format);
if (format != NULL)
max_value_format = format;
} else {
value = NULL;
}
g_free(text);
g_free (text);
if (value != NULL) {
state->xmax = value_get_as_float(value);
text = format_value(max_value_format, value, NULL, 0);
state->xmax = value_get_as_float (value);
text = format_value (max_value_format, value, NULL, 0);
gtk_entry_set_text (GTK_ENTRY (state->at_most_entry), text);
g_free(text);
value_release(value);
g_free (text);
value_release (value);
} else {
state->xmax = max_range_val;
gtk_entry_set_text (GTK_ENTRY (state->at_most_entry), "");
......@@ -469,26 +469,26 @@ cb_dialog_apply_clicked(GtkWidget *button, GoalSeekState *state)
switch (status) {
case GOAL_SEEK_OK:
format = style_format_new_XL("General", FALSE);
error_value = value_new_float(state->target_value -
value_get_as_float(state->set_cell->value));
target_str = format_value(format, error_value, NULL, 0);
format = style_format_new_XL ("General", FALSE);
error_value = value_new_float (state->target_value -
value_get_as_float (state->set_cell->value));
target_str = format_value (format, error_value, NULL, 0);
gtk_label_set_text (GTK_LABEL (state->target_value_label), target_str);
g_free(target_str);
value_release(error_value);
style_format_unref(format);
g_free (target_str);
value_release (error_value);
style_format_unref (format);
status_str =
g_strdup_printf (_("Goal seeking with cell %s found a solution."),
cell_name (state->set_cell));
gtk_label_set_text (GTK_LABEL (state->result_label), status_str);
g_free(status_str);
g_free (status_str);
actual_str = cell_get_rendered_text(state->set_cell);
actual_str = cell_get_rendered_text (state->set_cell);
gtk_label_set_text (GTK_LABEL (state->current_value_label), actual_str);
g_free(actual_str);
g_free (actual_str);
solution_str = cell_get_rendered_text(state->change_cell);
solution_str = cell_get_rendered_text (state->change_cell);
gtk_label_set_text (GTK_LABEL (state->solution_label), solution_str);
g_free (solution_str);
......@@ -498,7 +498,7 @@ cb_dialog_apply_clicked(GtkWidget *button, GoalSeekState *state)
g_strdup_printf (_("Goal seeking with cell %s did not find a solution."),
cell_name (state->set_cell));
gtk_label_set_text (GTK_LABEL (state->result_label), status_str);
g_free(status_str);
g_free (status_str);
gtk_label_set_text (GTK_LABEL (state->current_value_label), "");
gtk_label_set_text (GTK_LABEL (state->solution_label), "");
gtk_label_set_text (GTK_LABEL (state->target_value_label), "");
......@@ -561,40 +561,40 @@ dialog_init (GoalSeekState *state)
if (state->dialog == NULL)
return TRUE;
state->close_button = glade_xml_get_widget(state->gui, "closebutton");
state->close_button = glade_xml_get_widget (state->gui, "closebutton");
gtk_signal_connect (GTK_OBJECT (state->close_button), "clicked",
GTK_SIGNAL_FUNC (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");
gtk_signal_connect (GTK_OBJECT (state->cancel_button), "clicked",
GTK_SIGNAL_FUNC (cb_dialog_cancel_clicked),
state);
state->apply_button = glade_xml_get_widget(state->gui, "applybutton");
state->apply_button = glade_xml_get_widget (state->gui, "applybutton");
gtk_signal_connect (GTK_OBJECT (state->apply_button), "clicked",
GTK_SIGNAL_FUNC (cb_dialog_apply_clicked), state);
state->help_button = glade_xml_get_widget(state->gui, "helpbutton");
state->help_button = glade_xml_get_widget (state->gui, "helpbutton");
gtk_signal_connect (GTK_OBJECT (state->help_button), "clicked",
GTK_SIGNAL_FUNC (dialog_help_cb), state);
state->to_value_entry = glade_xml_get_widget (state->gui, "to_value_entry");
state->at_least_entry = glade_xml_get_widget (state->gui, "at_least-entry");
state->at_most_entry = glade_xml_get_widget (state->gui, "at_most-entry");
state->target_value_label = glade_xml_get_widget (state->gui, "target-value");
gtk_label_set_justify(GTK_LABEL(state->target_value_label), GTK_JUSTIFY_RIGHT);
gtk_label_set_justify (GTK_LABEL (state->target_value_label), GTK_JUSTIFY_RIGHT);
state->current_value_label = glade_xml_get_widget (state->gui, "current-value");
gtk_label_set_justify(GTK_LABEL(state->current_value_label), GTK_JUSTIFY_RIGHT);
gtk_label_set_justify (GTK_LABEL (state->current_value_label), GTK_JUSTIFY_RIGHT);
state->solution_label = glade_xml_get_widget (state->gui, "solution");
gtk_label_set_justify(GTK_LABEL(state->solution_label), GTK_JUSTIFY_RIGHT);
gtk_label_set_justify (GTK_LABEL (state->solution_label), GTK_JUSTIFY_RIGHT);
state->result_label = glade_xml_get_widget (state->gui, "result-label");
state->result_frame = glade_xml_get_widget (state->gui, "result-frame");
table = GTK_TABLE (glade_xml_get_widget (state->gui, "goal-table"));
state->set_cell_entry = GNUMERIC_EXPR_ENTRY (gnumeric_expr_entry_new (state->wbcg));
gnumeric_expr_entry_set_flags(state->set_cell_entry,
gnumeric_expr_entry_set_flags (state->set_cell_entry,
GNUM_EE_SINGLE_RANGE | GNUM_EE_SHEET_OPTIONAL,
GNUM_EE_MASK);
gnumeric_expr_entry_set_scg(state->set_cell_entry, wb_control_gui_cur_sheet (state->wbcg));
gnumeric_expr_entry_set_scg (state->set_cell_entry, wb_control_gui_cur_sheet (state->wbcg));
gtk_table_attach (table, GTK_WIDGET (state->set_cell_entry),
1, 2, 0, 1,
GTK_EXPAND | GTK_FILL, 0,
......@@ -604,11 +604,11 @@ dialog_init (GoalSeekState *state)
gtk_widget_show (GTK_WIDGET (state->set_cell_entry));