Commit 656c4897 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa

Fixed the computation of columns in the paste code.

1999-04-12  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/clipboard.c (x_selection_to_cell_region): Fixed the
	computation of columns in the paste code.

1999-04-11  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/workbook.c (insert_object_cmd): Add sample bonobo support.
	Still lacking an object server selector.

	* src/sheet.c (sheet_insert_object): Add Bonobo support.

	* src/sheet-view.c (sheet_view_insert_object): Add basic Bonobo
	support.  I need to reuse the SheetObject stuff to add control
	points to the objects and to handle repositioning.
parent e383ef00
1999-04-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/clipboard.c (x_selection_to_cell_region): Fixed the
computation of columns in the paste code.
1999-04-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/workbook.c (insert_object_cmd): Add sample bonobo support.
Still lacking an object server selector.
* src/sheet.c (sheet_insert_object): Add Bonobo support.
* src/sheet-view.c (sheet_view_insert_object): Add basic Bonobo
support. I need to reuse the SheetObject stuff to add control
points to the objects and to handle repositioning.
1999-04-12 Michael Meeks <michael@imaginator.com>
* TODO: Removed basic functions section, most are done.
......
1999-04-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/clipboard.c (x_selection_to_cell_region): Fixed the
computation of columns in the paste code.
1999-04-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/workbook.c (insert_object_cmd): Add sample bonobo support.
Still lacking an object server selector.
* src/sheet.c (sheet_insert_object): Add Bonobo support.
* src/sheet-view.c (sheet_view_insert_object): Add basic Bonobo
support. I need to reuse the SheetObject stuff to add control
points to the objects and to handle repositioning.
1999-04-12 Michael Meeks <michael@imaginator.com>
* TODO: Removed basic functions section, most are done.
......
1999-04-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/clipboard.c (x_selection_to_cell_region): Fixed the
computation of columns in the paste code.
1999-04-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/workbook.c (insert_object_cmd): Add sample bonobo support.
Still lacking an object server selector.
* src/sheet.c (sheet_insert_object): Add Bonobo support.
* src/sheet-view.c (sheet_view_insert_object): Add basic Bonobo
support. I need to reuse the SheetObject stuff to add control
points to the objects and to handle repositioning.
1999-04-12 Michael Meeks <michael@imaginator.com>
* TODO: Removed basic functions section, most are done.
......
1999-04-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/clipboard.c (x_selection_to_cell_region): Fixed the
computation of columns in the paste code.
1999-04-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/workbook.c (insert_object_cmd): Add sample bonobo support.
Still lacking an object server selector.
* src/sheet.c (sheet_insert_object): Add Bonobo support.
* src/sheet-view.c (sheet_view_insert_object): Add basic Bonobo
support. I need to reuse the SheetObject stuff to add control
points to the objects and to handle repositioning.
1999-04-12 Michael Meeks <michael@imaginator.com>
* TODO: Removed basic functions section, most are done.
......
......@@ -116,8 +116,12 @@ GNOME Spread Sheet task list
* Sheets
When adding a sheet or renaming a sheet, should we reparse everything?
<<<<<<< TODO
* Clipboard
Perhaps make a global clipboard and remove all the hacks in the
current clipboard code to find the clipboard.=======
......@@ -126,3 +130,6 @@ When adding a sheet or renaming a sheet, should we reparse everything?
>>>>>>> 1.45
......@@ -9,3 +9,7 @@
#undef HAVE_ORBIT
#undef HAVE_GTK_SELECTION_ADD_TARGET
#undef HAVE_GUILE
#ifdef HAVE_BONOBO
# define ENABLE_BONOBO
#endif
......@@ -223,9 +223,9 @@ x_selection_to_cell_region (char *data, int len)
rows++;
cur_col = 0;
} else {
cur_col++;
if (cur_col > cols)
cols = cur_col;
cur_col++;
}
data = p+1;
......@@ -233,9 +233,13 @@ x_selection_to_cell_region (char *data, int len)
}
/* Handle the remainings */
if (p != data)
if (p != data){
list = new_node (list, data, p, cur_col, rows);
cur_col++;
if (cur_col > cols)
cols = cur_col;
}
/* Return the CellRegion */
cr = g_new (CellRegion, 1);
cr->list = list;
......
......@@ -515,7 +515,7 @@ value_area_get_at_x_y (Value *v, guint x, guint y)
value_int (0));
if (v->type == VALUE_ARRAY){
g_return_val_if_fail (v->v.array.x < x ||
g_return_val_if_fail (v->v.array.x < x &&
v->v.array.y < y,
value_int (0));
return &v->v.array.vals [x][y];
......
......@@ -14,7 +14,7 @@
#include "color.h"
#include "dialogs.h"
#include "cursors.h"
#include "gnome-util.h"
#include "gnumeric-util.h"
static GnomeCanvasItem *item_grid_parent_class;
......
......@@ -687,4 +687,13 @@ sheet_view_comment_relocate (SheetView *sheet_view, int col, int row, GnomeCanva
gnome_canvas_item_set (o, "points", points, NULL);
}
#ifdef ENABLE_BONOBO
void
sheet_view_insert_object (SheetView *sheet_view, GnomeObject *object)
{
GtkWidget *view;
view = gnome_component_new_view (object);
g_warning ("Stick this into the SheetView");
}
#endif
......@@ -687,4 +687,13 @@ sheet_view_comment_relocate (SheetView *sheet_view, int col, int row, GnomeCanva
gnome_canvas_item_set (o, "points", points, NULL);
}
#ifdef ENABLE_BONOBO
void
sheet_view_insert_object (SheetView *sheet_view, GnomeObject *object)
{
GtkWidget *view;
view = gnome_component_new_view (object);
g_warning ("Stick this into the SheetView");
}
#endif
......@@ -2208,6 +2208,23 @@ sheet_destroy_columns_and_rows (Sheet *sheet)
sheet->rows_info = NULL;
}
#ifdef ENABLE_BONOBO
static void
sheet_destroy_objects (Sheet *sheet)
{
GListClientSite *l;
/*
* Kill any Bonobo links
*/
for (l = sheet->client_site_list; l; l = g_list_next (l)){
GnomeClientSite *client_site = l->data;
gtk_object_unref (GTK_OBJECT (client_site));
}
}
#endif
/**
* sheet_destroy:
* @sheet: the sheet to destroy
......@@ -2225,7 +2242,11 @@ sheet_destroy (Sheet *sheet)
g_assert (sheet != NULL);
g_return_if_fail (IS_SHEET (sheet));
g_return_if_fail (sheet->workbook == NULL);
#ifdef ENABLE_BONOBO
sheet_destroy_objects (sheet);
#endif
sheet_selections_free (sheet);
g_free (sheet->name);
......@@ -3411,3 +3432,48 @@ sheet_lookup_by_name (Sheet *base, char *name)
return NULL;
}
#ifdef ENABLE_BONOBO
void
sheet_insert_object (Sheet *sheet, char *repoid)
{
GnomeClientSite *client;
GnomeObject *object_server;
GList *l;
g_return_val_if_fail (sheet != NULL, NULL);
g_return_val_if_fail (IS_SHEET (sheet), NULL);
g_return_val_if_fail (repoid != NULL);
object_server = gnome_object_activate_with_repo_id (NULL, repoid, 0, NULL);
if (!object_server){
char *msg;
msg = g_strdup_printf (_("I was not able to activate object %s"), repoid);
gnumeric_notice (sheet->wb, GNOME_MESSAGE_BOX_ERROR, msg);
g_free (msg);
return;
}
client_site = gnome_client_site_new (sheet->wb->gnome_container);
gnome_container_add (sheet->wb->container, client_site);
if (!gnome_client_site_bind_component (client_site, object_server)){
gnumeric_notice (sheet->wb, GNOME_MESSAGE_BOX_ERROR,
_("I was unable to the bind object"));
gtk_object_unref (GTK_OBJECT (object_server));
gtk_object_unref (GTK_OBJECT (client_site));
return;
}
sheet->client_site_list = g_list_prepend (sheet->client_site_list, client_site);
for (l = sheet->sheet_views; l; l = g_list_next (l)){
SheetView *sheet_view = l->data;
sheet_view_object_add (sheet_view, object_server);
}
}
#endif
......@@ -71,6 +71,10 @@ typedef struct {
void *clipboard_paste_callback_data;
void *toolbar;
#ifdef HAVE_BONOBO
GnomeContainer *gnome_container;
#endif
} Workbook;
typedef struct {
......@@ -88,6 +92,9 @@ typedef enum {
SHEET_MODE_OBJECT_SELECTED,
} SheetModeType;
/* A list of GnomeClientSites */
typedef GList GListClientSite;
typedef struct {
int signature;
......@@ -141,6 +148,10 @@ typedef struct {
/* Solver parameters */
SolverParameters solver_parameters;
#ifdef HAVE_BONOBO
GListClientSite *client_site_list;
#endif
} Sheet;
#define SHEET_SIGNATURE 0x12349876
......
......@@ -682,6 +682,17 @@ filenames_dropped (GtkWidget * widget,
}
}
#ifdef ENABLE_BONOBO
static void
insert_object_cmd (GtkWidget *widget, Workbook *wb)
{
Sheet *sheet = workbook_get_current_sheet (wb);
char *repoid = "IDL:Sample/server:1.0";
sheet_insert_object (sheet, repoid);
}
#endif
/* File menu */
static GnomeUIInfo workbook_menu_file [] = {
......@@ -741,6 +752,14 @@ static GnomeUIInfo workbook_menu_edit [] = {
GNOMEUIINFO_SEPARATOR,
#ifdef ENABLE_BONOBO
GNOMEUIINFO_ITEM_NONE(N_("Insert object..."),
N_("Inserts a Bonobo object"),
insert_object_cmd),
#endif
GNOMEUIINFO_SEPARATOR,
#if 0
{ GNOME_APP_UI_ITEM, N_("_Define cell names"), NULL, define_cell_cmd },
GNOMEUIINFO_SEPARATOR,
......@@ -1407,6 +1426,10 @@ workbook_new (void)
workbook_list = g_list_prepend (workbook_list, wb);
gtk_widget_show_all (wb->table);
#ifdef ENABLE_BONOBO
wb->container = GNOME_CONTAINER (gnome_container_new ());
#endif
return wb;
}
......
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