Commit 1afafe3a authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

new function. (sheet_object_container_new_bonobo) : delete.


2000-12-22  Jody Goldberg <jgoldberg@home.com>

	* src/sheet-object-container.c (sheet_object_container_new) : new
	  function.
	(sheet_object_container_new_bonobo) : delete.

2000-12-22  Jody Goldberg <jgoldberg@home.com>

	* src/cell.c (cell_set_expr_and_value) : Make linking the
	  expression optional.

	* src/ranges.c (range_init_full_sheet) : adjusted from
	  sheet_get_full_range.

2000-12-21  Jody Goldberg <jgoldberg@home.com>

	* src/bonobo-io.c (gnumeric_bonobo_obj_read) : Don't create the object
	  here.  Pass it in.
parent a8646fb6
2000-12-22 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object-container.c (sheet_object_container_new) : new
function.
(sheet_object_container_new_bonobo) : delete.
2000-12-22 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_expr_and_value) : Make linking the
expression optional.
* src/ranges.c (range_init_full_sheet) : adjusted from
sheet_get_full_range.
2000-12-22 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/boot.c gnumeric/plugins/applix/boot.c,
......@@ -18,8 +32,15 @@
* src/dialogs/dialog-stf-preview.c: Fixed bug. Allocated array was
to small.
2000-12-21 Jody Goldberg <jgoldberg@home.com>
* src/bonobo-io.c (gnumeric_bonobo_obj_read) : Don't create the object
here. Pass it in.
2000-12-20 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_position_pixels) : Add some safety.
* src/selection.c (selection_is_simple) : Fix warning.
2000-12-20 Morten Welinder <terra@diku.dk>
......
2000-12-22 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object-container.c (sheet_object_container_new) : new
function.
(sheet_object_container_new_bonobo) : delete.
2000-12-22 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_expr_and_value) : Make linking the
expression optional.
* src/ranges.c (range_init_full_sheet) : adjusted from
sheet_get_full_range.
2000-12-22 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/boot.c gnumeric/plugins/applix/boot.c,
......@@ -18,8 +32,15 @@
* src/dialogs/dialog-stf-preview.c: Fixed bug. Allocated array was
to small.
2000-12-21 Jody Goldberg <jgoldberg@home.com>
* src/bonobo-io.c (gnumeric_bonobo_obj_read) : Don't create the object
here. Pass it in.
2000-12-20 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_position_pixels) : Add some safety.
* src/selection.c (selection_is_simple) : Fix warning.
2000-12-20 Morten Welinder <terra@diku.dk>
......
2000-12-22 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object-container.c (sheet_object_container_new) : new
function.
(sheet_object_container_new_bonobo) : delete.
2000-12-22 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_expr_and_value) : Make linking the
expression optional.
* src/ranges.c (range_init_full_sheet) : adjusted from
sheet_get_full_range.
2000-12-22 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/boot.c gnumeric/plugins/applix/boot.c,
......@@ -18,8 +32,15 @@
* src/dialogs/dialog-stf-preview.c: Fixed bug. Allocated array was
to small.
2000-12-21 Jody Goldberg <jgoldberg@home.com>
* src/bonobo-io.c (gnumeric_bonobo_obj_read) : Don't create the object
here. Pass it in.
2000-12-20 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_position_pixels) : Add some safety.
* src/selection.c (selection_is_simple) : Fix warning.
2000-12-20 Morten Welinder <terra@diku.dk>
......
2000-12-22 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object-container.c (sheet_object_container_new) : new
function.
(sheet_object_container_new_bonobo) : delete.
2000-12-22 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_expr_and_value) : Make linking the
expression optional.
* src/ranges.c (range_init_full_sheet) : adjusted from
sheet_get_full_range.
2000-12-22 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/boot.c gnumeric/plugins/applix/boot.c,
......@@ -18,8 +32,15 @@
* src/dialogs/dialog-stf-preview.c: Fixed bug. Allocated array was
to small.
2000-12-21 Jody Goldberg <jgoldberg@home.com>
* src/bonobo-io.c (gnumeric_bonobo_obj_read) : Don't create the object
here. Pass it in.
2000-12-20 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_position_pixels) : Add some safety.
* src/selection.c (selection_is_simple) : Fix warning.
2000-12-20 Morten Welinder <terra@diku.dk>
......
2000-12-22 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object-container.c (sheet_object_container_new) : new
function.
(sheet_object_container_new_bonobo) : delete.
2000-12-22 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_set_expr_and_value) : Make linking the
expression optional.
* src/ranges.c (range_init_full_sheet) : adjusted from
sheet_get_full_range.
2000-12-22 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/boot.c gnumeric/plugins/applix/boot.c,
......@@ -18,8 +32,15 @@
* src/dialogs/dialog-stf-preview.c: Fixed bug. Allocated array was
to small.
2000-12-21 Jody Goldberg <jgoldberg@home.com>
* src/bonobo-io.c (gnumeric_bonobo_obj_read) : Don't create the object
here. Pass it in.
2000-12-20 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_position_pixels) : Add some safety.
* src/selection.c (selection_is_simple) : Fix warning.
2000-12-20 Morten Welinder <terra@diku.dk>
......
......@@ -945,7 +945,7 @@ applix_read_cells (ApplixReadState *state)
mstyle_set_border (tmp, MSTYLE_BORDER_TOP,
style_border_ref (border));
range_init (&r, col, row+1, col, row+1);
sheet_style_attach (sheet, r, tmp);
sheet_style_attach (sheet, &r, tmp);
}
if (mstyle_is_element_set (style, MSTYLE_BORDER_RIGHT)) {
Range r;
......@@ -955,7 +955,7 @@ applix_read_cells (ApplixReadState *state)
mstyle_set_border (tmp, MSTYLE_BORDER_LEFT,
style_border_ref (border));
range_init (&r, col+1, row, col+1, row);
sheet_style_attach (sheet, r, tmp);
sheet_style_attach (sheet, &r, tmp);
}
content_type = *ptr;
......@@ -1037,7 +1037,7 @@ applix_read_cells (ApplixReadState *state)
expr, FALSE);
cell_assign_value (cell, val, NULL);
} else
cell_set_expr_and_value (cell, expr, val, NULL);
cell_set_expr_and_value (cell, expr, val, NULL, TRUE);
if (!applix_get_line (state) ||
strncmp (state->buffer, "Formula: ", 9)) {
......@@ -1056,7 +1056,7 @@ applix_read_cells (ApplixReadState *state)
printf ("shared '%s'\n", expr_string);
#endif
expr = g_hash_table_lookup (state->exprs, expr_string);
cell_set_expr_and_value (cell, expr, val, NULL);
cell_set_expr_and_value (cell, expr, val, NULL, TRUE);
}
break;
}
......@@ -1262,7 +1262,7 @@ applix_read_impl (ApplixReadState *state)
if (tmp != ptr && attr_index >= 2 && attr_index < state->attrs->len+2) {
MStyle *style = g_ptr_array_index(state->attrs, attr_index-2);
mstyle_ref (style);
sheet_style_attach (sheet, r, style);
sheet_style_attach (sheet, &r, style);
if (mstyle_is_element_set (style, MSTYLE_BORDER_BOTTOM)) {
Range offset = r;
MStyle *tmp = mstyle_new ();
......@@ -1271,7 +1271,7 @@ applix_read_impl (ApplixReadState *state)
mstyle_set_border (tmp, MSTYLE_BORDER_TOP,
style_border_ref (border));
offset.start.row = ++offset.end.row;
sheet_style_attach (sheet, offset, tmp);
sheet_style_attach (sheet, &offset, tmp);
}
if (mstyle_is_element_set (style, MSTYLE_BORDER_RIGHT)) {
Range offset = r;
......@@ -1281,7 +1281,7 @@ applix_read_impl (ApplixReadState *state)
mstyle_set_border (tmp, MSTYLE_BORDER_LEFT,
style_border_ref (border));
offset.start.col = ++offset.end.col;
sheet_style_attach (sheet, offset, tmp);
sheet_style_attach (sheet, &offset, tmp);
}
} else if (attr_index != 1) /* TODO : What the hell is attr 1 ?? */
return applix_parse_error (state, "Invalid row format attr index");
......
......@@ -1481,10 +1481,10 @@ ms_excel_set_xf (ExcelSheet *sheet, int col, int row, guint16 xfidx)
style_border_ref (border));
}
sheet_style_attach (sheet->gnum_sheet, range, mstyle[0]);
sheet_style_attach (sheet->gnum_sheet, &range, mstyle[0]);
if (restore_style != NULL)
sheet_style_attach (sheet->gnum_sheet, range, restore_style);
sheet_style_attach (sheet->gnum_sheet, &range, restore_style);
mstyle_unref (existing_style);
#if UNDERSTAND_DUAL_BORDERS
......@@ -1496,7 +1496,7 @@ ms_excel_set_xf (ExcelSheet *sheet, int col, int row, guint16 xfidx)
range.start.col = col;
range.start.row = row+1;
range.end = range.start;
sheet_style_attach (sheet->gnum_sheet, range, mstyle[1]);
sheet_style_attach (sheet->gnum_sheet, &range, mstyle[1]);
}
if (mstyle[2] != NULL) {
#if UNDERSTAND_DUAL_BORDERS
......@@ -1506,7 +1506,7 @@ ms_excel_set_xf (ExcelSheet *sheet, int col, int row, guint16 xfidx)
range.start.col = col+1;
range.start.row = row;
range.end = range.start;
sheet_style_attach (sheet->gnum_sheet, range, mstyle[2]);
sheet_style_attach (sheet->gnum_sheet, &range, mstyle[2]);
}
style_optimize (sheet, col, row);
}
......@@ -1524,7 +1524,7 @@ ms_excel_set_xf_segment (ExcelSheet *sheet, int start_col, int end_col, int row,
range.start.row = row;
range.end.col = end_col;
range.end.row = row;
sheet_style_attach (sheet->gnum_sheet, range, mstyle[0]);
sheet_style_attach (sheet->gnum_sheet, &range, mstyle[0]);
#ifndef NO_DEBUG_EXCEL
if (ms_excel_read_debug > 2) {
......@@ -1538,7 +1538,7 @@ ms_excel_set_xf_segment (ExcelSheet *sheet, int start_col, int end_col, int row,
range.start.row = row+1;
range.end.col = end_col;
range.end.row = row+1;
sheet_style_attach (sheet->gnum_sheet, range, mstyle[1]);
sheet_style_attach (sheet->gnum_sheet, &range, mstyle[1]);
} else
mstyle_unref (mstyle[1]);
}
......@@ -1548,7 +1548,7 @@ ms_excel_set_xf_segment (ExcelSheet *sheet, int start_col, int end_col, int row,
range.start.row = row;
range.end.col = end_col+1;
range.end.row = row;
sheet_style_attach (sheet->gnum_sheet, range, mstyle[2]);
sheet_style_attach (sheet->gnum_sheet, &range, mstyle[2]);
} else
mstyle_unref (mstyle[2]);
}
......@@ -2182,7 +2182,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, NULL);
cell_set_expr_and_value (cell, expr, val, NULL, TRUE);
expr_tree_unref (expr);
} else {
/*
......@@ -2342,7 +2342,7 @@ ms_sheet_obj_create (MSContainer *container, MSObj *obj)
case 0x08 :
/* Picture */
#ifdef ENABLE_BONOBO
so = sheet_object_container_new_object (sheet, NULL);
so = sheet_object_container_new (sheet);
#else
so = NULL;
{
......
......@@ -1218,7 +1218,7 @@ xml2EndElement (XML2ParseState *state, const CHAR *name)
g_return_if_fail (state->style != NULL);
g_return_if_fail (state->sheet != NULL);
sheet_style_attach (state->sheet, state->style_range, state->style);
sheet_style_attach (state->sheet, &state->style_range, state->style);
state->style_range_init = FALSE;
state->style = NULL;
......
......@@ -1218,7 +1218,7 @@ xml2EndElement (XML2ParseState *state, const CHAR *name)
g_return_if_fail (state->style != NULL);
g_return_if_fail (state->sheet != NULL);
sheet_style_attach (state->sheet, state->style_range, state->style);
sheet_style_attach (state->sheet, &state->style_range, state->style);
state->style_range_init = FALSE;
state->style = NULL;
......
......@@ -342,7 +342,7 @@ set_italic (data_analysis_output_t *dao, int col1, int row1,
range.end.row = row2 + row_inc;
mstyle_set_font_italic (mstyle, TRUE);
sheet_style_attach (dao->sheet, range, mstyle);
sheet_style_attach (dao->sheet, &range, mstyle);
}
......
......@@ -168,36 +168,32 @@ read_stream_from_storage (Bonobo_Unknown object,
bonobo_object_release_unref (ps, ev);
}
static SheetObject *
static gboolean
gnumeric_bonobo_obj_read (xmlNodePtr tree,
SheetObject *so,
Sheet *sheet,
gpointer user_data)
{
CORBA_Environment ev;
SheetObject *so;
SheetObjectBonobo *sob;
Bonobo_Storage storage;
char *object_id, *sname;
g_return_val_if_fail (tree != NULL, FALSE);
g_return_val_if_fail (IS_SHEET (sheet), FALSE);
g_return_val_if_fail (user_data != NULL, FALSE);
g_return_val_if_fail (tree != NULL, TRUE);
g_return_val_if_fail (IS_SHEET (sheet), TRUE);
g_return_val_if_fail (user_data != NULL, TRUE);
storage = bonobo_object_corba_objref (user_data);
g_return_val_if_fail (storage != CORBA_OBJECT_NIL, FALSE);
sob = SHEET_OBJECT_BONOBO (so);
g_return_val_if_fail (sob != NULL, TRUE);
object_id = xmlGetProp (tree, "OAFIID");
if (!object_id) {
g_warning ("Malformed object, error in save; no id");
return NULL;
return TRUE;
}
so = sheet_object_container_new_object (sheet, object_id);
sob = SHEET_OBJECT_BONOBO (so);
if (!sob) {
g_warning ("Error activating '%s'", object_id);
return NULL;
}
storage = bonobo_object_corba_objref (user_data);
g_return_val_if_fail (storage != CORBA_OBJECT_NIL, TRUE);
CORBA_exception_init (&ev);
......@@ -214,7 +210,7 @@ gnumeric_bonobo_obj_read (xmlNodePtr tree,
gtk_object_unref (GTK_OBJECT (sob));
CORBA_exception_free (&ev);
g_warning ("nasty error");
return NULL;
return TRUE;
}
/*
......@@ -224,7 +220,7 @@ gnumeric_bonobo_obj_read (xmlNodePtr tree,
*/
CORBA_exception_free (&ev);
return SHEET_OBJECT (sob);
return FALSE;
}
static int
......
......@@ -408,7 +408,7 @@ cell_set_value (Cell *cell, Value *v, StyleFormat *opt_fmt)
*/
void
cell_set_expr_and_value (Cell *cell, ExprTree *expr, Value *v,
StyleFormat *opt_fmt)
StyleFormat *opt_fmt, gboolean link_expr)
{
g_return_if_fail (cell != NULL);
g_return_if_fail (expr != NULL);
......@@ -425,8 +425,9 @@ cell_set_expr_and_value (Cell *cell, ExprTree *expr, Value *v,
cell->format = opt_fmt;
cell->base.expression = expr;
cell->base.flags |= CELL_HAS_EXPRESSION;
dependent_link (CELL_TO_DEP (cell), &cell->pos);
cell->value = v;
if (link_expr)
dependent_link (CELL_TO_DEP (cell), &cell->pos);
}
/**
......@@ -691,10 +692,9 @@ cell_set_mstyle (Cell const *cell, MStyle *mstyle)
{
Range range;
range.start = cell->pos;
range.end = range.start;
range.start = range.end = cell->pos;
sheet_style_attach (cell->base.sheet, range, mstyle);
sheet_style_attach (cell->base.sheet, &range, mstyle);
}
char *
......
......@@ -72,7 +72,7 @@ void cell_set_text (Cell *c, char const *text);
void cell_assign_value (Cell *c, Value *v, StyleFormat *fmt);
void cell_set_value (Cell *c, Value *v, StyleFormat *fmt);
void cell_set_expr_and_value (Cell *c, ExprTree *expr, Value *v,
StyleFormat *opt_fmt);
StyleFormat *opt_fmt, gboolean link_expr);
void cell_set_expr (Cell *c, ExprTree *expr,
StyleFormat *opt_fmt);
void cell_set_expr_unsafe (Cell *cell, ExprTree *expr,
......
......@@ -2424,6 +2424,136 @@ cmd_autoformat (WorkbookControl *wbc, Sheet *sheet, FormatTemplate *ft)
/******************************************************************/
#define CMD_MERGE_CELLS_TYPE (cmd_merge_cells_get_type ())
#define CMD_MERGE_CELLS(o) (GTK_CHECK_CAST ((o), CMD_MERGE_CELLS_TYPE, CmdMergeCells))
typedef struct {
GnumericCommand parent;
} CmdMergeCells;
GNUMERIC_MAKE_COMMAND (CmdMergeCells, cmd_merge_cells);
static gboolean
cmd_merge_cells_undo (GnumericCommand *cmd, WorkbookControl *wbc)
{
CmdMergeCells *me = CMD_MERGE_CELLS (cmd);
g_return_val_if_fail (me != NULL, TRUE);
return FALSE;
}
static gboolean
cmd_merge_cells_redo (GnumericCommand *cmd, WorkbookControl *wbc)
{
CmdMergeCells *me = CMD_MERGE_CELLS (cmd);
g_return_val_if_fail (me != NULL, TRUE);
return FALSE;
}
static void
cmd_merge_cells_destroy (GtkObject *cmd)
{
CmdMergeCells *me = CMD_MERGE_CELLS (cmd);
gnumeric_command_destroy (cmd);
}
/**
* cmd_merge_cells:
* @context: the context.
*
* Return value: TRUE if there was a problem
**/
gboolean
cmd_merge_cells (WorkbookControl *wbc, Sheet *sheet)
{
GtkObject *obj;
CmdMergeCells *me;
GSList *l;
g_return_val_if_fail (sheet != NULL, TRUE);
obj = gtk_type_new (CMD_MERGE_CELLS_TYPE);
me = CMD_MERGE_CELLS (obj);
me->parent.size = 1;
me->parent.cmd_descriptor = g_strdup (_("Merge Cells"));
/* Register the command object */
return command_push_undo (wbc, obj);
}
/******************************************************************/
#define CMD_UNMERGE_CELLS_TYPE (cmd_unmerge_cells_get_type ())
#define CMD_UNMERGE_CELLS(o) (GTK_CHECK_CAST ((o), CMD_UNMERGE_CELLS_TYPE, CmdUnmergeCells))
typedef struct {
GnumericCommand parent;
} CmdUnmergeCells;
GNUMERIC_MAKE_COMMAND (CmdUnmergeCells, cmd_unmerge_cells);
static gboolean
cmd_unmerge_cells_undo (GnumericCommand *cmd, WorkbookControl *wbc)
{
CmdUnmergeCells *me = CMD_UNMERGE_CELLS (cmd);
g_return_val_if_fail (me != NULL, TRUE);
return FALSE;
}
static gboolean
cmd_unmerge_cells_redo (GnumericCommand *cmd, WorkbookControl *wbc)
{
CmdUnmergeCells *me = CMD_UNMERGE_CELLS (cmd);
g_return_val_if_fail (me != NULL, TRUE);
return FALSE;
}
static void
cmd_unmerge_cells_destroy (GtkObject *cmd)
{
CmdUnmergeCells *me = CMD_UNMERGE_CELLS (cmd);
gnumeric_command_destroy (cmd);
}
/**
* cmd_unmerge_cells:
* @context: the context.
*
* Return value: TRUE if there was a problem
**/
gboolean
cmd_unmerge_cells (WorkbookControl *wbc, Sheet *sheet)
{
GtkObject *obj;
CmdUnmergeCells *me;
GSList *l;
g_return_val_if_fail (sheet != NULL, TRUE);
obj = gtk_type_new (CMD_UNMERGE_CELLS_TYPE);
me = CMD_UNMERGE_CELLS (obj);
me->parent.size = 1;
me->parent.cmd_descriptor = g_strdup (_("Unmerge Cells"));
/* Register the command object */
return command_push_undo (wbc, obj);
}
/******************************************************************/
/* TODO :
* - SheetObject creation & manipulation.
*/
......@@ -57,4 +57,7 @@ gboolean cmd_autoformat (WorkbookControl *wbc, Sheet *sheet, FormatTempl
gboolean cmd_hide_selection_colrow (WorkbookControl *wbc, Sheet *sheet,
gboolean is_cols, gboolean visible);
gboolean cmd_merge_cells (WorkbookControl *wbc, Sheet *sheet);
gboolean cmd_unmerge_cells (WorkbookControl *wbc, Sheet *sheet);
#endif /* GNUMERIC_COMMANDS_H */
......@@ -28,9 +28,9 @@
#include "workbook-control-gui-priv.h"
#include "workbook.h"
#include "workbook-edit.h"
#include "workbook-private.h" /* FIXME Ick */
#include "sheet-object.h"
#include "sheet-object-container.h"
#include "sheet-object-bonobo.h"
#include "sheet-control-gui.h"
#include "selection.h"
#include "ranges.h"
......@@ -230,29 +230,26 @@ cb_graph_guru_clicked (GtkWidget *button, GraphGuruState *state)
}
if (button == state->button_finish) {
BonoboClientSite *client_site;
SheetObject *so = sheet_object_container_new (state->sheet);
/* Configure our container */
client_site = bonobo_client_site_new (state->wb->priv->bonobo_container);
if (sheet_object_bonobo_set_server (SHEET_OBJECT_BONOBO (so),
state->manager_client)) {
if (bonobo_client_site_bind_embeddable (client_site, state->manager_client)) {
SheetObject *so = sheet_object_container_new_bonobo (
state->sheet, client_site);
scg_mode_create_object (state->scg, so);
}
/* Add a reference to the vector so that they continue to exist
* when the dialog goes away. Then tie them to the destruction of
* the client_site.
*/
if (state->vectors != NULL) {
int i = state->vectors->len;
while (i-- > 0) {
gpointer *elem = g_ptr_array_index (state->vectors, i);
gtk_object_ref (GTK_OBJECT (elem));
gtk_signal_connect (GTK_OBJECT (client_site), "destroy",
GTK_SIGNAL_FUNC (cb_graph_vector_destroy),
elem);
/* Add a reference to the vector so that they continue to exist
* when the dialog goes away. Then tie them to the destruction of
* the sheet object.
*/
if (state->vectors != NULL) {
int i = state->vectors->len;
while (i-- > 0) {
gpointer *elem = g_ptr_array_index (state->vectors, i);
gtk_object_ref (GTK_OBJECT (elem));
gtk_signal_connect (GTK_OBJECT (so), "destroy",
GTK_SIGNAL_FUNC (cb_graph_vector_destroy),
elem);
}
}
}
}
......
......@@ -1205,7 +1205,7 @@ cb_format_sheet_border (FormatTemplate *ft, Range *r, MStyle *mstyle, Sheet *she
mstyle_set_border (mstyle_to_bottom, MSTYLE_BORDER_TOP,
style_border_ref (bottom));
sheet_style_attach (sheet, br, mstyle_to_bottom);
sheet_style_attach (sheet, &br, mstyle_to_bottom);
}
if (right != NULL && right->line_type != STYLE_BORDER_NONE) {
......@@ -1218,7 +1218,7 @@ cb_format_sheet_border (FormatTemplate *ft, Range *r, MStyle *mstyle, Sheet *she
mstyle_set_border (mstyle_to_right, MSTYLE_BORDER_LEFT,
style_border_ref (right));
sheet_style_attach (sheet, rr, mstyle_to_right);
sheet_style_attach (sheet, &rr, mstyle_to_right);
}
mstyle_unref (mstyle);
......
......@@ -36,6 +36,16 @@ range_init (Range *r, int start_col, int start_row,
return r;
}
Range *
range_init_full_sheet (Range *r)
{
r->start.col = 0;
r->start.row = 0;
r->end.col = SHEET_MAX_COLS - 1;
r->end.row = SHEET_MAX_ROWS - 1;
return r;
}
/**
* range_parse:
* @sheet: the sheet where the cell range is evaluated
......@@ -1028,7 +1038,7 @@ static void
range_style_apply_cb (Sheet *sheet, const Range *range, gpointer user_data)
{
mstyle_ref ((MStyle *)user_data);
sheet_style_attach (sheet, *range, (MStyle *)user_data);
sheet_style_attach (sheet, range, (MStyle *)user_data);
}
void
......
......@@ -55,6 +55,7 @@
#define range_valid(r) (((Range *)(r))->start.col <= ((Range *)(r))->end.col && \
((Range *)(r))->start.row <= ((Range *)(r))->end.row)
Range *range_init_full_sheet (Range *r);
Range *range_init (Range *r, int start_col, int start_row,
int end_col, int end_row);
Value *range_parse (Sheet *sheet, const char *range, gboolean strict);
......
......@@ -272,8 +272,7 @@ sheet_object_bonobo_read_xml (SheetObject *so,
return TRUE;
}
so = ctxt->read_fn (tree, ctxt->sheet, ctxt->user_data);
return FALSE;
return ctxt->read_fn (tree, so, ctxt->sheet, ctxt->user_data);
}
static gboolean
......@@ -348,22 +347,35 @@ gboolean
sheet_object_bonobo_set_object_iid (SheetObjectBonobo *sob,
char const *object_id)
{
BonoboObjectClient *server;
g_return_val_if_fail (IS_SHEET_OBJECT_BONOBO (sob), FALSE);
g_return_val_if_fail (sob->object_id == NULL, FALSE);
g_return_val_if_fail (object_id != NULL, FALSE);
sob->object_id = g_strdup (object_id);
sob->object_server = bonobo_object_activate (object_id, 0);
if (!sob->object_server) {
server = bonobo_object_activate (object_id, 0);
if (!server) {
gtk_object_destroy (GTK_OBJECT (sob));
return FALSE;
}
sob->object_id = g_strdup (object_id);
return sheet_object_bonobo_set_server (sob, server);
}
gboolean
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);
if (!bonobo_client_site_bind_embeddable (sob->client_site,
sob->object_server)) {