Commit 4fd701fd authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

remove unused parm. Be more paranoid about focus handling.


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

	* src/workbook.c (workbook_sheet_detach) : remove unused parm.
	  Be more paranoid about focus handling.
parent 46394c4d
2000-11-06 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_sheet_detach) : remove unused parm.
Be more paranoid about focus handling.
* configure.in : fix typo.
2000-11-05 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (cb_set_cell_content) : Use cell_set_value.
......
2000-11-06 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_sheet_detach) : remove unused parm.
Be more paranoid about focus handling.
* configure.in : fix typo.
2000-11-05 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (cb_set_cell_content) : Use cell_set_value.
......
2000-11-06 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_sheet_detach) : remove unused parm.
Be more paranoid about focus handling.
* configure.in : fix typo.
2000-11-05 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (cb_set_cell_content) : Use cell_set_value.
......
2000-11-06 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_sheet_detach) : remove unused parm.
Be more paranoid about focus handling.
* configure.in : fix typo.
2000-11-05 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (cb_set_cell_content) : Use cell_set_value.
......
2000-11-06 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_sheet_detach) : remove unused parm.
Be more paranoid about focus handling.
* configure.in : fix typo.
2000-11-05 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (cb_set_cell_content) : Use cell_set_value.
......
......@@ -10,12 +10,12 @@ module GNOME {
module Gnumeric {
interface VectorNotify {
oneway void remove ();
oneway void name_changed (in string name);
oneway void nameChanged (in string name);
};
typedef sequence<double> SeqScalar;
interface VectorScalarNotify : VectorNotify {
oneway void value_changed (in short start, in SeqScalar new_values);
oneway void valueChanged (in short start, in SeqScalar new_values);
};
interface VectorScalar : VectorScalarNotify {
void value (out SeqScalar values, out string name);
......@@ -23,7 +23,7 @@ module GNOME {
typedef sequence<long> SeqDate;
interface VectorDateNotify : VectorNotify {
oneway void value_changed (in short start, in SeqDate new_values);
oneway void valueChanged (in short start, in SeqDate new_values);
};
interface VectorDate : VectorDateNotify {
void value (out SeqDate values, out string name);
......@@ -31,7 +31,7 @@ module GNOME {
typedef sequence<string> SeqString;
interface VectorStringNotify : VectorNotify {
oneway void value_changed (in short start, in SeqString new_values);
oneway void valueChanged (in short start, in SeqString new_values);
};
interface VectorString : VectorStringNotify {
void value (out SeqString values, out string name);
......@@ -39,12 +39,12 @@ module GNOME {
module Graph {
interface Manager : Bonobo::Unknown {
Bonobo::Control get_type_select_control ();
Bonobo::Control get_layout_control ();
Bonobo::Control getTypeSelectControl ();
Bonobo::Control getLayoutControl ();
VectorScalarNotify add_vector_scalar (in VectorScalar vec);
VectorDateNotify add_vector_date (in VectorDate vec);
VectorStringNotify add_vector_string (in VectorString vec);
VectorScalarNotify addVectorScalar (in VectorScalar vec);
VectorDateNotify addVectorDate (in VectorDate vec);
VectorStringNotify addVectorString (in VectorString vec);
oneway void freeze ();
oneway void thaw ();
......
......@@ -10,12 +10,12 @@ module GNOME {
module Gnumeric {
interface VectorNotify {
oneway void remove ();
oneway void name_changed (in string name);
oneway void nameChanged (in string name);
};
typedef sequence<double> SeqScalar;
interface VectorScalarNotify : VectorNotify {
oneway void value_changed (in short start, in SeqScalar new_values);
oneway void valueChanged (in short start, in SeqScalar new_values);
};
interface VectorScalar : VectorScalarNotify {
void value (out SeqScalar values, out string name);
......@@ -23,7 +23,7 @@ module GNOME {
typedef sequence<long> SeqDate;
interface VectorDateNotify : VectorNotify {
oneway void value_changed (in short start, in SeqDate new_values);
oneway void valueChanged (in short start, in SeqDate new_values);
};
interface VectorDate : VectorDateNotify {
void value (out SeqDate values, out string name);
......@@ -31,7 +31,7 @@ module GNOME {
typedef sequence<string> SeqString;
interface VectorStringNotify : VectorNotify {
oneway void value_changed (in short start, in SeqString new_values);
oneway void valueChanged (in short start, in SeqString new_values);
};
interface VectorString : VectorStringNotify {
void value (out SeqString values, out string name);
......@@ -39,12 +39,12 @@ module GNOME {
module Graph {
interface Manager : Bonobo::Unknown {
Bonobo::Control get_type_select_control ();
Bonobo::Control get_layout_control ();
Bonobo::Control getTypeSelectControl ();
Bonobo::Control getLayoutControl ();
VectorScalarNotify add_vector_scalar (in VectorScalar vec);
VectorDateNotify add_vector_date (in VectorDate vec);
VectorStringNotify add_vector_string (in VectorString vec);
VectorScalarNotify addVectorScalar (in VectorScalar vec);
VectorDateNotify addVectorDate (in VectorDate vec);
VectorStringNotify addVectorString (in VectorString vec);
oneway void freeze ();
oneway void thaw ();
......
......@@ -81,6 +81,7 @@ excel_load (IOContext *context, WorkbookView *new_wb_view,
return -1;
}
puts (filename);
result = ms_excel_read_workbook (context, new_wb_view, f);
if (result == 0) {
Workbook *wb = wb_view_workbook (new_wb_view);
......
......@@ -2190,7 +2190,7 @@ ms_excel_read_formula (BiffQuery *q, ExcelSheet *sheet)
} else
cell_assign_value (cell, val, NULL);
} else if (!cell_has_expr (cell)) {
cell_set_expr_and_value (cell, expr, val);
cell_set_expr_and_value (cell, expr, val, NULL);
expr_tree_unref (expr);
} else {
/*
......@@ -2591,7 +2591,7 @@ ms_excel_workbook_detach (ExcelWorkbook *wb, ExcelSheet *ans)
int idx = 0;
if (ans->gnum_sheet) {
if (!workbook_sheet_detach (wb->gnum_wb, ans->gnum_sheet, FALSE))
if (!workbook_sheet_detach (wb->gnum_wb, ans->gnum_sheet))
return FALSE;
/* Detaching the sheet deletes it */
ans->gnum_sheet = NULL;
......
......@@ -26,8 +26,6 @@
#include "command-context.h"
#include "guile-support.h"
/* This is damn ugly.
* However, it will get things working again (I hope)
* until someone who actually uses this thing takes
......
......@@ -911,7 +911,7 @@ pln_read_workbook (CommandContext *context, WorkbookView *view,
result = pln_parse_sheet (context, &src);
if (result != 0)
workbook_sheet_detach (book, src.sheet, TRUE);
workbook_sheet_detach (book, src.sheet);
else
workbook_set_saveinfo (book, filename,
FILE_FL_MANUAL, NULL);
......
......@@ -277,7 +277,7 @@ get_selector_control (GraphGuruState *state)
GtkWidget *res = NULL;
CORBA_exception_init (&ev);
state->control = GNOME_Gnumeric_Graph_Manager_get_type_select_control (state->manager, &ev);
state->control = GNOME_Gnumeric_Graph_Manager_getTypeSelectControl (state->manager, &ev);
if (ev._major != CORBA_NO_EXCEPTION)
return NULL;
CORBA_exception_free (&ev);
......
......@@ -176,19 +176,19 @@ graph_vector_eval (Dependent *dep)
CORBA_exception_init (&ev);
switch (vector->type) {
case VECTOR_SCALAR :
GNOME_Gnumeric_VectorScalarNotify_value_changed (
GNOME_Gnumeric_VectorScalarNotify_valueChanged (
vector->subscriber.scalar,
0, graph_vector_seq_scalar (vector), &ev);
break;
case VECTOR_DATE :
GNOME_Gnumeric_VectorDateNotify_value_changed (
GNOME_Gnumeric_VectorDateNotify_valueChanged (
vector->subscriber.date,
0, graph_vector_seq_date (vector), &ev);
break;
case VECTOR_STRING :
GNOME_Gnumeric_VectorStringNotify_value_changed (
GNOME_Gnumeric_VectorStringNotify_valueChanged (
vector->subscriber.string,
0, graph_vector_seq_string (vector), &ev);
break;
......@@ -314,21 +314,21 @@ corba_implementation_classes_init (void)
static POA_GNOME_Gnumeric_VectorString__epv
vector_string_epv;
vector_scalar_notify_epv.value_changed = &impl_vector_scalar_changed;
vector_scalar_notify_epv.valueChanged = &impl_vector_scalar_changed;
vector_scalar_epv.value = & impl_vector_scalar_value;
vector_scalar_vepv.GNOME_Gnumeric_VectorScalarNotify_epv =
&vector_scalar_notify_epv;
vector_scalar_vepv.GNOME_Gnumeric_VectorScalar_epv =
&vector_scalar_epv;
vector_date_notify_epv.value_changed = & impl_vector_date_changed;
vector_date_notify_epv.valueChanged = & impl_vector_date_changed;
vector_date_epv.value = & impl_vector_date_value;
vector_date_vepv.GNOME_Gnumeric_VectorDateNotify_epv =
&vector_date_notify_epv;
vector_date_vepv.GNOME_Gnumeric_VectorDate_epv =
&vector_date_epv;
vector_string_notify_epv.value_changed = & impl_vector_string_changed;
vector_string_notify_epv.valueChanged = & impl_vector_string_changed;
vector_string_epv.value = & impl_vector_string_value;
vector_string_vepv.GNOME_Gnumeric_VectorStringNotify_epv =
&vector_string_notify_epv;
......@@ -517,19 +517,19 @@ graph_vector_set_subscriber (GraphVector *vector, CORBA_Object graph_manager)
switch (vector->type) {
case VECTOR_SCALAR :
vector->subscriber.scalar =
GNOME_Gnumeric_Graph_Manager_add_vector_scalar (manager,
GNOME_Gnumeric_Graph_Manager_addVectorScalar (manager,
vector->vector_ref, &ev);
break;
case VECTOR_DATE :
vector->subscriber.date =
GNOME_Gnumeric_Graph_Manager_add_vector_date (manager,
GNOME_Gnumeric_Graph_Manager_addVectorDate (manager,
vector->vector_ref, &ev);
break;
case VECTOR_STRING :
vector->subscriber.string =
GNOME_Gnumeric_Graph_Manager_add_vector_string (manager,
GNOME_Gnumeric_Graph_Manager_addVectorString (manager,
vector->vector_ref, &ev);
break;
default :
......
......@@ -176,19 +176,19 @@ graph_vector_eval (Dependent *dep)
CORBA_exception_init (&ev);
switch (vector->type) {
case VECTOR_SCALAR :
GNOME_Gnumeric_VectorScalarNotify_value_changed (
GNOME_Gnumeric_VectorScalarNotify_valueChanged (
vector->subscriber.scalar,
0, graph_vector_seq_scalar (vector), &ev);
break;
case VECTOR_DATE :
GNOME_Gnumeric_VectorDateNotify_value_changed (
GNOME_Gnumeric_VectorDateNotify_valueChanged (
vector->subscriber.date,
0, graph_vector_seq_date (vector), &ev);
break;
case VECTOR_STRING :
GNOME_Gnumeric_VectorStringNotify_value_changed (
GNOME_Gnumeric_VectorStringNotify_valueChanged (
vector->subscriber.string,
0, graph_vector_seq_string (vector), &ev);
break;
......@@ -314,21 +314,21 @@ corba_implementation_classes_init (void)
static POA_GNOME_Gnumeric_VectorString__epv
vector_string_epv;
vector_scalar_notify_epv.value_changed = &impl_vector_scalar_changed;
vector_scalar_notify_epv.valueChanged = &impl_vector_scalar_changed;
vector_scalar_epv.value = & impl_vector_scalar_value;
vector_scalar_vepv.GNOME_Gnumeric_VectorScalarNotify_epv =
&vector_scalar_notify_epv;
vector_scalar_vepv.GNOME_Gnumeric_VectorScalar_epv =
&vector_scalar_epv;
vector_date_notify_epv.value_changed = & impl_vector_date_changed;
vector_date_notify_epv.valueChanged = & impl_vector_date_changed;
vector_date_epv.value = & impl_vector_date_value;
vector_date_vepv.GNOME_Gnumeric_VectorDateNotify_epv =
&vector_date_notify_epv;
vector_date_vepv.GNOME_Gnumeric_VectorDate_epv =
&vector_date_epv;
vector_string_notify_epv.value_changed = & impl_vector_string_changed;
vector_string_notify_epv.valueChanged = & impl_vector_string_changed;
vector_string_epv.value = & impl_vector_string_value;
vector_string_vepv.GNOME_Gnumeric_VectorStringNotify_epv =
&vector_string_notify_epv;
......@@ -517,19 +517,19 @@ graph_vector_set_subscriber (GraphVector *vector, CORBA_Object graph_manager)
switch (vector->type) {
case VECTOR_SCALAR :
vector->subscriber.scalar =
GNOME_Gnumeric_Graph_Manager_add_vector_scalar (manager,
GNOME_Gnumeric_Graph_Manager_addVectorScalar (manager,
vector->vector_ref, &ev);
break;
case VECTOR_DATE :
vector->subscriber.date =
GNOME_Gnumeric_Graph_Manager_add_vector_date (manager,
GNOME_Gnumeric_Graph_Manager_addVectorDate (manager,
vector->vector_ref, &ev);
break;
case VECTOR_STRING :
vector->subscriber.string =
GNOME_Gnumeric_Graph_Manager_add_vector_string (manager,
GNOME_Gnumeric_Graph_Manager_addVectorString (manager,
vector->vector_ref, &ev);
break;
default :
......
......@@ -175,7 +175,7 @@ stf_read_workbook (IOContext *context, WorkbookView *wbv, char const *filename)
if (!stf_parse_sheet (dialogresult->parseoptions, dialogresult->newstart, sheet)) {
workbook_sheet_detach (book, sheet, TRUE);
workbook_sheet_detach (book, sheet);
/*
* Note this buffer was allocated with malloc, not g_malloc
*/
......@@ -212,7 +212,7 @@ stf_read_workbook (IOContext *context, WorkbookView *wbv, char const *filename)
workbook_set_saveinfo (book, filename, FILE_FL_MANUAL,
gnumeric_xml_write_workbook);
} else
workbook_sheet_detach (book, sheet, TRUE);
workbook_sheet_detach (book, sheet);
/*
* Note the buffer was allocated with malloc, not with g_malloc
......
......@@ -78,7 +78,7 @@ Sheet *workbook_sheet_by_index (Workbook *wb, int i);
Sheet *workbook_sheet_by_name (Workbook *wb, const char *sheet_name);
void workbook_sheet_attach (Workbook *, Sheet *new_sheet,
Sheet const *insert_after);
gboolean workbook_sheet_detach (Workbook *, Sheet *, gboolean);
gboolean workbook_sheet_detach (Workbook *, Sheet *);
Sheet *workbook_sheet_add (Workbook *wb,
Sheet const *insert_after,
gboolean make_dirty);
......
......@@ -169,7 +169,7 @@ workbook_destroy (GtkObject *wb_object)
for (ptr = sheets; ptr != NULL ; ptr = ptr->next) {
Sheet *sheet = ptr->data;
workbook_sheet_detach (wb, sheet, TRUE);
workbook_sheet_detach (wb, sheet);
}
g_list_free (sheets);
......@@ -1038,8 +1038,12 @@ workbook_sheet_attach (Workbook *wb, Sheet *new_sheet,
* Detaches @sheet from the workbook @wb.
*/
gboolean
workbook_sheet_detach (Workbook *wb, Sheet *sheet, gboolean force)
workbook_sheet_detach (Workbook *wb, Sheet *sheet)
{
gboolean do_recalc = FALSE;
Sheet *focus = NULL;
int sheet_index;
g_return_val_if_fail (IS_WORKBOOK (wb), FALSE);
g_return_val_if_fail (IS_SHEET (sheet), FALSE);
g_return_val_if_fail (sheet->workbook == wb, FALSE);
......@@ -1049,20 +1053,34 @@ workbook_sheet_detach (Workbook *wb, Sheet *sheet, gboolean force)
/* Finish any object editing */
sheet_mode_edit (sheet);
/* Remove all views */
/* TODO : Double check that focus passes smoothly in the view */
sheet_index = workbook_sheet_index_get (wb, sheet);
/* If not exiting, adjust the focus for any views whose focuse sheet
* was the one being deleted, and prepare to recalc */
if (!wb->priv->during_destruction) {
do_recalc = TRUE;
if (sheet_index > 0)
focus = g_ptr_array_index (wb->sheets, sheet_index-1);
else if ((sheet_index+1) < wb->sheets->len)
focus = g_ptr_array_index (wb->sheets, sheet_index+1);
WORKBOOK_FOREACH_VIEW (wb, view,
{
if (view->current_sheet == sheet)
wb_view_sheet_focus (view, focus);
});
}
/* Remove all controls */
WORKBOOK_FOREACH_CONTROL (wb, view, control,
wb_control_sheet_remove (control, sheet););
/* Remove our reference to this sheet */
g_ptr_array_remove_index (wb->sheets,
workbook_sheet_index_get (wb, sheet));
g_ptr_array_remove_index (wb->sheets, sheet_index);
g_hash_table_remove (wb->sheet_hash_private, sheet->name_unquoted);
sheet_destroy (sheet);
/* No need to recalc if we are exiting */
if (!wb->priv->during_destruction)
if (do_recalc);
workbook_recalc_all (wb);
return TRUE;
......@@ -1112,7 +1130,7 @@ workbook_sheet_delete (Sheet *sheet)
expr_name_invalidate_refs_sheet (sheet);
/* All is fine, remove the sheet */
workbook_sheet_detach (wb, sheet, FALSE);
workbook_sheet_detach (wb, sheet);
}
/*
......
......@@ -78,7 +78,7 @@ Sheet *workbook_sheet_by_index (Workbook *wb, int i);
Sheet *workbook_sheet_by_name (Workbook *wb, const char *sheet_name);
void workbook_sheet_attach (Workbook *, Sheet *new_sheet,
Sheet const *insert_after);
gboolean workbook_sheet_detach (Workbook *, Sheet *, gboolean);
gboolean workbook_sheet_detach (Workbook *, Sheet *);
Sheet *workbook_sheet_add (Workbook *wb,
Sheet const *insert_after,
gboolean make_dirty);
......
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