Commit e886f3af authored by Michael Meeks's avatar Michael Meeks Committed by Michael Meeks

don't setup the item container.

2002-02-06  Michael Meeks  <michael@ximian.com>

	* src/workbook.c (workbook_bonobo_setup): don't
	setup the item container.

	* src/gnumeric-graph.c: porting action.
	(bonobo_activation_exception_id): kill.

	* src/corba-args.c (gnumeric_arg_parse): upd.

	* src/bonobo-io.c: porting action.

	* src/sheet-object-bonobo.c: porting action.
parent 5107cd92
2002-02-06 Michael Meeks <michael@ximian.com>
* src/workbook.c (workbook_bonobo_setup): don't
setup the item container.
* src/gnumeric-graph.c: porting action.
(bonobo_activation_exception_id): kill.
* src/corba-args.c (gnumeric_arg_parse): upd.
* src/bonobo-io.c: porting action.
* src/sheet-object-bonobo.c: porting action.
2002-02-06 Jody Goldberg <jody@gnome.org>
* src/sheet-autofill.c (autofill_create_fill_items) : changes to the
......
2002-02-06 Michael Meeks <michael@ximian.com>
* src/workbook.c (workbook_bonobo_setup): don't
setup the item container.
* src/gnumeric-graph.c: porting action.
(bonobo_activation_exception_id): kill.
* src/corba-args.c (gnumeric_arg_parse): upd.
* src/bonobo-io.c: porting action.
* src/sheet-object-bonobo.c: porting action.
2002-02-06 Jody Goldberg <jody@gnome.org>
* src/sheet-autofill.c (autofill_create_fill_items) : changes to the
......
2002-02-06 Michael Meeks <michael@ximian.com>
* src/workbook.c (workbook_bonobo_setup): don't
setup the item container.
* src/gnumeric-graph.c: porting action.
(bonobo_activation_exception_id): kill.
* src/corba-args.c (gnumeric_arg_parse): upd.
* src/bonobo-io.c: porting action.
* src/sheet-object-bonobo.c: porting action.
2002-02-06 Jody Goldberg <jody@gnome.org>
* src/sheet-autofill.c (autofill_create_fill_items) : changes to the
......
......@@ -6,6 +6,7 @@
* Jody Goldberg <jody@gnome.org>
*/
#include <gnumeric-config.h>
#include <string.h>
#include "gnumeric.h"
#include "application.h"
......
......@@ -55,7 +55,7 @@ write_stream_to_storage (xmlNodePtr cur,
name = g_strdup_printf ("stream %d", idx++);
stream = Bonobo_Storage_openStream (storage, name, flags, ev);
if (ev->_major == CORBA_USER_EXCEPTION &&
strcmp (ev->_repo_id, ex_Bonobo_Storage_NameExists)) {
strcmp (ev->_id, ex_Bonobo_Storage_NameExists)) {
CORBA_exception_free (ev);
loop = TRUE;
}
......@@ -104,8 +104,7 @@ gnumeric_bonobo_obj_write (xmlNodePtr cur,
sob = SHEET_OBJECT_BONOBO (object);
ps = Bonobo_Unknown_queryInterface (
BONOBO_OBJREF (sob->object_server),
"IDL:Bonobo/PersistStream:1.0", &ev);
sob->object_server, "IDL:Bonobo/PersistStream:1.0", &ev);
if (!BONOBO_EX (&ev) && ps != CORBA_OBJECT_NIL) {
write_stream_to_storage (cur, ps, storage, &ev);
......@@ -204,8 +203,7 @@ gnumeric_bonobo_obj_read (xmlNodePtr tree,
sname = xmlGetProp (tree, (xmlChar *)"Stream");
if (sname)
read_stream_from_storage (
BONOBO_OBJREF (sob->object_server),
storage, (char *)sname, &ev);
sob->object_server, storage, (char *)sname, &ev);
else
g_warning ("No stream");
......@@ -245,8 +243,12 @@ gnumeric_bonobo_write_workbook (GnumFileSaver const *fs,
flags = Bonobo_Storage_CREATE | Bonobo_Storage_WRITE |
Bonobo_Storage_FAILIFEXIST;
#warning FIXME - needs grunt.
#ifdef GNOME2_CONVERSION_COMPLETE
storage = bonobo_storage_open (BONOBO_IO_DRIVER_FS,
filename, flags, 0664);
#endif
storage = NULL;
if (!storage) {
char *msg = g_strdup_printf ("Can't open '%s'", filename);
......@@ -290,7 +292,7 @@ gnumeric_bonobo_write_workbook (GnumFileSaver const *fs,
BONOBO_OBJREF (storage),
"Workbook", flags, &ev);
if (ev._major == CORBA_USER_EXCEPTION &&
strcmp (ev._repo_id, ex_Bonobo_Storage_NameExists)) {
strcmp (ev._id, ex_Bonobo_Storage_NameExists)) {
g_warning ("Workbook stream already exists");
gnumeric_io_error_unknown (context);
} else {
......@@ -430,8 +432,13 @@ gnumeric_bonobo_read_workbook (GnumFileOpener const *fo,
g_return_if_fail (filename != NULL);
#warning FIXME - needs grunt.
#ifdef GNOME2_CONVERSION_COMPLETE
storage = bonobo_storage_open (BONOBO_IO_DRIVER_FS,
filename, Bonobo_Storage_READ, 0);
#endif
storage = NULL;
if (!storage) {
char *msg = g_strdup_printf ("Can't open '%s'", filename);
gnumeric_io_error_save (context, msg);
......
......@@ -18,23 +18,19 @@
#include "value.h"
#include <libgnome/gnome-i18n.h>
#include <liboaf/liboaf.h>
#include <bonobo.h>
void
gnumeric_arg_parse (int argc, char *argv [])
{
CORBA_ORB orb;
ctx = NULL;
gnomelib_register_popt_table (oaf_popt_options, _("Oaf options"));
#warning FIXME: this should use gnome_program_init
gnome_init_with_popt_table ("gnumeric", VERSION,
argc, argv, gnumeric_popt_options, 0, &ctx);
orb = oaf_init (argc, argv);
if (bonobo_init (orb, NULL, NULL) == FALSE)
if (bonobo_init (&argc, argv) == FALSE)
g_error ("Failure starting up Bonobo");
}
......
......@@ -8,6 +8,10 @@
* Miguel de Icaza (miguel@gnu.org)
*/
#warning re-write me with BonoboObject
#ifdef GNOME2_CONVERSION_COMPLETE
#include <gnumeric-config.h>
#include "gnumeric.h"
#include <idl/Gnumeric.h>
......@@ -16,7 +20,6 @@
#include "workbook.h"
#include "corba.h"
#include <liboaf/liboaf.h>
#include <bonobo.h>
#include <bonobo/bonobo-object-directory.h>
......@@ -183,3 +186,4 @@ WorkbookFactory_init (void)
return retval;
}
#endif
2002-02-06 Michael Meeks <michael@ximian.com>
* dialog-graph-guru.c (dialog_graph_guru): fix typo.
2002-02-06 Andreas J. Guelzow <aguelzow@taliesin.ca>
* dialog-cell-sort.c (cb_sort_selection_changed) : handle delete
......
......@@ -41,6 +41,7 @@
#include <workbook.h>
#include <commands.h>
#include <selection.h>
#include <ranges.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
......
......@@ -1083,7 +1083,7 @@ dialog_graph_guru (WorkbookControlGUI *wbcg, GnmGraph *graph, int page)
state->graph = graph;
g_object_ref (G_OBJECT (state->graph));
} else
state->graph = GNM_GRAPH (gnm_graph_new (state->wb));
state->graph = GNUMERIC_GRAPH (gnm_graph_new (state->wb));
if (state->graph != NULL && page == 0) {
GList *ptr = g_list_last (state->sheet->selections);
......
......@@ -32,6 +32,7 @@
#include "ranges.h"
#include "xml-io.h"
#include "plugin-util.h" /* for gnumeric_fopen */
#include <string.h>
#include <libxml/parser.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
......
......@@ -44,7 +44,6 @@
#include <idl/GNOME_Gnumeric_Graph.h>
#include <bonobo.h>
#include <liboaf/liboaf.h>
#include <gal/util/e-util.h>
#include <gal/util/e-xml-utils.h>
#include <libxml/parser.h>
......@@ -64,7 +63,7 @@
struct _GnmGraph {
SheetObjectContainer parent;
BonoboObjectClient *manager_client;
Bonobo_Unknown manager_client;
MANAGER manager;
GPtrArray *vectors;
......@@ -709,21 +708,6 @@ gnm_graph_add_vector (GnmGraph *graph, ExprTree *expr,
return vector ? vector->id : -1;
}
static char *
bonobo_activation_exception_id (CORBA_Environment *ev)
{
if (ev->_major == CORBA_USER_EXCEPTION) {
if (!strcmp (ev->_id, "IDL:Bonobo/GeneralError:1.0")) {
OAF_GeneralError *err = ev->_params;
if (err != NULL && err->description != NULL)
return err->description;
return "No general exception error message";
} else
return ev->_repo_id;
} else
return CORBA_exception_id (ev);
}
static gboolean
gnm_graph_setup (GnmGraph *graph, Workbook *wb)
{
......@@ -738,18 +722,19 @@ gnm_graph_setup (GnmGraph *graph, Workbook *wb)
if (ev._major != CORBA_NO_EXCEPTION || o == CORBA_OBJECT_NIL) {
g_warning ("'%s' : while attempting to activate a graphing component.\n"
"bonobo-activation-run-query \"repo_ids.has('" MANAGER_OAF "')\"\nshould return a value.",
bonobo_activation_exception_id (&ev));
bonobo_exception_get_text (&ev));
graph = NULL;
} else {
graph->manager = Bonobo_Unknown_queryInterface (o, MANAGER_OAF, &ev);
g_return_val_if_fail (graph->manager != CORBA_OBJECT_NIL, TRUE);
graph->manager_client = bonobo_object_client_from_corba (graph->manager);
graph->manager_client = graph->manager;
bonobo_object_release_unref (o, &ev);
#warning FIXME - we need a Bonobo_UIContainer from somewhere.
if (sheet_object_bonobo_construct (SHEET_OBJECT_BONOBO (graph),
wb->priv->bonobo_container, NULL) == NULL ||
CORBA_OBJECT_NIL, NULL) == NULL ||
!sheet_object_bonobo_set_server (SHEET_OBJECT_BONOBO (graph),
graph->manager_client)) {
graph = NULL;
......@@ -1005,10 +990,10 @@ gnm_graph_init (GtkObject *obj)
{
GnmGraph *graph = GNUMERIC_GRAPH (obj);
graph->xml_doc = NULL;
graph->vectors = NULL;
graph->manager = CORBA_OBJECT_NIL;
graph->xml_doc = NULL;
graph->manager_client = NULL;
graph->manager_client = CORBA_OBJECT_NIL;
graph->vectors = g_ptr_array_new ();
}
......@@ -1019,9 +1004,9 @@ gnm_graph_destroy (GtkObject *obj)
d(printf ("gnumeric : graph destroy %p\n", obj));
if (graph->manager_client != NULL) {
bonobo_object_unref (BONOBO_OBJECT (graph->manager_client));
graph->manager_client = NULL;
if (graph->manager_client != CORBA_OBJECT_NIL) {
bonobo_object_release_unref (graph->manager_client, NULL);
graph->manager_client = CORBA_OBJECT_NIL;
graph->manager = CORBA_OBJECT_NIL;
}
if (graph->vectors != NULL) {
......@@ -1227,7 +1212,7 @@ char *
gnm_graph_exception (CORBA_Environment *ev)
{
if (ev->_major == CORBA_USER_EXCEPTION) {
if (!strcmp (ev->_repo_id, "IDL:GNOME/Gnumeric/Error:1.0")) {
if (!strcmp (ev->_id, "IDL:GNOME/Gnumeric/Error:1.0")) {
GNOME_Gnumeric_Error *err = ev->_params;
if (!err || !err->mesg) {
......@@ -1236,7 +1221,7 @@ gnm_graph_exception (CORBA_Environment *ev)
return err->mesg;
}
} else {
return ev->_repo_id;
return ev->_id;
}
} else
return CORBA_exception_id (ev);
......
......@@ -19,6 +19,7 @@
#include "plugin.h"
#include <fnmatch.h>
#include <string.h>
#include <glib.h>
#include <libxml/tree.h>
#include <libxml/xmlmemory.h>
......
......@@ -13,6 +13,7 @@
#include "mathfunc.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
/* Arithmetic sum. */
int
......
......@@ -29,9 +29,6 @@
#include <math.h>
#include <gdk/gdkkeysyms.h>
#include <bonobo/bonobo-item-container.h>
#include <bonobo/bonobo-view-frame.h>
#include <bonobo/bonobo-client-site.h>
#include <bonobo/bonobo-embeddable.h>
#include <bonobo/bonobo-stream-memory.h>
#include <gal/util/e-util.h>
......@@ -50,9 +47,9 @@ sheet_object_bonobo_destroy (GtkObject *object)
sob->control_frame = NULL;
}
if (sob->object_server != NULL) {
bonobo_object_unref (BONOBO_OBJECT (sob->object_server));
sob->object_server = NULL;
if (sob->object_server != CORBA_OBJECT_NIL) {
bonobo_object_release_unref (sob->object_server, NULL);
sob->object_server = CORBA_OBJECT_NIL;
}
if (sob->object_id != NULL) {
......@@ -107,8 +104,9 @@ sheet_object_bonobo_load_persist_file (SheetObjectBonobo *sob,
g_return_if_fail (IS_SHEET_OBJECT_BONOBO (sob));
g_return_if_fail (sob->has_persist_file);
pf = Bonobo_Unknown_queryInterface (BONOBO_OBJREF (sob->object_server),
"IDL:Bonobo/PersistFile:1.0", ev);
pf = Bonobo_Unknown_queryInterface (
sob->object_server, "IDL:Bonobo/PersistFile:1.0", ev);
if (!BONOBO_EX (ev)) {
Bonobo_PersistFile_load (pf, fname, ev);
bonobo_object_release_unref (pf, NULL);
......@@ -125,9 +123,9 @@ sheet_object_bonobo_load_persist_stream (SheetObjectBonobo *sob,
bonobo_return_if_fail (IS_SHEET_OBJECT_BONOBO (sob), ev);
g_return_if_fail (sob->has_persist_stream);
ps = Bonobo_Unknown_queryInterface (BONOBO_OBJREF (sob->object_server),
"IDL:Bonobo/PersistStream:1.0",
ev);
ps = Bonobo_Unknown_queryInterface (
sob->object_server, "IDL:Bonobo/PersistStream:1.0", ev);
if (!BONOBO_EX (ev)) {
Bonobo_PersistStream_load (ps,
(Bonobo_Stream) BONOBO_OBJREF (stream), "", ev);
......@@ -145,9 +143,9 @@ sheet_object_bonobo_save_persist_stream (SheetObjectBonobo const *sob,
bonobo_return_if_fail (IS_SHEET_OBJECT_BONOBO (sob), ev);
g_return_if_fail (sob->has_persist_stream);
ps = Bonobo_Unknown_queryInterface (BONOBO_OBJREF (sob->object_server),
"IDL:Bonobo/PersistStream:1.0",
ev);
ps = Bonobo_Unknown_queryInterface (
sob->object_server, "IDL:Bonobo/PersistStream:1.0", ev);
if (!BONOBO_EX (ev)) {
Bonobo_PersistStream_save (ps,
(Bonobo_Stream) BONOBO_OBJREF (stream), "", ev);
......@@ -395,8 +393,7 @@ sheet_object_bonobo_set_server (SheetObjectBonobo *sob,
BonoboObjectClient *server)
{
g_return_val_if_fail (IS_SHEET_OBJECT_BONOBO (sob), FALSE);
g_return_val_if_fail (sob->object_server == NULL, FALSE);
g_return_val_if_fail (BONOBO_IS_OBJECT_CLIENT (server), FALSE);
g_return_val_if_fail (sob->object_server == CORBA_OBJECT_NIL, FALSE);
if (!bonobo_client_site_bind_embeddable (sob->control_frame, server))
return FALSE;
......
......@@ -2,6 +2,7 @@
#define GNUMERIC_SHEET_OBJECT_BONOBO_H
#include "sheet-object-impl.h"
#include <bonobo/bonobo-stream.h>
#include <bonobo/bonobo-control-frame.h>
/*
......@@ -27,7 +28,9 @@ typedef struct {
BonoboControlFrame *client_site;
char *object_id;
Bonobo_ControlFactory *factory;
Bonobo_Unknown object_server;
Bonobo_ControlFactory factory;
gboolean has_persist_file;
gboolean has_persist_stream;
} SheetObjectBonobo;
......@@ -44,7 +47,7 @@ char const *sheet_object_bonobo_get_object_iid (SheetObjectBonobo const *sob);
gboolean sheet_object_bonobo_set_object_iid (SheetObjectBonobo *sob,
char const *object_id);
gboolean sheet_object_bonobo_set_server (SheetObjectBonobo *sob,
BonoboObjectClient *object_server);
Bonobo_Unknown object_server);
void sheet_object_bonobo_load_file (SheetObjectBonobo *sob,
char const *fname,
......
......@@ -23,11 +23,6 @@
#include <libgnome/gnome-i18n.h>
#include <gal/util/e-util.h>
#include <bonobo/bonobo-item-container.h>
#include <bonobo/bonobo-view-frame.h>
#include <bonobo/bonobo-client-site.h>
#include <bonobo/bonobo-embeddable.h>
#include <bonobo/bonobo-object-client.h>
#include <bonobo/bonobo-object-directory.h>
#include <bonobo/bonobo-exception.h>
static void
......
......@@ -2,7 +2,6 @@
#define GNUMERIC_SHEET_OBJECT_ITEM_H
#include "sheet-object-bonobo.h"
#include <bonobo/bonobo-client-site.h>
/*
* SheetObjectItem:
......@@ -32,5 +31,3 @@ SheetObject *sheet_object_item_new (Sheet *sheet,
const char *object_id);
#endif /* GNUMERIC_SHEET_OBJECT_ITEM_H */
......@@ -21,6 +21,7 @@
* USA
*/
#include <gnumeric-config.h>
#include <string.h>
#include "gnumeric.h"
#include "sheet-style.h"
......@@ -478,7 +479,6 @@ sheet_style_shutdown (Sheet *sheet)
void
sheet_style_set_auto_pattern_color (Sheet *sheet, StyleColor *pattern_color)
{
StyleColor *apc;
int ref_count;
g_return_if_fail (IS_SHEET (sheet));
......
......@@ -20,6 +20,7 @@
*/
#include <gnumeric-config.h>
#include <string.h>
#include "gnumeric.h"
#include "validation.h"
#include "expr.h"
......
......@@ -25,9 +25,6 @@ struct _WorkbookPrivate {
/* The base object for the Workbook */
BonoboObject bonobo_object;
/* A BonoboContainer */
BonoboItemContainer *bonobo_container;
BonoboPersistFile *persist_file;
/* A list of EmbeddableGrids exported to the world */
......
......@@ -326,8 +326,6 @@ workbook_container_get_object (BonoboObject *container, CORBA_char *item_name,
static void
workbook_bonobo_setup (Workbook *wb)
{
wb->priv->bonobo_container = BONOBO_ITEM_CONTAINER (bonobo_item_container_new ());
/* FIXME : This is totaly broken.
* 1) it does not belong here at the workbook level
* 2) which bonobo object to use ?
......
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