Commit 55f23f4f authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Chema bug 4 - undo unhide broken.

Chema bug 6 - Clearing cell immediately beside a blocked span do not respan.
Chema bug 7 - contents of spanning hidden rows/cols still visible.

2000-05-20  Jody Goldberg <jgoldberg@home.com>

	* src/item-grid.c (item_grid_draw) : Do not draw the contents of
	  hidden spanning rows/cols.
	* src/print-cell.c (print_cell_range) : Ditto.

	* src/colrow.c (cb_row_col_visibility) : Be careful not to compare
	  TRUE for equality.

	* src/sheet.c
	(sheet_update_cursor_pos) : warning suppression.
	(sheet_row_col_visible) : Be careful not to compare TRUE for equality.
	(sheet_clear_region) : respan both sides of a singleton row/col.
	  Check for cells to either side even if there is no span,  if we are
	  directly adjacent to a cell it would have no span even if it wanted
	  one.
parent 7355ba25
2000-05-19 Jody Goldberg <jgoldberg@home.com>
2000-05-20 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (item_grid_draw) : Do not draw the contents of
hidden spanning rows/cols.
* src/print-cell.c (print_cell_range) : Ditto.
* src/colrow.c (cb_row_col_visibility) : Be careful not to compare
TRUE for equality.
* src/cell.c (cell_copy) : Ref the format if one exists.
(cell_set_format) : Apply the format to a NEW style, not the current
......@@ -10,6 +17,12 @@
spans and sizes of the contents.
(sheet_update_cursor_pos) : New function.
(sheet_row_col_visible) : changing the status of a row/col changes visibility.
(sheet_update_cursor_pos) : warning suppression.
(sheet_row_col_visible) : Be careful not to compare TRUE for equality.
(sheet_clear_region) : respan both sides of a singleton row/col.
Check for cells to either side even if there is no span, if we are
directly adjacent to a cell it would have no span even if it wanted
one.
* src/sheet-view.c (sheet_view_update_cursor_pos) : New function split
out from sheet_view_set_zoom_factor.
......
2000-05-19 Jody Goldberg <jgoldberg@home.com>
2000-05-20 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (item_grid_draw) : Do not draw the contents of
hidden spanning rows/cols.
* src/print-cell.c (print_cell_range) : Ditto.
* src/colrow.c (cb_row_col_visibility) : Be careful not to compare
TRUE for equality.
* src/cell.c (cell_copy) : Ref the format if one exists.
(cell_set_format) : Apply the format to a NEW style, not the current
......@@ -10,6 +17,12 @@
spans and sizes of the contents.
(sheet_update_cursor_pos) : New function.
(sheet_row_col_visible) : changing the status of a row/col changes visibility.
(sheet_update_cursor_pos) : warning suppression.
(sheet_row_col_visible) : Be careful not to compare TRUE for equality.
(sheet_clear_region) : respan both sides of a singleton row/col.
Check for cells to either side even if there is no span, if we are
directly adjacent to a cell it would have no span even if it wanted
one.
* src/sheet-view.c (sheet_view_update_cursor_pos) : New function split
out from sheet_view_set_zoom_factor.
......
2000-05-19 Jody Goldberg <jgoldberg@home.com>
2000-05-20 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (item_grid_draw) : Do not draw the contents of
hidden spanning rows/cols.
* src/print-cell.c (print_cell_range) : Ditto.
* src/colrow.c (cb_row_col_visibility) : Be careful not to compare
TRUE for equality.
* src/cell.c (cell_copy) : Ref the format if one exists.
(cell_set_format) : Apply the format to a NEW style, not the current
......@@ -10,6 +17,12 @@
spans and sizes of the contents.
(sheet_update_cursor_pos) : New function.
(sheet_row_col_visible) : changing the status of a row/col changes visibility.
(sheet_update_cursor_pos) : warning suppression.
(sheet_row_col_visible) : Be careful not to compare TRUE for equality.
(sheet_clear_region) : respan both sides of a singleton row/col.
Check for cells to either side even if there is no span, if we are
directly adjacent to a cell it would have no span even if it wanted
one.
* src/sheet-view.c (sheet_view_update_cursor_pos) : New function split
out from sheet_view_set_zoom_factor.
......
2000-05-19 Jody Goldberg <jgoldberg@home.com>
2000-05-20 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (item_grid_draw) : Do not draw the contents of
hidden spanning rows/cols.
* src/print-cell.c (print_cell_range) : Ditto.
* src/colrow.c (cb_row_col_visibility) : Be careful not to compare
TRUE for equality.
* src/cell.c (cell_copy) : Ref the format if one exists.
(cell_set_format) : Apply the format to a NEW style, not the current
......@@ -10,6 +17,12 @@
spans and sizes of the contents.
(sheet_update_cursor_pos) : New function.
(sheet_row_col_visible) : changing the status of a row/col changes visibility.
(sheet_update_cursor_pos) : warning suppression.
(sheet_row_col_visible) : Be careful not to compare TRUE for equality.
(sheet_clear_region) : respan both sides of a singleton row/col.
Check for cells to either side even if there is no span, if we are
directly adjacent to a cell it would have no span even if it wanted
one.
* src/sheet-view.c (sheet_view_update_cursor_pos) : New function split
out from sheet_view_set_zoom_factor.
......
2000-05-19 Jody Goldberg <jgoldberg@home.com>
2000-05-20 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (item_grid_draw) : Do not draw the contents of
hidden spanning rows/cols.
* src/print-cell.c (print_cell_range) : Ditto.
* src/colrow.c (cb_row_col_visibility) : Be careful not to compare
TRUE for equality.
* src/cell.c (cell_copy) : Ref the format if one exists.
(cell_set_format) : Apply the format to a NEW style, not the current
......@@ -10,6 +17,12 @@
spans and sizes of the contents.
(sheet_update_cursor_pos) : New function.
(sheet_row_col_visible) : changing the status of a row/col changes visibility.
(sheet_update_cursor_pos) : warning suppression.
(sheet_row_col_visible) : Be careful not to compare TRUE for equality.
(sheet_clear_region) : respan both sides of a singleton row/col.
Check for cells to either side even if there is no span, if we are
directly adjacent to a cell it would have no span even if it wanted
one.
* src/sheet-view.c (sheet_view_update_cursor_pos) : New function split
out from sheet_view_set_zoom_factor.
......
2000-05-19 Jody Goldberg <jgoldberg@home.com>
2000-05-20 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (item_grid_draw) : Do not draw the contents of
hidden spanning rows/cols.
* src/print-cell.c (print_cell_range) : Ditto.
* src/colrow.c (cb_row_col_visibility) : Be careful not to compare
TRUE for equality.
* src/cell.c (cell_copy) : Ref the format if one exists.
(cell_set_format) : Apply the format to a NEW style, not the current
......@@ -10,6 +17,12 @@
spans and sizes of the contents.
(sheet_update_cursor_pos) : New function.
(sheet_row_col_visible) : changing the status of a row/col changes visibility.
(sheet_update_cursor_pos) : warning suppression.
(sheet_row_col_visible) : Be careful not to compare TRUE for equality.
(sheet_clear_region) : respan both sides of a singleton row/col.
Check for cells to either side even if there is no span, if we are
directly adjacent to a cell it would have no span even if it wanted
one.
* src/sheet-view.c (sheet_view_update_cursor_pos) : New function split
out from sheet_view_set_zoom_factor.
......
2000-05-19 Jody Goldberg <jgoldberg@home.com>
2000-05-20 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (item_grid_draw) : Do not draw the contents of
hidden spanning rows/cols.
* src/print-cell.c (print_cell_range) : Ditto.
* src/colrow.c (cb_row_col_visibility) : Be careful not to compare
TRUE for equality.
* src/cell.c (cell_copy) : Ref the format if one exists.
(cell_set_format) : Apply the format to a NEW style, not the current
......@@ -10,6 +17,12 @@
spans and sizes of the contents.
(sheet_update_cursor_pos) : New function.
(sheet_row_col_visible) : changing the status of a row/col changes visibility.
(sheet_update_cursor_pos) : warning suppression.
(sheet_row_col_visible) : Be careful not to compare TRUE for equality.
(sheet_clear_region) : respan both sides of a singleton row/col.
Check for cells to either side even if there is no span, if we are
directly adjacent to a cell it would have no span even if it wanted
one.
* src/sheet-view.c (sheet_view_update_cursor_pos) : New function split
out from sheet_view_set_zoom_factor.
......
......@@ -45,22 +45,22 @@ cb_row_col_visibility (Sheet *sheet,
}
/* Find the begining of a segment that will be toggled */
while (i <= end) {
ColRowInfo *cri = (*fetch) (sheet, i++);
if (visible ^ cri->visible) {
for (;i <= end ; ++i) {
ColRowInfo *cri = (*fetch) (sheet, i);
if ((visible == 0) != (cri->visible == 0)) {
struct pair_int *res = g_new(struct pair_int, 1);
/* Find the end */
for (j = i; j <= end ;) {
ColRowInfo * cri = (*fetch) (sheet, j++);
if (visible ^ cri->visible)
for (j = i+1; j <= end ; ++j) {
ColRowInfo * cri = (*fetch) (sheet, j);
if ((visible == 0) == (cri->visible == 0))
break;
}
res->index = i - 1;
res->count = j - i + 1;
res->index = i;
res->count = j - i;
#if 0
printf ("%d %d\n", res->index, res->count);
#if 0
#endif
dat->elements = g_slist_prepend (dat->elements, res);
i = j;
......
......@@ -397,6 +397,8 @@ item_grid_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int
int const end_span_col = span->right;
int real_x = -1;
MStyle *real_style = NULL;
gboolean const is_visible =
cell->row_info->visible && cell->col_info->visible;
/* Paint the backgrounds & borders */
for (; x_paint < end_x && col <= end_span_col ; ++col) {
......@@ -405,7 +407,7 @@ item_grid_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int
MStyle *mstyle = item_grid_draw_background (
drawable, item_grid, ci, ri,
col, row, x_paint, y_paint,
col != start_span_col);
col != start_span_col && is_visible);
if (col == real_col) {
real_style = mstyle;
real_x = x_paint;
......@@ -426,8 +428,9 @@ item_grid_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int
col, cell->col_info->pos);
}
cell_draw (cell, real_style, span,
item_grid->gc, drawable, real_x, y_paint);
if (is_visible)
cell_draw (cell, real_style, span,
item_grid->gc, drawable, real_x, y_paint);
mstyle_unref (real_style);
}
}
......
......@@ -632,6 +632,8 @@ print_cell_range (GnomePrintContext *context,
int const end_span_col = span->right;
int real_x = -1;
MStyle *real_style = NULL;
gboolean const is_visible =
cell->row_info->visible && cell->col_info->visible;
/* Paint the backgrounds & borders */
for (; col <= MIN (end_col, end_span_col) ; ++col) {
......@@ -643,7 +645,7 @@ print_cell_range (GnomePrintContext *context,
mstyle = print_cell_background (
context, sheet, ci, ri,
col, row, x, y,
col != start_span_col);
col != start_span_col && is_visible);
if (col == real_col) {
real_style = mstyle;
......@@ -664,10 +666,10 @@ print_cell_range (GnomePrintContext *context,
col, cell->col_info->pos);
}
if (output){
if (is_visible && output)
print_cell (cell, real_style, span,
context, real_x, y);
}
printed = TRUE;
mstyle_unref (real_style);
}
......
......@@ -2330,7 +2330,7 @@ sheet_clear_region (CommandContext *context, Sheet *sheet,
* able to continue.
*/
test[0] = (start_col > 0);
test[1] = (start_col != end_col && end_col < SHEET_MAX_ROWS-1);
test[1] = (end_col < SHEET_MAX_ROWS-1);
col[0] = start_col - 1;
col[1] = end_col + 1;
for (row = start_row; row <= end_row ; ++row) {
......@@ -2345,17 +2345,22 @@ sheet_clear_region (CommandContext *context, Sheet *sheet,
if (!test[i])
continue;
span = row_span_get (ri, col[i]);
if (span == NULL)
continue;
cell = sheet_cell_get (sheet, col[i], ri->pos);
if (cell == NULL) {
span = row_span_get (ri, col[i]);
if (span == NULL)
continue;
cell = span->cell;
}
cell = span->cell;
cell_calc_span (cell, &left, &right);
if (left != span->left || right != span->right) {
cell_unregister_span (cell);
if (span) {
if (left != span->left || right != span->right) {
cell_unregister_span (cell);
cell_register_span (cell, left, right);
}
} else if (left != right)
cell_register_span (cell, left, right);
}
/* We would not need to redraw the old span, just the new one */
if (min_col > left)
......@@ -2472,7 +2477,7 @@ sheet_cursor_set (Sheet *sheet,
}
void
sheet_update_cursor_pos (Sheet *sheet)
sheet_update_cursor_pos (Sheet const *sheet)
{
GList *l;
......@@ -3315,7 +3320,7 @@ sheet_row_col_visible (Sheet *sheet, gboolean const is_col, gboolean const visib
? sheet_col_fetch (sheet, index++)
: sheet_row_fetch (sheet, index++);
if (visible ^ cri->visible) {
if ((visible == 0) != (cri->visible == 0)) {
cri->visible = visible;
sheet->priv->recompute_visibility = TRUE;
}
......
......@@ -135,7 +135,7 @@ void sheet_cursor_set (Sheet *sheet,
int edit_col, int edit_row,
int base_col, int base_row,
int move_col, int move_row);
void sheet_update_cursor_pos (Sheet *sheet);
void sheet_update_cursor_pos (Sheet const *sheet);
void sheet_set_edit_pos (Sheet *sheet, int col, int row);
void sheet_make_cell_visible (Sheet *sheet, int col, int row);
......
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