Commit 0088cc12 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Add a horizontal merge before dumping to a list. (cb_hash_to_list) : free


2001-04-25  Jody Goldberg <jgoldberg@home.com>

	* src/sheet-style.c (sheet_style_get_list) : Add a horizontal merge
	  before dumping to a list.
	(cb_hash_to_list) : free elements that have been merged in the
	  horizonal step, but have not yet been removed.
	(cb_hash_merge_horiz) : new function. merge when possible, after a
	  merge either free the useless bit or mark it as useless for later
	  removal.
	(cb_style_list_add_node) : Use mstyle_equal for now to remerge
	  different instances of the same logical style.  This is necessary
	  until I finish the per sheet style index.
	(sheet_style_init) : add some sanity checks incase some bright boy
	  decides to up the size of sheet and forgets here.

	* src/xml-io.c (xml_sheet_write) : Add the properties for the
	  outline mode preferences.
	(xml_sheet_read) : ditto.

	* src/item-debug.h : fix the messages to include the module
	* src/item-bar.c : fix the item-debug grab/ungrab messages.
	(item_bar_update) : gnome_canvas_group_child_bounds is a deprecated
	  useless call.
	* src/item-edit.c : fix the item-debug grab/ungrab messages.
	(recalc_spans) : gnome_canvas_group_child_bounds is a deprecated
	  useless call.
	* src/item-grid.c : fix the item-debug grab/ungrab messages.
	(item_grid_update) : gnome_canvas_group_child_bounds is a deprecated
	  useless call.
	(item_grid_button_1) : If we are going to start selecting a range have
	  the grid to a grab on button down.  This should fix the pseudo-race
	  condition that was irritating the ExprEntry.

	* src/preview-grid.c (preview_grid_update) :
	  gnome_canvas_group_child_bounds is a deprecated useless call.
	* src/item-cursor.c : fix the item-debug grab/ungrab messages.
	(item_cursor_point) : animated cursors should never receive events.

	* src/cell-draw.c (cell_draw) : It is perfectly reasonable for
	  narrow/short cols/rows to produce cells that have negative sizes
	  with the margins removed.  exit silently.
parent 9032edba
2001-04-25 Jody Goldberg <jgoldberg@home.com>
* src/sheet-style.c (sheet_style_get_list) : Add a horizontal merge
before dumping to a list.
(cb_hash_to_list) : free elements that have been merged in the
horizonal step, but have not yet been removed.
(cb_hash_merge_horiz) : new function. merge when possible, after a
merge either free the useless bit or mark it as useless for later
removal.
(cb_style_list_add_node) : Use mstyle_equal for now to remerge
different instances of the same logical style. This is necessary
until I finish the per sheet style index.
(sheet_style_init) : add some sanity checks incase some bright boy
decides to up the size of sheet and forgets here.
* src/xml-io.c (xml_sheet_write) : Add the properties for the
outline mode preferences.
(xml_sheet_read) : ditto.
* src/item-debug.h : fix the messages to include the module
* src/item-bar.c : fix the item-debug grab/ungrab messages.
(item_bar_update) : gnome_canvas_group_child_bounds is a deprecated
useless call.
* src/item-edit.c : fix the item-debug grab/ungrab messages.
(recalc_spans) : gnome_canvas_group_child_bounds is a deprecated
useless call.
* src/item-grid.c : fix the item-debug grab/ungrab messages.
(item_grid_update) : gnome_canvas_group_child_bounds is a deprecated
useless call.
(item_grid_button_1) : If we are going to start selecting a range have
the grid to a grab on button down. This should fix the pseudo-race
condition that was irritating the ExprEntry.
* src/preview-grid.c (preview_grid_update) :
gnome_canvas_group_child_bounds is a deprecated useless call.
* src/item-cursor.c : fix the item-debug grab/ungrab messages.
(item_cursor_point) : animated cursors should never receive events.
* src/cell-draw.c (cell_draw) : It is perfectly reasonable for
narrow/short cols/rows to produce cells that have negative sizes
with the margins removed. exit silently.
2001-04-25 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.c (stf_parse_options_fixed_autodiscover):
......@@ -103,7 +145,6 @@
(sheet_adjust_preferences) : Adjust signature to optionally call
scg_resize.
* src/item-bar.c (compute_pixels_from_indent) : Support disabling
outlines.
......
2001-04-25 Jody Goldberg <jgoldberg@home.com>
* src/sheet-style.c (sheet_style_get_list) : Add a horizontal merge
before dumping to a list.
(cb_hash_to_list) : free elements that have been merged in the
horizonal step, but have not yet been removed.
(cb_hash_merge_horiz) : new function. merge when possible, after a
merge either free the useless bit or mark it as useless for later
removal.
(cb_style_list_add_node) : Use mstyle_equal for now to remerge
different instances of the same logical style. This is necessary
until I finish the per sheet style index.
(sheet_style_init) : add some sanity checks incase some bright boy
decides to up the size of sheet and forgets here.
* src/xml-io.c (xml_sheet_write) : Add the properties for the
outline mode preferences.
(xml_sheet_read) : ditto.
* src/item-debug.h : fix the messages to include the module
* src/item-bar.c : fix the item-debug grab/ungrab messages.
(item_bar_update) : gnome_canvas_group_child_bounds is a deprecated
useless call.
* src/item-edit.c : fix the item-debug grab/ungrab messages.
(recalc_spans) : gnome_canvas_group_child_bounds is a deprecated
useless call.
* src/item-grid.c : fix the item-debug grab/ungrab messages.
(item_grid_update) : gnome_canvas_group_child_bounds is a deprecated
useless call.
(item_grid_button_1) : If we are going to start selecting a range have
the grid to a grab on button down. This should fix the pseudo-race
condition that was irritating the ExprEntry.
* src/preview-grid.c (preview_grid_update) :
gnome_canvas_group_child_bounds is a deprecated useless call.
* src/item-cursor.c : fix the item-debug grab/ungrab messages.
(item_cursor_point) : animated cursors should never receive events.
* src/cell-draw.c (cell_draw) : It is perfectly reasonable for
narrow/short cols/rows to produce cells that have negative sizes
with the margins removed. exit silently.
2001-04-25 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.c (stf_parse_options_fixed_autodiscover):
......@@ -103,7 +145,6 @@
(sheet_adjust_preferences) : Adjust signature to optionally call
scg_resize.
* src/item-bar.c (compute_pixels_from_indent) : Support disabling
outlines.
......
2001-04-25 Jody Goldberg <jgoldberg@home.com>
* src/sheet-style.c (sheet_style_get_list) : Add a horizontal merge
before dumping to a list.
(cb_hash_to_list) : free elements that have been merged in the
horizonal step, but have not yet been removed.
(cb_hash_merge_horiz) : new function. merge when possible, after a
merge either free the useless bit or mark it as useless for later
removal.
(cb_style_list_add_node) : Use mstyle_equal for now to remerge
different instances of the same logical style. This is necessary
until I finish the per sheet style index.
(sheet_style_init) : add some sanity checks incase some bright boy
decides to up the size of sheet and forgets here.
* src/xml-io.c (xml_sheet_write) : Add the properties for the
outline mode preferences.
(xml_sheet_read) : ditto.
* src/item-debug.h : fix the messages to include the module
* src/item-bar.c : fix the item-debug grab/ungrab messages.
(item_bar_update) : gnome_canvas_group_child_bounds is a deprecated
useless call.
* src/item-edit.c : fix the item-debug grab/ungrab messages.
(recalc_spans) : gnome_canvas_group_child_bounds is a deprecated
useless call.
* src/item-grid.c : fix the item-debug grab/ungrab messages.
(item_grid_update) : gnome_canvas_group_child_bounds is a deprecated
useless call.
(item_grid_button_1) : If we are going to start selecting a range have
the grid to a grab on button down. This should fix the pseudo-race
condition that was irritating the ExprEntry.
* src/preview-grid.c (preview_grid_update) :
gnome_canvas_group_child_bounds is a deprecated useless call.
* src/item-cursor.c : fix the item-debug grab/ungrab messages.
(item_cursor_point) : animated cursors should never receive events.
* src/cell-draw.c (cell_draw) : It is perfectly reasonable for
narrow/short cols/rows to produce cells that have negative sizes
with the margins removed. exit silently.
2001-04-25 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.c (stf_parse_options_fixed_autodiscover):
......@@ -103,7 +145,6 @@
(sheet_adjust_preferences) : Adjust signature to optionally call
scg_resize.
* src/item-bar.c (compute_pixels_from_indent) : Support disabling
outlines.
......
2001-04-25 Jody Goldberg <jgoldberg@home.com>
* src/sheet-style.c (sheet_style_get_list) : Add a horizontal merge
before dumping to a list.
(cb_hash_to_list) : free elements that have been merged in the
horizonal step, but have not yet been removed.
(cb_hash_merge_horiz) : new function. merge when possible, after a
merge either free the useless bit or mark it as useless for later
removal.
(cb_style_list_add_node) : Use mstyle_equal for now to remerge
different instances of the same logical style. This is necessary
until I finish the per sheet style index.
(sheet_style_init) : add some sanity checks incase some bright boy
decides to up the size of sheet and forgets here.
* src/xml-io.c (xml_sheet_write) : Add the properties for the
outline mode preferences.
(xml_sheet_read) : ditto.
* src/item-debug.h : fix the messages to include the module
* src/item-bar.c : fix the item-debug grab/ungrab messages.
(item_bar_update) : gnome_canvas_group_child_bounds is a deprecated
useless call.
* src/item-edit.c : fix the item-debug grab/ungrab messages.
(recalc_spans) : gnome_canvas_group_child_bounds is a deprecated
useless call.
* src/item-grid.c : fix the item-debug grab/ungrab messages.
(item_grid_update) : gnome_canvas_group_child_bounds is a deprecated
useless call.
(item_grid_button_1) : If we are going to start selecting a range have
the grid to a grab on button down. This should fix the pseudo-race
condition that was irritating the ExprEntry.
* src/preview-grid.c (preview_grid_update) :
gnome_canvas_group_child_bounds is a deprecated useless call.
* src/item-cursor.c : fix the item-debug grab/ungrab messages.
(item_cursor_point) : animated cursors should never receive events.
* src/cell-draw.c (cell_draw) : It is perfectly reasonable for
narrow/short cols/rows to produce cells that have negative sizes
with the margins removed. exit silently.
2001-04-25 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.c (stf_parse_options_fixed_autodiscover):
......@@ -103,7 +145,6 @@
(sheet_adjust_preferences) : Adjust signature to optionally call
scg_resize.
* src/item-bar.c (compute_pixels_from_indent) : Support disabling
outlines.
......
2001-04-25 Jody Goldberg <jgoldberg@home.com>
* src/sheet-style.c (sheet_style_get_list) : Add a horizontal merge
before dumping to a list.
(cb_hash_to_list) : free elements that have been merged in the
horizonal step, but have not yet been removed.
(cb_hash_merge_horiz) : new function. merge when possible, after a
merge either free the useless bit or mark it as useless for later
removal.
(cb_style_list_add_node) : Use mstyle_equal for now to remerge
different instances of the same logical style. This is necessary
until I finish the per sheet style index.
(sheet_style_init) : add some sanity checks incase some bright boy
decides to up the size of sheet and forgets here.
* src/xml-io.c (xml_sheet_write) : Add the properties for the
outline mode preferences.
(xml_sheet_read) : ditto.
* src/item-debug.h : fix the messages to include the module
* src/item-bar.c : fix the item-debug grab/ungrab messages.
(item_bar_update) : gnome_canvas_group_child_bounds is a deprecated
useless call.
* src/item-edit.c : fix the item-debug grab/ungrab messages.
(recalc_spans) : gnome_canvas_group_child_bounds is a deprecated
useless call.
* src/item-grid.c : fix the item-debug grab/ungrab messages.
(item_grid_update) : gnome_canvas_group_child_bounds is a deprecated
useless call.
(item_grid_button_1) : If we are going to start selecting a range have
the grid to a grab on button down. This should fix the pseudo-race
condition that was irritating the ExprEntry.
* src/preview-grid.c (preview_grid_update) :
gnome_canvas_group_child_bounds is a deprecated useless call.
* src/item-cursor.c : fix the item-debug grab/ungrab messages.
(item_cursor_point) : animated cursors should never receive events.
* src/cell-draw.c (cell_draw) : It is perfectly reasonable for
narrow/short cols/rows to produce cells that have negative sizes
with the margins removed. exit silently.
2001-04-25 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.c (stf_parse_options_fixed_autodiscover):
......@@ -103,7 +145,6 @@
(sheet_adjust_preferences) : Adjust signature to optionally call
scg_resize.
* src/item-bar.c (compute_pixels_from_indent) : Support disabling
outlines.
......
......@@ -188,8 +188,8 @@ cell_draw (Cell const *cell, MStyle const *mstyle,
/* This rectangle has the whole area used by this cell
* excluding the surrounding grid lines and margins */
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
if (width <= 0 || height <= 0)
return;
rect.x = x1 + 1 + ci->margin_a;
rect.y = y1 + 1 + ri->margin_a;
......
This diff is collapsed.
......@@ -9,6 +9,7 @@
#include <config.h>
#include "item-bar.h"
#define GNUMERIC_ITEM "BAR"
#include "item-debug.h"
#include "style.h"
#include "sheet.h"
......@@ -193,7 +194,6 @@ item_bar_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int f
item->y2 = INT_MAX;
}
gnome_canvas_group_child_bounds (GNOME_CANVAS_GROUP (item->parent), item);
if (GNOME_CANVAS_ITEM_CLASS (item_bar_parent_class)->update)
(*GNOME_CANVAS_ITEM_CLASS (item_bar_parent_class)->update)(item, affine, clip_path, flags);
}
......
......@@ -7,6 +7,7 @@
#include <config.h>
#include "item-cursor.h"
#define GNUMERIC_ITEM "CURSOR"
#include "item-debug.h"
#include "gnumeric-sheet.h"
#include "sheet-control-gui.h"
......@@ -185,8 +186,6 @@ item_cursor_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, in
item->x2 = x + w + 2 + extra;
item->y2 = y + h + 2 + extra;
gnome_canvas_group_child_bounds (GNOME_CANVAS_GROUP (item->parent), item);
/* Draw the new cursor */
item_cursor_request_redraw (item_cursor);
......@@ -503,6 +502,12 @@ static double
item_cursor_point (GnomeCanvasItem *item, double x, double y, int cx, int cy,
GnomeCanvasItem **actual_item)
{
ItemCursor *item_cursor = ITEM_CURSOR (item);
/* Ensure that animated cursors do not receive events */
if (item_cursor->style == ITEM_CURSOR_ANTED)
return DBL_MAX;
*actual_item = NULL;
if (cx < item->x1-3)
......@@ -524,7 +529,7 @@ item_cursor_point (GnomeCanvasItem *item, double x, double y, int cx, int cy,
*actual_item = item;
return 0.0;
}
return INT_MAX;
return DBL_MAX;
}
static void
......@@ -1212,23 +1217,10 @@ item_cursor_event (GnomeCanvasItem *item, GdkEvent *event)
break;
};
#endif
switch (item_cursor->style){
/*
FIXME :
2001-01-04 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_event) : animated cursors can no be
dragged or resized. NOTE : This introduces a small bug while
fixing another. The animated cursor is frequently drawn on top of
the current selection cursor when it is first created. As such the
selection cursor does not receive all the events it should.
Ideally the canvas would pass ignored events to the widget below, but
that is not going to happen. We can not just forward the events to
the other cursor because it may have moved. We would need to ensure
that we only forward things in the areas that are overlapping. Which
is not easy.
*/
switch (item_cursor->style) {
case ITEM_CURSOR_ANTED:
g_warning ("Animated cursors should not receive events, "
"the point method should preclude that");
return FALSE;
case ITEM_CURSOR_SELECTION:
......
......@@ -3,12 +3,12 @@
#define __FUNCTION__ __FILE__
#endif
#define gnome_canvas_item_grab(a,b,c,d) do { \
fprintf (stderr, "%s %d: grab BAR %p\n", \
fprintf (stderr, "%s %d: grab "GNUMERIC_ITEM" %p\n", \
__FUNCTION__, __LINE__, a); \
gnome_canvas_item_grab (a, b, c,d); \
} while (0)
#define gnome_canvas_item_ungrab(a,b) do { \
fprintf (stderr, "%s %d: ungrab BAR %p\n", \
fprintf (stderr, "%s %d: ungrab "GNUMERIC_ITEM" %p\n", \
__FUNCTION__, __LINE__, a); \
gnome_canvas_item_ungrab (a, b); \
} while (0)
......
......@@ -19,6 +19,7 @@
#include "item-edit.h"
#include "item-cursor.h"
#include "item-grid.h"
#define GNUMERIC_ITEM "EDIT"
#include "item-debug.h"
#include "gnumeric-sheet.h"
#include "sheet-control-gui.h"
......@@ -378,8 +379,6 @@ recalc_spans (GnomeCanvasItem *item)
item_edit->pos.row + row_span) - 2;
item->y2 = 1 + item->y1 +
MAX (item_edit->lines * item_edit->font_height, tmp);
gnome_canvas_group_child_bounds (GNOME_CANVAS_GROUP (item->parent), item);
}
static void
......
......@@ -11,6 +11,7 @@
#include <config.h>
#include "item-grid.h"
#define GNUMERIC_ITEM "GRID"
#include "item-debug.h"
#include "gnumeric-sheet.h"
#include "workbook-edit.h"
......@@ -71,7 +72,6 @@ struct _ItemGrid {
} gc;
};
static void
item_grid_destroy (GtkObject *object)
{
......@@ -139,8 +139,6 @@ item_grid_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int
item->y1 = 0;
item->x2 = INT_MAX;
item->y2 = INT_MAX;
gnome_canvas_group_child_bounds (GNOME_CANVAS_GROUP (item->parent), item);
}
/**
......@@ -183,7 +181,9 @@ item_grid_draw_merged_range (GdkDrawable *drawable, ItemGrid *ig,
b += scg_colrow_distance_get (ig->scg, FALSE, view->start.row, last+1);
/* Check for background THEN selection */
if (gnumeric_background_set_gc (mstyle, gc, ig->canvas_item.canvas, is_selected) ||
if (gnumeric_background_set_gc (mstyle, gc,
ig->canvas_item.canvas,
is_selected) ||
is_selected)
/* Remember X excludes the far pixels */
gdk_draw_rectangle (drawable, gc, TRUE, l, t, r-l+1, b-t+1);
......@@ -226,7 +226,8 @@ item_grid_draw_background (GdkDrawable *drawable, ItemGrid *ig,
!(sheet->edit_pos.col == col && sheet->edit_pos.row == row) &&
sheet_is_cell_selected (sheet, col, row);
gboolean const has_back =
gnumeric_background_set_gc (style, gc, ig->canvas_item.canvas,
gnumeric_background_set_gc (style, gc,
ig->canvasitem.canvas,
is_selected);
if (has_back || is_selected)
......@@ -752,16 +753,27 @@ item_grid_button_1 (SheetControlGUI *scg, GdkEventButton *event,
scg_rangesel_cursor_extend (scg, col, row);
else
scg_rangesel_cursor_bounds (scg, col, row, col, row);
gnome_canvas_item_grab (item,
GDK_POINTER_MOTION_MASK |
GDK_BUTTON_RELEASE_MASK,
NULL,
event->time);
return 1;
}
/*
* If the user is editing a formula (gnumeric_sheet_can_select_expr_range)
* then we enable the dynamic cell selection mode.
* If the user is editing a formula
* (gnumeric_sheet_can_select_expr_range) then we enable the dynamic
* cell selection mode.
*/
if (gnumeric_sheet_can_select_expr_range (gsheet)){
gnumeric_sheet_start_range_selection (gsheet, col, row);
ig->selecting = ITEM_GRID_SELECTING_FORMULA_RANGE;
gnome_canvas_item_grab (item,
GDK_POINTER_MOTION_MASK |
GDK_BUTTON_RELEASE_MASK,
NULL,
event->time);
return 1;
}
......@@ -839,6 +851,7 @@ item_grid_event (GnomeCanvasItem *item, GdkEvent *event)
ItemGrid *ig = ITEM_GRID (item);
GnumericSheet *gsheet = GNUMERIC_SHEET (canvas);
SheetControlGUI *scg = ig->scg;
Sheet *sheet = scg->sheet;
int col, row, x, y, left, top, width, height;
switch (event->type){
......@@ -862,9 +875,9 @@ item_grid_event (GnomeCanvasItem *item, GdkEvent *event)
scg_stop_sliding (ig->scg);
if (ig->selecting == ITEM_GRID_SELECTING_FORMULA_RANGE)
sheet_make_cell_visible (scg->sheet,
scg->sheet->edit_pos.col,
scg->sheet->edit_pos.row);
sheet_make_cell_visible (sheet,
sheet->edit_pos.col,
sheet->edit_pos.row);
wb_view_selection_desc (wb_control_view (
WORKBOOK_CONTROL (scg->wbcg)), TRUE, NULL);
......@@ -879,16 +892,17 @@ item_grid_event (GnomeCanvasItem *item, GdkEvent *event)
break;
case GDK_MOTION_NOTIFY:
gnome_canvas_w2c (canvas, event->motion.x, event->motion.y, &x, &y);
gnome_canvas_get_scroll_offsets (canvas, &left, &top);
gnome_canvas_w2c (canvas, event->motion.x, event->motion.y,
&x, &y);
col = gnumeric_sheet_find_col (gsheet, x, NULL);
row = gnumeric_sheet_find_row (gsheet, y, NULL);
gnome_canvas_get_scroll_offsets (canvas, &left, &top);
width = GTK_WIDGET (canvas)->allocation.width;
height = GTK_WIDGET (canvas)->allocation.height;
col = gnumeric_sheet_find_col (gsheet, x, NULL);
row = gnumeric_sheet_find_row (gsheet, y, NULL);
if (x < left || y < top || x >= left + width || y >= top + height) {
if (x < left || y < top ||
x >= left + width || y >= top + height) {
int dx = 0, dy = 0;
SheetControlGUISlideHandler slide_handler = NULL;
......@@ -910,9 +924,8 @@ item_grid_event (GnomeCanvasItem *item, GdkEvent *event)
else if (ig->selecting == ITEM_GRID_SELECTING_FORMULA_RANGE)
slide_handler = &cb_extend_expr_range;
if (scg_start_sliding (ig->scg,
slide_handler, NULL,
col, row, dx, dy))
if (scg_start_sliding (ig->scg, slide_handler, NULL,
col, row, dx, dy))
return TRUE;
}
......@@ -932,33 +945,30 @@ item_grid_event (GnomeCanvasItem *item, GdkEvent *event)
if (event->motion.y < 0)
event->motion.y = 0;
sheet_selection_extend_to (scg->sheet, col, row);
sheet_selection_extend_to (sheet, col, row);
return TRUE;
case GDK_BUTTON_PRESS:
scg_stop_sliding (ig->scg);
gnome_canvas_w2c (canvas, event->button.x, event->button.y, &x, &y);
gnome_canvas_w2c (canvas, event->button.x, event->button.y,
&x, &y);
col = gnumeric_sheet_find_col (gsheet, x, NULL);
row = gnumeric_sheet_find_row (gsheet, y, NULL);
/* While a guru is up ignore clicks */
if (workbook_edit_has_guru (gsheet->scg->wbcg) && event->button.button != 1)
return TRUE;
switch (event->button.button){
case 1:
if (event->button.button == 1)
return item_grid_button_1 (scg, &event->button,
ig, col, row, x, y);
if (workbook_edit_has_guru (gsheet->scg->wbcg))
return TRUE;
case 2:
switch (event->button.button) {
case 2: drag_start (GTK_WIDGET (item->canvas), event, sheet);
g_warning ("This is here just for demo purposes");
drag_start (GTK_WIDGET (item->canvas), event, scg->sheet);
return TRUE;
case 3:
scg_context_menu (ig->scg,
&event->button, FALSE, FALSE);
case 3: scg_context_menu (ig->scg,&event->button, FALSE, FALSE);
return TRUE;
default :
......@@ -991,29 +1001,30 @@ item_grid_init (ItemGrid *ig)
static void
item_grid_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
{
GnomeCanvasItem *item;
ItemGrid *ig;
item = GNOME_CANVAS_ITEM (o);
ig = ITEM_GRID (o);
ItemGrid *ig = ITEM_GRID (o);
switch (arg_id){
switch (arg_id) {
case ARG_SHEET_CONTROL_GUI:
ig->scg = GTK_VALUE_POINTER (*arg);
break;
default :
g_warning ("unknown arg %d", arg_id);
}
}
typedef struct {
GnomeCanvasItemClass parent_class;
} ItemGridClass;
static void
item_grid_class_init (ItemGridClass *item_grid_class)
{
GtkObjectClass *object_class;
GnomeCanvasItemClass *item_class;
item_grid_parent_class = gtk_type_class (gnome_canvas_item_get_type ());
item_grid_parent_class =
gtk_type_class (gnome_canvas_group_get_type ());
object_class = (GtkObjectClass *) item_grid_class;
item_class = (GnomeCanvasItemClass *) item_grid_class;
......
......@@ -380,8 +380,6 @@ preview_grid_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, i
item->y1 = 0;
item->x2 = INT_MAX;
item->y2 = INT_MAX;
gnome_canvas_group_child_bounds (GNOME_CANVAS_GROUP (item->parent), item);
}
/**
......
......@@ -9,6 +9,7 @@
#include "sheet-control-gui.h"
#include "item-bar.h"
#define GNUMERIC_ITEM "SCG"
#include "item-debug.h"
#include "gnumeric-sheet.h"
#include "sheet.h"
......@@ -356,13 +357,15 @@ scg_make_edit_pos_visible (SheetControlGUI const *scg)
#endif
static void
scg_size_allocate (GtkWidget *widget, GtkAllocation *alloc, SheetControlGUI *scg)
scg_size_allocate (GtkWidget *widget, GtkAllocation *alloc,
SheetControlGUI *scg)
{
#if 0
/* FIXME
* When a new sheet is added this is called and if the edit cell was not visible
* we change the scroll position even though to the user the size did not change
* and there is no reason for the scrolling to jump.
* When a new sheet is added this is called and if the edit cell was
* not visible we change the scroll position even though to the user
* the size did not change and there is no reason for the scrolling to