Commit 765fdd37 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Use bonobo_object_unref rather than bonobo_object_client_unref.


2000-09-28  Jody Goldberg <jgoldberg@home.com>

	* src/dialogs/dialog-graph-guru.c (graph_guru_state_destroy) : Use
	  bonobo_object_unref rather than bonobo_object_client_unref.
	(cb_graph_guru_clicked) : On success clear the State's pointer to the
	  manager so that it does not get deleted.
	(graph_manager_destroy) : new routine to clear out the remote manager.
	(graph_guru_init_manager) : Use it.

	* src/workbook.c (cut_cmd) : Delete the object explicitly.
	* src/sheet-object.c (sheet_object_remove_cb) : Ditto.

	* src/sheet-object-container.c (view_destroyed) : rename from
	  item_destroy to clarify its function.

	* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : Add
	  KP_Delete.  There is no need to change the mode and clear anything.
	  The sheet_object destructor takes care of it.
parent f6c871f2
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-graph-guru.c (graph_guru_state_destroy) : Use
bonobo_object_unref rather than bonobo_object_client_unref.
(cb_graph_guru_clicked) : On success clear the State's pointer to the
manager so that it does not get deleted.
(graph_manager_destroy) : new routine to clear out the remote manager.
(graph_guru_init_manager) : Use it.
* src/workbook.c (cut_cmd) : Delete the object explicitly.
* src/sheet-object.c (sheet_object_remove_cb) : Ditto.
* src/sheet-object-container.c (view_destroyed) : rename from
item_destroy to clarify its function.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : Add
KP_Delete. There is no need to change the mode and clear anything.
The sheet_object destructor takes care of it.
2000-09-28 Pablo Saratxaga <pablo@mandrakesoft.com>
* configure.in,po/ca.po: Added Catalan language file
......
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-graph-guru.c (graph_guru_state_destroy) : Use
bonobo_object_unref rather than bonobo_object_client_unref.
(cb_graph_guru_clicked) : On success clear the State's pointer to the
manager so that it does not get deleted.
(graph_manager_destroy) : new routine to clear out the remote manager.
(graph_guru_init_manager) : Use it.
* src/workbook.c (cut_cmd) : Delete the object explicitly.
* src/sheet-object.c (sheet_object_remove_cb) : Ditto.
* src/sheet-object-container.c (view_destroyed) : rename from
item_destroy to clarify its function.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : Add
KP_Delete. There is no need to change the mode and clear anything.
The sheet_object destructor takes care of it.
2000-09-28 Pablo Saratxaga <pablo@mandrakesoft.com>
* configure.in,po/ca.po: Added Catalan language file
......
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-graph-guru.c (graph_guru_state_destroy) : Use
bonobo_object_unref rather than bonobo_object_client_unref.
(cb_graph_guru_clicked) : On success clear the State's pointer to the
manager so that it does not get deleted.
(graph_manager_destroy) : new routine to clear out the remote manager.
(graph_guru_init_manager) : Use it.
* src/workbook.c (cut_cmd) : Delete the object explicitly.
* src/sheet-object.c (sheet_object_remove_cb) : Ditto.
* src/sheet-object-container.c (view_destroyed) : rename from
item_destroy to clarify its function.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : Add
KP_Delete. There is no need to change the mode and clear anything.
The sheet_object destructor takes care of it.
2000-09-28 Pablo Saratxaga <pablo@mandrakesoft.com>
* configure.in,po/ca.po: Added Catalan language file
......
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-graph-guru.c (graph_guru_state_destroy) : Use
bonobo_object_unref rather than bonobo_object_client_unref.
(cb_graph_guru_clicked) : On success clear the State's pointer to the
manager so that it does not get deleted.
(graph_manager_destroy) : new routine to clear out the remote manager.
(graph_guru_init_manager) : Use it.
* src/workbook.c (cut_cmd) : Delete the object explicitly.
* src/sheet-object.c (sheet_object_remove_cb) : Ditto.
* src/sheet-object-container.c (view_destroyed) : rename from
item_destroy to clarify its function.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : Add
KP_Delete. There is no need to change the mode and clear anything.
The sheet_object destructor takes care of it.
2000-09-28 Pablo Saratxaga <pablo@mandrakesoft.com>
* configure.in,po/ca.po: Added Catalan language file
......
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-graph-guru.c (graph_guru_state_destroy) : Use
bonobo_object_unref rather than bonobo_object_client_unref.
(cb_graph_guru_clicked) : On success clear the State's pointer to the
manager so that it does not get deleted.
(graph_manager_destroy) : new routine to clear out the remote manager.
(graph_guru_init_manager) : Use it.
* src/workbook.c (cut_cmd) : Delete the object explicitly.
* src/sheet-object.c (sheet_object_remove_cb) : Ditto.
* src/sheet-object-container.c (view_destroyed) : rename from
item_destroy to clarify its function.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : Add
KP_Delete. There is no need to change the mode and clear anything.
The sheet_object destructor takes care of it.
2000-09-28 Pablo Saratxaga <pablo@mandrakesoft.com>
* configure.in,po/ca.po: Added Catalan language file
......
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-graph-guru.c (graph_guru_state_destroy) : Use
bonobo_object_unref rather than bonobo_object_client_unref.
(cb_graph_guru_clicked) : On success clear the State's pointer to the
manager so that it does not get deleted.
(graph_manager_destroy) : new routine to clear out the remote manager.
(graph_guru_init_manager) : Use it.
* src/workbook.c (cut_cmd) : Delete the object explicitly.
* src/sheet-object.c (sheet_object_remove_cb) : Ditto.
* src/sheet-object-container.c (view_destroyed) : rename from
item_destroy to clarify its function.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : Add
KP_Delete. There is no need to change the mode and clear anything.
The sheet_object destructor takes care of it.
2000-09-28 Pablo Saratxaga <pablo@mandrakesoft.com>
* configure.in,po/ca.po: Added Catalan language file
......
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-graph-guru.c (graph_guru_state_destroy) : Use
bonobo_object_unref rather than bonobo_object_client_unref.
(cb_graph_guru_clicked) : On success clear the State's pointer to the
manager so that it does not get deleted.
(graph_manager_destroy) : new routine to clear out the remote manager.
(graph_guru_init_manager) : Use it.
* src/workbook.c (cut_cmd) : Delete the object explicitly.
* src/sheet-object.c (sheet_object_remove_cb) : Ditto.
* src/sheet-object-container.c (view_destroyed) : rename from
item_destroy to clarify its function.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : Add
KP_Delete. There is no need to change the mode and clear anything.
The sheet_object destructor takes care of it.
2000-09-28 Pablo Saratxaga <pablo@mandrakesoft.com>
* configure.in,po/ca.po: Added Catalan language file
......
......@@ -100,7 +100,7 @@ graph_guru_state_destroy (GraphGuruState *state)
state->control = CORBA_OBJECT_NIL;
}
if (state->manager_client != NULL) {
bonobo_object_client_unref (state->manager_client, NULL);
bonobo_object_unref (BONOBO_OBJECT(state->manager_client));
state->manager_client = NULL;
state->manager = CORBA_OBJECT_NIL;
}
......@@ -199,6 +199,9 @@ cb_graph_guru_clicked (GtkWidget *button, GraphGuruState *state)
sheet_object_container_new_bonobo (sheet,
client_site));
}
/* Clear the manager to avoid destroying it when the dialog is removed */
state->manager_client = NULL;
}
gtk_object_destroy (GTK_OBJECT(state->dialog));
......@@ -275,6 +278,13 @@ graph_guru_init (GraphGuruState *state)
return FALSE;
}
static void
graph_manager_destroy (BonoboObjectClient *manager_client, gpointer ignored)
{
printf ("GNUMERIC : unref the manager\n");
bonobo_object_client_unref (manager_client, NULL);
}
static gboolean
graph_guru_init_manager (GraphGuruState *state)
{
......@@ -289,10 +299,17 @@ graph_guru_init_manager (GraphGuruState *state)
state->control = CORBA_OBJECT_NIL;
if (o != CORBA_OBJECT_NIL) {
state->manager_client = bonobo_object_client_from_corba (o);
if (state->manager_client != NULL)
if (state->manager_client != NULL) {
/* Catch destroy so that we can unref the remote object */
gtk_signal_connect (
GTK_OBJECT (state->manager_client), "destroy",
GTK_SIGNAL_FUNC (graph_manager_destroy), NULL);
state->manager = bonobo_object_query_interface (
BONOBO_OBJECT (state->manager_client),
"IDL:GNOME/Gnumeric/Graph/Manager:1.0");
}
}
CORBA_exception_free (&ev);
......
......@@ -787,11 +787,10 @@ gnumeric_sheet_key_mode_object (GnumericSheet *gsheet, GdkEventKey *event)
application_clipboard_unant ();
break;
case GDK_BackSpace:
case GDK_BackSpace: /* Ick! */
case GDK_KP_Delete:
case GDK_Delete:
gtk_object_destroy (GTK_OBJECT (sheet->current_object));
sheet->current_object = NULL;
sheet_mode_edit (sheet);
break;
default:
......
......@@ -787,11 +787,10 @@ gnumeric_sheet_key_mode_object (GnumericSheet *gsheet, GdkEventKey *event)
application_clipboard_unant ();
break;
case GDK_BackSpace:
case GDK_BackSpace: /* Ick! */
case GDK_KP_Delete:
case GDK_Delete:
gtk_object_destroy (GTK_OBJECT (sheet->current_object));
sheet->current_object = NULL;
sheet_mode_edit (sheet);
break;
default:
......
......@@ -104,10 +104,10 @@ view_activated_cb (BonoboViewFrame *view_frame, gboolean activated, SheetObject
}
/*
* Invoked when an item has been destroyed
* Invoked when a view has been destroyed
*/
static void
item_destroyed (GnomeCanvasItem *item, BonoboViewFrame *view_frame)
view_destroyed (GnomeCanvasItem *item, BonoboViewFrame *view_frame)
{
if (view_frame)
bonobo_object_unref (BONOBO_OBJECT (view_frame));
......@@ -169,7 +169,7 @@ sheet_object_container_new_view (SheetObject *so, SheetView *sheet_view)
i = make_container_item (so, sheet_view, view_widget);
gtk_signal_connect (GTK_OBJECT (i), "destroy",
GTK_SIGNAL_FUNC (item_destroyed), view_frame);
GTK_SIGNAL_FUNC (view_destroyed), view_frame);
return i;
}
......
......@@ -735,7 +735,7 @@ update_bbox (SheetObject *so)
static void
sheet_object_remove_cb (GtkWidget *widget, SheetObject *so)
{
gtk_object_unref (GTK_OBJECT (so));
gtk_object_destroy (GTK_OBJECT (so));
}
static void
......
......@@ -665,10 +665,9 @@ cut_cmd (GtkWidget *widget, Workbook *wb)
{
Sheet *sheet = wb->current_sheet;
if (sheet->current_object != NULL) {
gtk_object_unref (GTK_OBJECT (sheet->current_object));
sheet->current_object = NULL;
} else
if (sheet->current_object != NULL)
gtk_object_destroy (GTK_OBJECT (sheet->current_object));
else
sheet_selection_cut (workbook_command_context_gui (wb), sheet);
sheet_mode_edit (sheet);
}
......
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