Commit 7370d141 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Things seem to work ok in the non guru case. Test the guru's in the morning.

2001-05-16  Jody Goldberg <jgoldberg@home.com>

	* src/workbook-edit.c (wbcg_edit_finish) : stop the current rangesel,
	  not rangesel on the current display sheet.

	* src/workbook-control-gui.c (cb_notebook_switch_page) : simplify and
	  use the new wbcg::rangesel to make things easier.
	(workbook_control_gui_init) : init the new flag.

	* src/sheet-control-gui.c (scg_rangesel_start) : store the scg doing
	  the rangesel in the wbcg.
	(scg_rangesel_stop) : clear it here.
parent cb50aa19
2001-05-16 Jody Goldberg <jgoldberg@home.com>
* src/workbook-edit.c (wbcg_edit_finish) : stop the current rangesel,
not rangesel on the current display sheet.
* src/workbook-control-gui.c (cb_notebook_switch_page) : simplify and
use the new wbcg::rangesel to make things easier.
(workbook_control_gui_init) : init the new flag.
* src/sheet-control-gui.c (scg_rangesel_start) : store the scg doing
the rangesel in the wbcg.
(scg_rangesel_stop) : clear it here.
2001-05-15 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_stop_range_selection) : delete.
......
2001-05-16 Jody Goldberg <jgoldberg@home.com>
* src/workbook-edit.c (wbcg_edit_finish) : stop the current rangesel,
not rangesel on the current display sheet.
* src/workbook-control-gui.c (cb_notebook_switch_page) : simplify and
use the new wbcg::rangesel to make things easier.
(workbook_control_gui_init) : init the new flag.
* src/sheet-control-gui.c (scg_rangesel_start) : store the scg doing
the rangesel in the wbcg.
(scg_rangesel_stop) : clear it here.
2001-05-15 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_stop_range_selection) : delete.
......
2001-05-16 Jody Goldberg <jgoldberg@home.com>
* src/workbook-edit.c (wbcg_edit_finish) : stop the current rangesel,
not rangesel on the current display sheet.
* src/workbook-control-gui.c (cb_notebook_switch_page) : simplify and
use the new wbcg::rangesel to make things easier.
(workbook_control_gui_init) : init the new flag.
* src/sheet-control-gui.c (scg_rangesel_start) : store the scg doing
the rangesel in the wbcg.
(scg_rangesel_stop) : clear it here.
2001-05-15 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_stop_range_selection) : delete.
......
2001-05-16 Jody Goldberg <jgoldberg@home.com>
* src/workbook-edit.c (wbcg_edit_finish) : stop the current rangesel,
not rangesel on the current display sheet.
* src/workbook-control-gui.c (cb_notebook_switch_page) : simplify and
use the new wbcg::rangesel to make things easier.
(workbook_control_gui_init) : init the new flag.
* src/sheet-control-gui.c (scg_rangesel_start) : store the scg doing
the rangesel in the wbcg.
(scg_rangesel_stop) : clear it here.
2001-05-15 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_stop_range_selection) : delete.
......
2001-05-16 Jody Goldberg <jgoldberg@home.com>
* src/workbook-edit.c (wbcg_edit_finish) : stop the current rangesel,
not rangesel on the current display sheet.
* src/workbook-control-gui.c (cb_notebook_switch_page) : simplify and
use the new wbcg::rangesel to make things easier.
(workbook_control_gui_init) : init the new flag.
* src/sheet-control-gui.c (scg_rangesel_start) : store the scg doing
the rangesel in the wbcg.
(scg_rangesel_stop) : clear it here.
2001-05-15 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_stop_range_selection) : delete.
......
......@@ -2123,6 +2123,10 @@ scg_rangesel_start (SheetControlGUI *scg, int col, int row)
if (scg->rangesel.active)
return;
if (scg->wbcg->rangesel != NULL)
g_warning ("mis configed rangesel");
scg->wbcg->rangesel = scg;
scg->rangesel.active = TRUE;
scg->rangesel.cursor_pos = GTK_EDITABLE (wbcg_get_entry_logical (scg->wbcg))->current_pos;
......@@ -2137,7 +2141,10 @@ scg_rangesel_stop (SheetControlGUI *scg, gboolean clear_string)
if (!scg->rangesel.active)
return;
if (scg->wbcg->rangesel != scg)
g_warning ("mis configed rangesel");
scg->wbcg->rangesel = NULL;
scg->rangesel.active = FALSE;
gnumeric_sheet_rangesel_stop (GNUMERIC_SHEET (scg->canvas));
scg_stop_sliding (scg);
......
......@@ -95,6 +95,7 @@ struct _WorkbookControlGUI {
Cell *editing_cell;
Sheet *editing_sheet;
gboolean editing;
SheetControlGUI *rangesel;
GtkWidget *table;
GtkWidget *auto_expr_label;
......
......@@ -3043,19 +3043,11 @@ cb_notebook_switch_page (GtkNotebook *notebook, GtkNotebookPage *page,
if (wbcg->editing) {
/* If we are not at a subexpression boundary then finish editing */
if (scg_rangesel_possible (wb_control_gui_cur_sheet (wbcg))) {
GtkWidget *w = gtk_notebook_get_nth_page (wbcg->notebook, page_num);
SheetControlGUI *scg = SHEET_CONTROL_GUI (w);
Sheet *sheet = scg->sheet;
int opt = (wbcg->editing_sheet == sheet)
? GNUM_EE_SHEET_OPTIONAL : 0;
gnumeric_expr_entry_set_scg (wbcg_get_entry_logical (wbcg), scg);
gnumeric_expr_entry_set_flags (wbcg_get_entry_logical (wbcg),
opt, GNUM_EE_SINGLE_RANGE | GNUM_EE_SHEET_OPTIONAL);
scg_rangesel_start (scg,
sheet->edit_pos_real.col, sheet->edit_pos_real.row);
scg_take_focus (scg);
if (NULL != wbcg->rangesel)
scg_rangesel_stop (wbcg->rangesel, TRUE);
if (wbcg_editing_expr (wbcg)) {
scg_take_focus (SHEET_CONTROL_GUI (page->child));
return;
}
wbcg_edit_finish (wbcg, FALSE);
......@@ -3472,6 +3464,7 @@ workbook_control_gui_init (WorkbookControlGUI *wbcg,
wbcg->editing = FALSE;
wbcg->editing_sheet = NULL;
wbcg->editing_cell = NULL;
wbcg->rangesel = NULL;
gtk_signal_connect_after (
GTK_OBJECT (wbcg->toplevel), "delete_event",
......
......@@ -212,7 +212,8 @@ wbcg_edit_finish (WorkbookControlGUI *wbcg, gboolean accept)
}
/* Remove the range selection cursor if it exists */
scg_rangesel_stop (wb_control_gui_cur_sheet (wbcg), FALSE);
if (NULL != wbcg->rangesel)
scg_rangesel_stop (wbcg->rangesel, FALSE);
/* Stop editing */
wbcg->editing = FALSE;
......
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