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

handle visibility. ditto. ditto. (sheet_object_filled_update_bounds) :

2001-10-21  Jody Goldberg <jgoldberg@home.com>

	* src/sheet-object-container.c (sheet_object_container_update_bounds) :
	  handle visibility.
	* src/sheet-object-cell-comment.c (cell_comment_update_bounds) : ditto.
	* src/sheet-object-graphic.c (sheet_object_graphic_update_bounds) : ditto.
	(sheet_object_filled_update_bounds) : ditto.
	* src/sheet-object-widget.c (sheet_object_widget_update_bounds) : ditto.

	* src/sheet-object.c (sheet_object_init) : init is_visible.
	  Not really needed, but lets be careful.
	(sheet_object_update_bounds) : check to visibility.
parent a8c47647
......@@ -8,6 +8,7 @@ release, and longer term bugs.
Release Critical
----------------
http://bugzilla.gnome.org/show_bug.cgi?id=62284 freeze vs delete col/row
http://bugzilla.gnome.org/show_bug.cgi?id=62649 counta recalc (replicate?)
http://bugzilla.gnome.org/show_bug.cgi?id=62004 rand paste (replicate?)
......
2001-10-21 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object-container.c (sheet_object_container_update_bounds) :
handle visibility.
* src/sheet-object-cell-comment.c (cell_comment_update_bounds) : ditto.
* src/sheet-object-graphic.c (sheet_object_graphic_update_bounds) : ditto.
(sheet_object_filled_update_bounds) : ditto.
* src/sheet-object-widget.c (sheet_object_widget_update_bounds) : ditto.
* src/sheet-object.c (sheet_object_init) : init is_visible.
Not really needed, but lets be careful.
(sheet_object_update_bounds) : check to visibility.
2001-10-20 jody goldberg <jgoldberg@home.com>
* src/sheet.c (cb_max_cell_width) : factor in indents too.
......
......@@ -4,6 +4,11 @@ Andreas:
* Allow analysis tool output to be directed onto a range
on another sheet.
Jody:
* Fix autosizing of indented content.
* Fix jump to bound with end in hidden region.
* Hide objects in hidden regions.
Morten:
* Improve goal seek.
* Fixed parsing of numbers is scientific context.
......
2001-10-21 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object-container.c (sheet_object_container_update_bounds) :
handle visibility.
* src/sheet-object-cell-comment.c (cell_comment_update_bounds) : ditto.
* src/sheet-object-graphic.c (sheet_object_graphic_update_bounds) : ditto.
(sheet_object_filled_update_bounds) : ditto.
* src/sheet-object-widget.c (sheet_object_widget_update_bounds) : ditto.
* src/sheet-object.c (sheet_object_init) : init is_visible.
Not really needed, but lets be careful.
(sheet_object_update_bounds) : check to visibility.
2001-10-20 jody goldberg <jgoldberg@home.com>
* src/sheet.c (cb_max_cell_width) : factor in indents too.
......
2001-10-21 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object-container.c (sheet_object_container_update_bounds) :
handle visibility.
* src/sheet-object-cell-comment.c (cell_comment_update_bounds) : ditto.
* src/sheet-object-graphic.c (sheet_object_graphic_update_bounds) : ditto.
(sheet_object_filled_update_bounds) : ditto.
* src/sheet-object-widget.c (sheet_object_widget_update_bounds) : ditto.
* src/sheet-object.c (sheet_object_init) : init is_visible.
Not really needed, but lets be careful.
(sheet_object_update_bounds) : check to visibility.
2001-10-20 jody goldberg <jgoldberg@home.com>
* src/sheet.c (cb_max_cell_width) : factor in indents too.
......
2001-10-21 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object-container.c (sheet_object_container_update_bounds) :
handle visibility.
* src/sheet-object-cell-comment.c (cell_comment_update_bounds) : ditto.
* src/sheet-object-graphic.c (sheet_object_graphic_update_bounds) : ditto.
(sheet_object_filled_update_bounds) : ditto.
* src/sheet-object-widget.c (sheet_object_widget_update_bounds) : ditto.
* src/sheet-object.c (sheet_object_init) : init is_visible.
Not really needed, but lets be careful.
(sheet_object_update_bounds) : check to visibility.
2001-10-20 jody goldberg <jgoldberg@home.com>
* src/sheet.c (cb_max_cell_width) : factor in indents too.
......
......@@ -105,6 +105,11 @@ cell_comment_update_bounds (SheetObject *so, GtkObject *view,
GnomeCanvasPoints *points = comment_get_points (scg, so);
gnome_canvas_item_set (item, "points", points, NULL);
gnome_canvas_points_free (points);
if (so->is_visible)
gnome_canvas_item_show (item);
else
gnome_canvas_item_hide (item);
}
static int
......
......@@ -100,6 +100,11 @@ sheet_object_container_update_bounds (SheetObject *so, GtkObject *view,
"width", coords [2] - coords [0] + 1.,
"height", coords [3] - coords [1] + 1.,
NULL);
if (so->is_visible)
gnome_canvas_item_show (GNOME_CANVAS_ITEM (view));
else
gnome_canvas_item_hide (GNOME_CANVAS_ITEM (view));
}
static void
......
......@@ -175,6 +175,11 @@ sheet_object_graphic_update_bounds (SheetObject *so, GtkObject *view,
"points", points,
NULL);
gnome_canvas_points_free (points);
if (so->is_visible)
gnome_canvas_item_show (GNOME_CANVAS_ITEM (view));
else
gnome_canvas_item_hide (GNOME_CANVAS_ITEM (view));
}
static gboolean
......@@ -674,6 +679,11 @@ sheet_object_filled_update_bounds (SheetObject *so, GtkObject *view,
"y1", MIN (coords [1], coords [3]),
"y2", MAX (coords [1], coords [3]),
NULL);
if (so->is_visible)
gnome_canvas_item_show (GNOME_CANVAS_ITEM (view));
else
gnome_canvas_item_hide (GNOME_CANVAS_ITEM (view));
}
static GtkObject *
......
......@@ -17,6 +17,7 @@ struct _SheetObject {
Sheet *sheet;
GList *realized_list;
SheetObjectAnchor anchor;
gboolean is_visible;
};
typedef struct {
......
......@@ -37,9 +37,15 @@ sheet_object_item_new_view (SheetObject *so, SheetControlGUI *scg)
}
static void
sheet_object_item_update_bounds (SheetObject *so, GtkObject *obj_view,
sheet_object_item_update_bounds (SheetObject *so, GtkObject *view,
SheetControlGUI *s_control)
{
/* FIXME : what goes here ?? */
if (so->is_visible)
gnome_canvas_item_show (GNOME_CANVAS_ITEM (view));
else
gnome_canvas_item_hide (GNOME_CANVAS_ITEM (view));
}
static void
......
......@@ -137,6 +137,11 @@ sheet_object_widget_update_bounds (SheetObject *so, GtkObject *view,
"width", coords [2] - coords [0] + 1.,
"height", coords [3] - coords [1] + 1.,
NULL);
if (so->is_visible)
gnome_canvas_item_show (GNOME_CANVAS_ITEM (view));
else
gnome_canvas_item_hide (GNOME_CANVAS_ITEM (view));
}
static void
......
......@@ -178,6 +178,7 @@ sheet_object_init (GtkObject *object)
so->type = SHEET_OBJECT_ACTION_STATIC;
so->sheet = NULL;
so->is_visible = TRUE;
/* Store the logical position as A1 */
so->anchor.cell_bound.start.col = so->anchor.cell_bound.start.row = 0;
......@@ -258,6 +259,8 @@ void
sheet_object_update_bounds (SheetObject *so, CellPos const *pos)
{
GList *l;
gboolean is_hidden = TRUE;
int i, end;
g_return_if_fail (IS_SHEET_OBJECT (so));
......@@ -266,6 +269,23 @@ sheet_object_update_bounds (SheetObject *so, CellPos const *pos)
so->anchor.cell_bound.end.row < pos->row)
return;
/* Are all cols hidden ? */
end = so->anchor.cell_bound.end.col;
i = so->anchor.cell_bound.start.col;
while (i <= end && is_hidden)
is_hidden &= sheet_col_is_hidden (so->sheet, i++);
/* Are all rows hidden ? */
if (!is_hidden) {
is_hidden = TRUE;
end = so->anchor.cell_bound.end.row;
i = so->anchor.cell_bound.start.row;
while (i <= end && is_hidden)
is_hidden &= sheet_row_is_hidden (so->sheet, i++);
}
so->is_visible = !is_hidden;
for (l = so->realized_list; l; l = l->next) {
GtkObject *view = GTK_OBJECT (l->data);
SO_CLASS (so)->update_bounds (so, view,
......
......@@ -1761,39 +1761,21 @@ sheet_redraw_cell (Cell const *cell)
/****************************************************************************/
int
sheet_row_check_bound (int row, int diff)
{
int new_val = row + diff;
if (new_val < 0)
return 0;
if (new_val >= SHEET_MAX_ROWS)
return SHEET_MAX_ROWS - 1;
return new_val;
}
int
sheet_col_check_bound (int col, int diff)
gboolean
sheet_col_is_hidden (Sheet const *sheet, int col)
{
int new_val = col + diff;
if (new_val < 0)
return 0;
if (new_val >= SHEET_MAX_COLS)
return SHEET_MAX_COLS - 1;
return new_val;
ColRowInfo const * const res = sheet_col_get (sheet, col);
return (res != NULL && !res->visible);
}
static inline gboolean
sheet_col_is_hidden (Sheet *sheet, int const col)
gboolean
sheet_row_is_hidden (Sheet const *sheet, int row)
{
ColRowInfo const * const res = sheet_col_get (sheet, col);
ColRowInfo const * const res = sheet_row_get (sheet, row);
return (res != NULL && !res->visible);
}
/*
* sheet_find_boundary_horizontal
* @sheet: The Sheet
......@@ -1892,13 +1874,6 @@ sheet_find_boundary_horizontal (Sheet *sheet, int start_col, int move_row,
return new_col;
}
static inline gboolean
sheet_row_is_hidden (Sheet *sheet, int const row)
{
ColRowInfo const * const res = sheet_row_get (sheet, row);
return (res != NULL && !res->visible);
}
/*
* sheet_find_boundary_vertical
* @sheet: The Sheet *
......
......@@ -133,11 +133,12 @@ gboolean sheet_is_region_empty_or_selected (Sheet *sheet, Range const *r);
gboolean sheet_is_region_empty (Sheet *sheet, Range const *r);
gboolean sheet_is_cell_empty (Sheet *sheet, int col, int row);
gboolean sheet_col_is_hidden (Sheet const *sheet, int col);
gboolean sheet_row_is_hidden (Sheet const *sheet, int row);
/* Create new ColRowInfos from the default sheet style */
ColRowInfo *sheet_col_new (Sheet *sheet);
ColRowInfo *sheet_row_new (Sheet *sheet);
int sheet_row_check_bound (int row, int diff);
int sheet_col_check_bound (int col, int diff);
int sheet_find_boundary_horizontal (Sheet *sheet, int col, int move_row,
int base_row, int count,
gboolean jump_to_boundaries);
......
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