Commit f4cc38b8 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

new function. (sheet_object_position_pixels) : new function.


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

	* src/sheet-object.c (sheet_object_position_pts) : new function.
	(sheet_object_position_pixels) : new function.

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

	* src/xml-io.c : Begin moving the sheet object xml io into virtuals.

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

	* src/sheet.c : Add SHEET_FOREACH_CONTROL to help abstract the
	  implementation of controls and simplify changes later.
	(sheet_set_zoom_factor) : reposition objects not just comments.
	(sheet_get_objects) : New function.

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

	* src/sheet-object.c : Move most (not yet all) of the GUI aspects into
	  the sheet control.  Revamp the semantics of the sheet-object
	  virtuals.
	new_view : now handles the sizing and realizing of objects.
	Add support for persistance here.
	Delete get/set bound.

	* src/sheet-object-container.c : convert to new object management design
	* src/sheet-object-graphic.c : Ditto.
	* src/sheet-object-item.c : Ditto.
	* src/sheet-object-widget.c : Ditto.

	* src/sheet-object-bonobo.c (sheet_object_bonobo_construct) :
	  sheet_object_construct now takes a default size.

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

	* src/sheet-control-gui.c : Move cell comment and sheet object
	  placement routines here.  Rather than scattering them in non-gui
	  modules.

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

	* src/print.c (print_object_view_position) : Convert object position
	  to points.

	* src/selection.c (sheet_selection_redraw) : simplify.

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

	* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : SheetObject
	  editing is now specific to the SheetControl.
	(gnumeric_sheet_key_press) : Ditto.
	(gnumeric_sheet_key_release) : Ditto.

	* src/selection.c (sheet_is_cell_selected) : Ditto.
	(sheet_col_selection_type) : Ditto.
	(sheet_row_selection_type) : Ditto.

	* src/item-bar.c (item_bar_draw) : Ditto.

	* src/item-grid.c (item_grid_draw_background) : Ditto.
	(item_grid_button_1) : Ditto.
	(item_grid_event) : Ditto.
	(cb_obj_create_motion) : Move the object creation GUI here.
	(cb_obj_create_button_release) : and add partial support for
	  autoscroll.
	(sheet_object_begin_creation) : Ditto.

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

	* src/cell.c (cell_copy) : Comments are no longer associated directly
	  with cells.
	* src/clipboard.c (paste_cell) : Ditto.
	(clipboard_release) : Ditto.

	* src/bonobo-io.c (gnumeric_bonobo_obj_read) : No need to set bounds
	  or realize the object here.  That is handed at a higher level.

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

	* src/number-match.c (compute_value) : Use strtol to simplify things.

	* src/func.c (tokenized_help_new) : translate the help text.

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

	* src/formats.c (currency_date_format_init) : quote the currency
	  names.
parent b987e521
......@@ -5,9 +5,12 @@ and longer term bugs.
Release Critical
----------------
- Persistance of sheet objects.
- Other anchor types for sheet objects
- sheet object relocation (ins/del row/col, cut/paste)
- new wb_controls do not display
: selection string
: comment markers
Long term breakage
------------------
......@@ -92,9 +95,7 @@ STF - pasting a single line should not invoke the importer
- SheetObjects : use GtkArg and remove cruft from xml-io.
: Add data member to Class to indicate 'simple' object
types that can be rubber banded directly.
: Add bounding_box_add
bounding_box_remove
to handle shaped objects.
: Add acetate_create virtual to handle shaped objects.
Dialogs
-------
......
2000-12-01 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_position_pts) : new function.
(sheet_object_position_pixels) : new function.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c : Begin moving the sheet object xml io into virtuals.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c : Add SHEET_FOREACH_CONTROL to help abstract the
implementation of controls and simplify changes later.
(sheet_set_zoom_factor) : reposition objects not just comments.
(sheet_get_objects) : New function.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c : Move most (not yet all) of the GUI aspects into
the sheet control. Revamp the semantics of the sheet-object
virtuals.
new_view : now handles the sizing and realizing of objects.
Add support for persistance here.
Delete get/set bound.
* src/sheet-object-container.c : convert to new object management design
* src/sheet-object-graphic.c : Ditto.
* src/sheet-object-item.c : Ditto.
* src/sheet-object-widget.c : Ditto.
* src/sheet-object-bonobo.c (sheet_object_bonobo_construct) :
sheet_object_construct now takes a default size.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control-gui.c : Move cell comment and sheet object
placement routines here. Rather than scattering them in non-gui
modules.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/print.c (print_object_view_position) : Convert object position
to points.
* src/selection.c (sheet_selection_redraw) : simplify.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : SheetObject
editing is now specific to the SheetControl.
(gnumeric_sheet_key_press) : Ditto.
(gnumeric_sheet_key_release) : Ditto.
* src/selection.c (sheet_is_cell_selected) : Ditto.
(sheet_col_selection_type) : Ditto.
(sheet_row_selection_type) : Ditto.
* src/item-bar.c (item_bar_draw) : Ditto.
* src/item-grid.c (item_grid_draw_background) : Ditto.
(item_grid_button_1) : Ditto.
(item_grid_event) : Ditto.
(cb_obj_create_motion) : Move the object creation GUI here.
(cb_obj_create_button_release) : and add partial support for
autoscroll.
(sheet_object_begin_creation) : Ditto.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_copy) : Comments are no longer associated directly
with cells.
* src/clipboard.c (paste_cell) : Ditto.
(clipboard_release) : Ditto.
* src/bonobo-io.c (gnumeric_bonobo_obj_read) : No need to set bounds
or realize the object here. That is handed at a higher level.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (compute_value) : Use strtol to simplify things.
* src/func.c (tokenized_help_new) : translate the help text.
2000-11-27 Jody Goldberg <jgoldberg@home.com>
* src/formats.c (currency_date_format_init) : quote the currency
names.
2000-11-30 Almer S. Tigelaar <almer1@dds.nl>
* src/preview-grid-controller.c (preview_grid_controller_new) :
......@@ -7,7 +95,6 @@
* src/xml-io.c (xml_sheet_write): Initialise closure's rle_count
member.
(natural_order_cmp): Fix major brown-bag in ordering.
2000-11-27 Morten Welinder <terra@diku.dk>
......
......@@ -2,6 +2,7 @@ Gnumeric 0.60
Jody:
* Initial work on supporting merged cells.
* Improve sheet object and cell comment infrastructure.
Jon Kåre:
* Improve XL export of non-builtin functions.
......
2000-12-01 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_position_pts) : new function.
(sheet_object_position_pixels) : new function.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c : Begin moving the sheet object xml io into virtuals.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c : Add SHEET_FOREACH_CONTROL to help abstract the
implementation of controls and simplify changes later.
(sheet_set_zoom_factor) : reposition objects not just comments.
(sheet_get_objects) : New function.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c : Move most (not yet all) of the GUI aspects into
the sheet control. Revamp the semantics of the sheet-object
virtuals.
new_view : now handles the sizing and realizing of objects.
Add support for persistance here.
Delete get/set bound.
* src/sheet-object-container.c : convert to new object management design
* src/sheet-object-graphic.c : Ditto.
* src/sheet-object-item.c : Ditto.
* src/sheet-object-widget.c : Ditto.
* src/sheet-object-bonobo.c (sheet_object_bonobo_construct) :
sheet_object_construct now takes a default size.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control-gui.c : Move cell comment and sheet object
placement routines here. Rather than scattering them in non-gui
modules.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/print.c (print_object_view_position) : Convert object position
to points.
* src/selection.c (sheet_selection_redraw) : simplify.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : SheetObject
editing is now specific to the SheetControl.
(gnumeric_sheet_key_press) : Ditto.
(gnumeric_sheet_key_release) : Ditto.
* src/selection.c (sheet_is_cell_selected) : Ditto.
(sheet_col_selection_type) : Ditto.
(sheet_row_selection_type) : Ditto.
* src/item-bar.c (item_bar_draw) : Ditto.
* src/item-grid.c (item_grid_draw_background) : Ditto.
(item_grid_button_1) : Ditto.
(item_grid_event) : Ditto.
(cb_obj_create_motion) : Move the object creation GUI here.
(cb_obj_create_button_release) : and add partial support for
autoscroll.
(sheet_object_begin_creation) : Ditto.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_copy) : Comments are no longer associated directly
with cells.
* src/clipboard.c (paste_cell) : Ditto.
(clipboard_release) : Ditto.
* src/bonobo-io.c (gnumeric_bonobo_obj_read) : No need to set bounds
or realize the object here. That is handed at a higher level.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (compute_value) : Use strtol to simplify things.
* src/func.c (tokenized_help_new) : translate the help text.
2000-11-27 Jody Goldberg <jgoldberg@home.com>
* src/formats.c (currency_date_format_init) : quote the currency
names.
2000-11-30 Almer S. Tigelaar <almer1@dds.nl>
* src/preview-grid-controller.c (preview_grid_controller_new) :
......@@ -7,7 +95,6 @@
* src/xml-io.c (xml_sheet_write): Initialise closure's rle_count
member.
(natural_order_cmp): Fix major brown-bag in ordering.
2000-11-27 Morten Welinder <terra@diku.dk>
......
2000-12-01 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_position_pts) : new function.
(sheet_object_position_pixels) : new function.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c : Begin moving the sheet object xml io into virtuals.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c : Add SHEET_FOREACH_CONTROL to help abstract the
implementation of controls and simplify changes later.
(sheet_set_zoom_factor) : reposition objects not just comments.
(sheet_get_objects) : New function.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c : Move most (not yet all) of the GUI aspects into
the sheet control. Revamp the semantics of the sheet-object
virtuals.
new_view : now handles the sizing and realizing of objects.
Add support for persistance here.
Delete get/set bound.
* src/sheet-object-container.c : convert to new object management design
* src/sheet-object-graphic.c : Ditto.
* src/sheet-object-item.c : Ditto.
* src/sheet-object-widget.c : Ditto.
* src/sheet-object-bonobo.c (sheet_object_bonobo_construct) :
sheet_object_construct now takes a default size.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control-gui.c : Move cell comment and sheet object
placement routines here. Rather than scattering them in non-gui
modules.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/print.c (print_object_view_position) : Convert object position
to points.
* src/selection.c (sheet_selection_redraw) : simplify.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : SheetObject
editing is now specific to the SheetControl.
(gnumeric_sheet_key_press) : Ditto.
(gnumeric_sheet_key_release) : Ditto.
* src/selection.c (sheet_is_cell_selected) : Ditto.
(sheet_col_selection_type) : Ditto.
(sheet_row_selection_type) : Ditto.
* src/item-bar.c (item_bar_draw) : Ditto.
* src/item-grid.c (item_grid_draw_background) : Ditto.
(item_grid_button_1) : Ditto.
(item_grid_event) : Ditto.
(cb_obj_create_motion) : Move the object creation GUI here.
(cb_obj_create_button_release) : and add partial support for
autoscroll.
(sheet_object_begin_creation) : Ditto.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_copy) : Comments are no longer associated directly
with cells.
* src/clipboard.c (paste_cell) : Ditto.
(clipboard_release) : Ditto.
* src/bonobo-io.c (gnumeric_bonobo_obj_read) : No need to set bounds
or realize the object here. That is handed at a higher level.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (compute_value) : Use strtol to simplify things.
* src/func.c (tokenized_help_new) : translate the help text.
2000-11-27 Jody Goldberg <jgoldberg@home.com>
* src/formats.c (currency_date_format_init) : quote the currency
names.
2000-11-30 Almer S. Tigelaar <almer1@dds.nl>
* src/preview-grid-controller.c (preview_grid_controller_new) :
......@@ -7,7 +95,6 @@
* src/xml-io.c (xml_sheet_write): Initialise closure's rle_count
member.
(natural_order_cmp): Fix major brown-bag in ordering.
2000-11-27 Morten Welinder <terra@diku.dk>
......
2000-12-01 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_position_pts) : new function.
(sheet_object_position_pixels) : new function.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c : Begin moving the sheet object xml io into virtuals.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c : Add SHEET_FOREACH_CONTROL to help abstract the
implementation of controls and simplify changes later.
(sheet_set_zoom_factor) : reposition objects not just comments.
(sheet_get_objects) : New function.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c : Move most (not yet all) of the GUI aspects into
the sheet control. Revamp the semantics of the sheet-object
virtuals.
new_view : now handles the sizing and realizing of objects.
Add support for persistance here.
Delete get/set bound.
* src/sheet-object-container.c : convert to new object management design
* src/sheet-object-graphic.c : Ditto.
* src/sheet-object-item.c : Ditto.
* src/sheet-object-widget.c : Ditto.
* src/sheet-object-bonobo.c (sheet_object_bonobo_construct) :
sheet_object_construct now takes a default size.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control-gui.c : Move cell comment and sheet object
placement routines here. Rather than scattering them in non-gui
modules.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/print.c (print_object_view_position) : Convert object position
to points.
* src/selection.c (sheet_selection_redraw) : simplify.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : SheetObject
editing is now specific to the SheetControl.
(gnumeric_sheet_key_press) : Ditto.
(gnumeric_sheet_key_release) : Ditto.
* src/selection.c (sheet_is_cell_selected) : Ditto.
(sheet_col_selection_type) : Ditto.
(sheet_row_selection_type) : Ditto.
* src/item-bar.c (item_bar_draw) : Ditto.
* src/item-grid.c (item_grid_draw_background) : Ditto.
(item_grid_button_1) : Ditto.
(item_grid_event) : Ditto.
(cb_obj_create_motion) : Move the object creation GUI here.
(cb_obj_create_button_release) : and add partial support for
autoscroll.
(sheet_object_begin_creation) : Ditto.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_copy) : Comments are no longer associated directly
with cells.
* src/clipboard.c (paste_cell) : Ditto.
(clipboard_release) : Ditto.
* src/bonobo-io.c (gnumeric_bonobo_obj_read) : No need to set bounds
or realize the object here. That is handed at a higher level.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (compute_value) : Use strtol to simplify things.
* src/func.c (tokenized_help_new) : translate the help text.
2000-11-27 Jody Goldberg <jgoldberg@home.com>
* src/formats.c (currency_date_format_init) : quote the currency
names.
2000-11-30 Almer S. Tigelaar <almer1@dds.nl>
* src/preview-grid-controller.c (preview_grid_controller_new) :
......@@ -7,7 +95,6 @@
* src/xml-io.c (xml_sheet_write): Initialise closure's rle_count
member.
(natural_order_cmp): Fix major brown-bag in ordering.
2000-11-27 Morten Welinder <terra@diku.dk>
......
2000-12-01 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_position_pts) : new function.
(sheet_object_position_pixels) : new function.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c : Begin moving the sheet object xml io into virtuals.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c : Add SHEET_FOREACH_CONTROL to help abstract the
implementation of controls and simplify changes later.
(sheet_set_zoom_factor) : reposition objects not just comments.
(sheet_get_objects) : New function.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c : Move most (not yet all) of the GUI aspects into
the sheet control. Revamp the semantics of the sheet-object
virtuals.
new_view : now handles the sizing and realizing of objects.
Add support for persistance here.
Delete get/set bound.
* src/sheet-object-container.c : convert to new object management design
* src/sheet-object-graphic.c : Ditto.
* src/sheet-object-item.c : Ditto.
* src/sheet-object-widget.c : Ditto.
* src/sheet-object-bonobo.c (sheet_object_bonobo_construct) :
sheet_object_construct now takes a default size.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control-gui.c : Move cell comment and sheet object
placement routines here. Rather than scattering them in non-gui
modules.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/print.c (print_object_view_position) : Convert object position
to points.
* src/selection.c (sheet_selection_redraw) : simplify.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_object) : SheetObject
editing is now specific to the SheetControl.
(gnumeric_sheet_key_press) : Ditto.
(gnumeric_sheet_key_release) : Ditto.
* src/selection.c (sheet_is_cell_selected) : Ditto.
(sheet_col_selection_type) : Ditto.
(sheet_row_selection_type) : Ditto.
* src/item-bar.c (item_bar_draw) : Ditto.
* src/item-grid.c (item_grid_draw_background) : Ditto.
(item_grid_button_1) : Ditto.
(item_grid_event) : Ditto.
(cb_obj_create_motion) : Move the object creation GUI here.
(cb_obj_create_button_release) : and add partial support for
autoscroll.
(sheet_object_begin_creation) : Ditto.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_copy) : Comments are no longer associated directly
with cells.
* src/clipboard.c (paste_cell) : Ditto.
(clipboard_release) : Ditto.
* src/bonobo-io.c (gnumeric_bonobo_obj_read) : No need to set bounds
or realize the object here. That is handed at a higher level.
2000-11-30 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (compute_value) : Use strtol to simplify things.
* src/func.c (tokenized_help_new) : translate the help text.
2000-11-27 Jody Goldberg <jgoldberg@home.com>
* src/formats.c (currency_date_format_init) : quote the currency
names.
2000-11-30 Almer S. Tigelaar <almer1@dds.nl>
* src/preview-grid-controller.c (preview_grid_controller_new) :
......@@ -7,7 +95,6 @@
* src/xml-io.c (xml_sheet_write): Initialise closure's rle_count
member.
(natural_order_cmp): Fix major brown-bag in ordering.
2000-11-27 Morten Welinder <terra@diku.dk>
......
2000-12-01 Jody Goldberg <jgoldberg@home.com>
* ms-obj.c (ms_read_OBJ) : simplify.
* ms-excel-write.c (write_biff7_comments) : slight reorg to handle to
style cell comments.
* ms-excel-read.c (ms_excel_read_comment) : revamp for new cell
comment technique.
* ms-excel-read.c (ms_sheet_obj_anchor_to_pos) : Update to the new
sheetObject anchor scheme. The sheet does NOT yet support this form
of anchor. We'll need to add it in the next couple of days.
(ms_sheet_obj_create) : create the sheet objects directly.
* ms-escher.c (ms_escher_read_ClientData) : set the picture here
directly.
2000-12-01 Jody Goldberg <jgoldberg@home.com>
* ms-container.c (ms_container_get_blip) : new function.
(ms_container_init) : Add ability to share blip lists between
containers. We need to figure out the semantics of this.
(ms_container_finalize) : Ditto.
(ms_container_set_blips) : Ditto.
2000-11-19 Jon K Hellan <hellan@acm.org>
* ms-excel-write.c (write_externsheets): Make EXTERNCOUNT be the
......
......@@ -16,10 +16,10 @@
#include "ms-obj.h"
void
ms_container_init (MSContainer *container,
MSContainerClass const *vtbl)
ms_container_init (MSContainer *container, MSContainerClass const *vtbl)
{
container->vtbl = vtbl;
container->free_blips = TRUE;
container->blips = NULL;
container->obj_queue = NULL;
}
......@@ -31,7 +31,7 @@ ms_container_finalize (MSContainer *container)
g_return_if_fail (container != NULL);
if (container->blips != NULL) {
if (container->free_blips && container->blips != NULL) {
for (i = container->blips->len; i-- > 0 ; )
ms_escher_blip_destroy (g_ptr_array_index (container->blips, i));
......@@ -56,6 +56,27 @@ ms_container_add_blip (MSContainer *container, MSEscherBlip *blip)
g_ptr_array_add (container->blips, blip);
}
MSEscherBlip const *
ms_container_get_blip (MSContainer *container, int blip_id)
{
g_return_val_if_fail (container != NULL, NULL);
g_return_val_if_fail (container->blips != NULL, NULL);
g_return_val_if_fail (blip_id >= 0, NULL);
g_return_val_if_fail (blip_id < container->blips->len, NULL);
return g_ptr_array_index (container->blips, blip_id);
}
void
ms_container_set_blips (MSContainer *container, GPtrArray *blips)
{
g_return_if_fail (container != NULL);
g_return_if_fail (container->blips == NULL || container->blips == blips);
container->blips = blips;
container->free_blips = FALSE;
}
void
ms_container_add_obj (MSContainer *container, MSObj *obj)
{
......
......@@ -2,6 +2,7 @@
#define MS_OFFICE_CONTAINER_H
#include "excel.h"
#include <gtk/gtkobject.h>
typedef struct _MSContainer MSContainer;
typedef struct _MSEscherBlip MSEscherBlip;
......@@ -9,7 +10,8 @@ typedef struct _MSObj MSObj;
typedef struct
{
gboolean (*realize_obj) (MSContainer *container, MSObj *obj);
gboolean (*realize_obj) (MSContainer *container, MSObj *obj);
GtkObject * (*create_obj) (MSContainer *container, MSObj *obj);
} MSContainerClass;
struct _MSContainer
......@@ -17,15 +19,17 @@ struct _MSContainer
MSContainerClass const *vtbl;
MsBiffVersion ver;
gboolean free_blips;
GPtrArray *blips;
GList *obj_queue;
};
void ms_container_init (MSContainer *container,
MSContainerClass const *vtbl);
void ms_container_init (MSContainer *container, MSContainerClass const *vtbl);
void ms_container_finalize (MSContainer *container);
void ms_container_add_blip (MSContainer *container, MSEscherBlip *blip);
void ms_container_add_blip (MSContainer *c, MSEscherBlip *blip);
MSEscherBlip const *ms_container_get_blip (MSContainer *c, int blip_id);
void ms_container_set_blips (MSContainer *container, GPtrArray *blips);
void ms_container_add_obj (MSContainer *container, MSObj *obj);
void ms_container_realize_objs (MSContainer *container);
......
......@@ -55,24 +55,22 @@ ms_escher_blip_new (const guint8 *data, guint32 len, char const *repoid,
MSContainer *container)
{
MSEscherBlip *blip = g_new (MSEscherBlip, 1);
#ifndef ENABLE_BONOBO
guint8 *mem = g_malloc (len);
memcpy (mem, data, len);
#endif
blip->repo_id = repoid;
#ifdef ENABLE_BONOBO
blip->stream = bonobo_stream_mem_create (data, len, TRUE, FALSE);
#else
blip->raw_data = mem;
#else
blip->stream = bonobo_stream_mem_create (data, len, TRUE, FALSE);
#endif
blip->obj_id = repoid;
ms_container_add_blip (container, blip);
}
void
ms_escher_blip_destroy (MSEscherBlip *blip)
{
blip->repo_id = NULL;
blip->obj_id = NULL;
#ifdef ENABLE_BONOBO
if (blip->stream)
bonobo_object_unref (BONOBO_OBJECT (blip->stream));
......@@ -1758,13 +1756,25 @@ ms_escher_read_ClientData (MSEscherState *state, MSEscherHeader *h)
memcpy (obj->raw_anchor, h->raw_anchor, MS_ANCHOR_SIZE);
obj->anchor_set = TRUE;
switch (obj->gnumeric_type) {
case SHEET_OBJECT_GRAPHIC : /* If this was a picture */
obj->v.picture.blip_id = h->blip_id;
break;
default:
break;
};
/* FIXME : I do not like having this here.
* If we ever want to split the escher handling out this is too
* gnumeric specific
*/
#ifdef ENABLE_BONOBO
if (h->blip_id >= 0) {
SheetObjectBonobo *sob = SHEET_OBJECT_BONOBO (obj->gnum_obj);
MSEscherBlip const *blip = ms_container_get_blip (
state->container, h->blip_id);
g_return_val_if_fail (blip != NULL, FALSE);
g_return_val_if_fail (sob != NULL, FALSE);
if (!sheet_object_bonobo_set_object_iid (sob, blip->obj_id) ||
!sheet_object_bonobo_load_stream (sob, blip->stream))
g_warning ("Failed to load '%s' from stream",
blip->obj_id);
}
#endif
return FALSE;
}
......
......@@ -19,7 +19,7 @@
struct _MSEscherBlip
{
char const *repo_id;
char const *obj_id;
#ifdef ENABLE_BONOBO
BonoboStream *stream;
#else
......
......@@ -25,7 +25,7 @@
#include "format.h"
#include "eval.h"
#include "gutils.h"
#include "cell-comment.h"
#include "sheet-object-cell-comment.h"
#include "application.h"
#include "io-context.h"
#include "workbook-view.h"
......@@ -2241,9 +2241,9 @@ ms_excel_sheet_shared_formula (ExcelSheet *sheet, int const col, int const row)
* preceding.
*/
static gboolean
ms_sheet_obj_anchor_to_pos (double pixels[4], guint8 const *raw_anchor,
Sheet const * sheet, MsBiffVersion const ver)
ms_sheet_obj_anchor_to_pos (Sheet const * sheet, MsBiffVersion const ver,
guint8 const *raw_anchor,
Range *range, float offset[4])
{
float const row_denominator = (ver >= MS_BIFF_V8) ? 256. : 1024.;
int i;
......@@ -2254,11 +2254,13 @@ ms_sheet_obj_anchor_to_pos (double pixels[4], guint8 const *raw_anchor,
#endif
/* Ignore the first 2 bytes. What are they ? */
/* Dec/1/2000 JEG : I have not researched it, but this may have some