Commit 943bf40e authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

- gnome-xml is is CVS now. Prepare for release and require it.

- Row/Col hiding.

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

	* src/xml-io.c (xml_write_colrow_info) : Save whether or not a row/col
	  is hidden.
	(xml_read_colrow_info) : Restore the hidden-ness.

	* src/gnumeric-sheet.c (gnumeric_sheet_compute_visible_ranges) :
	  Col/Row pixel width < 0 indicates the row is hidden.
	(gnumeric_sheet_make_cell_visible) : Ditto.
	(colrow_set_units) : Ditto.
	(sheet_{row,col}_info_set_{height,width}) : Ditto.
	(sheet_{row,col}_set_internal_{height,width}) : Ditto.
	(sheet_{row,col}_get_distance) : Ditto.
	(sheet_{row,col}_get_unit_distance) : Ditto.
	(sheet_{row,col}_is_hidden) : Utility routines.
	(sheet_find_boundary_{vertical,horizontal}) : Skip hidden rows/cols.
	(sheet_row_col_visible) : Mark a contiguous set of rows/cols as
	  visible or hidden.

	* src/sheet.c (sheet_compute_col_row_new_size) : Ditto.

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

	* src/item-grid.c (item_grid_find_{col,row}) : Ditto.
	(item_grid_draw) : Skip cells in hidden rows cols.
	(item_grid_paint_empty_cell) : Ditto, just in case.
	(item_grid_draw_cell) : Ditto.
	(context_{col,row}_{hide,unhide}) : New functions.
	(item_grid_context_menu) : Add new menu items.

	* src/selection.c (selection_row_col_visible) : New function.
	cb_row_col_visibility : Utility function.

	* src/workbook-cmd-format.c
	(workbook_cmd_format_{column,row}_{hide,unhide}) : New functions.
	(workbook_cmd_format_column_std_width) : Stub.
	(workbook_cmd_format_row_std_height) : Stub.

	* src/workbook.c : Add hide/unhide to the row/col format menus.

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

	* configure.in : Add test for gnome-xml >= 1.8.5. This is
	  required to support the problems with versions 1.8.[234].
	* gnumeric.spec.in : Ditto.
parent 3c55bcd5
2000-01-18 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_write_colrow_info) : Save whether or not a row/col
is hidden.
(xml_read_colrow_info) : Restore the hidden-ness.
* src/gnumeric-sheet.c (gnumeric_sheet_compute_visible_ranges) :
Col/Row pixel width < 0 indicates the row is hidden.
(gnumeric_sheet_make_cell_visible) : Ditto.
(colrow_set_units) : Ditto.
(sheet_{row,col}_info_set_{height,width}) : Ditto.
(sheet_{row,col}_set_internal_{height,width}) : Ditto.
(sheet_{row,col}_get_distance) : Ditto.
(sheet_{row,col}_get_unit_distance) : Ditto.
(sheet_{row,col}_is_hidden) : Utility routines.
(sheet_find_boundary_{vertical,horizontal}) : Skip hidden rows/cols.
(sheet_row_col_visible) : Mark a contiguous set of rows/cols as
visible or hidden.
* src/sheet.c (sheet_compute_col_row_new_size) : Ditto.
* src/item-bar.c (item_bar_draw) : Ditto.
(is_pointer_on_division) : Ditto.
(get_col_from_pos) : Ditto.
* src/item-grid.c (item_grid_find_{col,row}) : Ditto.
(item_grid_draw) : Skip cells in hidden rows cols.
(item_grid_paint_empty_cell) : Ditto, just in case.
(item_grid_draw_cell) : Ditto.
(context_{col,row}_{hide,unhide}) : New functions.
(item_grid_context_menu) : Add new menu items.
* src/selection.c (selection_row_col_visible) : New function.
cb_row_col_visibility : Utility function.
* src/workbook-cmd-format.c
(workbook_cmd_format_{column,row}_{hide,unhide}) : New functions.
(workbook_cmd_format_column_std_width) : Stub.
(workbook_cmd_format_row_std_height) : Stub.
* src/workbook.c : Add hide/unhide to the row/col format menus.
2000-01-18 Jody Goldberg <jgoldberg@home.com>
* configure.in : Add test for gnome-xml >= 1.8.5. This is
required to support the problems with versions 1.8.[234].
* gnumeric.spec.in : Ditto.
2000-01-18 Morten Welinder <terra@diku.dk>
* src/functions/fn-stat.c (stat_functions_init): Add auto-format
......
2000-01-18 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_write_colrow_info) : Save whether or not a row/col
is hidden.
(xml_read_colrow_info) : Restore the hidden-ness.
* src/gnumeric-sheet.c (gnumeric_sheet_compute_visible_ranges) :
Col/Row pixel width < 0 indicates the row is hidden.
(gnumeric_sheet_make_cell_visible) : Ditto.
(colrow_set_units) : Ditto.
(sheet_{row,col}_info_set_{height,width}) : Ditto.
(sheet_{row,col}_set_internal_{height,width}) : Ditto.
(sheet_{row,col}_get_distance) : Ditto.
(sheet_{row,col}_get_unit_distance) : Ditto.
(sheet_{row,col}_is_hidden) : Utility routines.
(sheet_find_boundary_{vertical,horizontal}) : Skip hidden rows/cols.
(sheet_row_col_visible) : Mark a contiguous set of rows/cols as
visible or hidden.
* src/sheet.c (sheet_compute_col_row_new_size) : Ditto.
* src/item-bar.c (item_bar_draw) : Ditto.
(is_pointer_on_division) : Ditto.
(get_col_from_pos) : Ditto.
* src/item-grid.c (item_grid_find_{col,row}) : Ditto.
(item_grid_draw) : Skip cells in hidden rows cols.
(item_grid_paint_empty_cell) : Ditto, just in case.
(item_grid_draw_cell) : Ditto.
(context_{col,row}_{hide,unhide}) : New functions.
(item_grid_context_menu) : Add new menu items.
* src/selection.c (selection_row_col_visible) : New function.
cb_row_col_visibility : Utility function.
* src/workbook-cmd-format.c
(workbook_cmd_format_{column,row}_{hide,unhide}) : New functions.
(workbook_cmd_format_column_std_width) : Stub.
(workbook_cmd_format_row_std_height) : Stub.
* src/workbook.c : Add hide/unhide to the row/col format menus.
2000-01-18 Jody Goldberg <jgoldberg@home.com>
* configure.in : Add test for gnome-xml >= 1.8.5. This is
required to support the problems with versions 1.8.[234].
* gnumeric.spec.in : Ditto.
2000-01-18 Morten Welinder <terra@diku.dk>
* src/functions/fn-stat.c (stat_functions_init): Add auto-format
......
......@@ -68,6 +68,21 @@ dnl **************************************************
GNOMEGNORBA_LIBS="$GNOMEGNORBA_LIBS"
AC_SUBST(GNOMEGNORBA_LIBS)
dnl ******************************
dnl gnome-xml checking
dnl ******************************
AC_MSG_CHECKING(for GnomeXML libraries >= 1.8.5)
if xml-config --libs print > /dev/null 2>&1; then
vers=`xml-config --version | sed -e "s/libxml //" | awk 'BEGIN { FS = "."; } { print $1 * 1000000 + $2 * 1000 + $3;}'`
if test "$vers" -ge 1008005; then
AC_MSG_RESULT(found)
else
AC_MSG_ERROR(You need at least GnomeXML 1.8.5 for this version of Gnumeric)
fi
else
AC_MSG_ERROR(Did not find GnomeXML installed)
fi
dnl **************************************************
dnl * Check for Perl
......
......@@ -18,6 +18,7 @@ Requires: gtk+ >= 1.2.2
Requires: gnome-libs >= 1.0.0
Requires: gnome-print >= 0.10
Requires: libglade >= 0.11
Requires: libxml >= 1.8.5
%description
GNOME (GNU Network Object Model Environment) is a user-friendly set of
......
......@@ -1255,4 +1255,5 @@ cmd_resize_row_col (CommandContext *context, gboolean is_col,
* - Autofill
* - Array formula creation.
* - Sorting (jpr is working on this ?)
* - Row/Col hide/unhide
*/
......@@ -1078,25 +1078,25 @@ gnumeric_sheet_compute_visible_ranges (GnumericSheet *gsheet)
width = GTK_WIDGET (canvas)->allocation.width;
do {
ColRowInfo *ci;
int cb;
ci = sheet_col_get_info (gsheet->sheet_view->sheet, col);
cb = pixels + ci->pixels;
if (cb == width){
gsheet->last_visible_col = col;
gsheet->last_full_col = col;
break;
} if (cb > width){
gsheet->last_visible_col = col;
if (col == gsheet->left_col)
gsheet->last_full_col = gsheet->left_col;
else
gsheet->last_full_col = col - 1;
break;
ColRowInfo const * const ci = sheet_col_get_info (gsheet->sheet_view->sheet, col);
int const tmp = ci->pixels;
if (tmp > 0) {
int const cb = pixels + ci->pixels;
if (cb == width){
gsheet->last_visible_col = col;
gsheet->last_full_col = col;
break;
} if (cb > width){
gsheet->last_visible_col = col;
if (col == gsheet->left_col)
gsheet->last_full_col = gsheet->left_col;
else
gsheet->last_full_col = col - 1;
break;
}
pixels = cb;
}
pixels = cb;
++col;
} while (pixels < width && col < SHEET_MAX_COLS);
......@@ -1110,25 +1110,25 @@ gnumeric_sheet_compute_visible_ranges (GnumericSheet *gsheet)
row = gsheet->top_row;
height = GTK_WIDGET (canvas)->allocation.height;
do {
ColRowInfo *ri;
int cb;
ri = sheet_row_get_info (gsheet->sheet_view->sheet, row);
cb = pixels + ri->pixels;
if (cb == height){
gsheet->last_visible_row = row;
gsheet->last_full_row = row;
break;
} if (cb > height){
gsheet->last_visible_row = row;
if (row == gsheet->top_row)
gsheet->last_full_row = gsheet->top_row;
else
gsheet->last_full_row = row - 1;
break;
ColRowInfo const * const ri = sheet_row_get_info (gsheet->sheet_view->sheet, row);
int const tmp = ri->pixels;
if (tmp > 0) {
int const cb = pixels + ri->pixels;
if (cb == height){
gsheet->last_visible_row = row;
gsheet->last_full_row = row;
break;
} if (cb > height){
gsheet->last_visible_row = row;
if (row == gsheet->top_row)
gsheet->last_full_row = gsheet->top_row;
else
gsheet->last_full_row = row - 1;
break;
}
pixels = cb;
}
pixels = cb;
row++;
} while (pixels < height && row < SHEET_MAX_ROWS);
......@@ -1241,17 +1241,18 @@ gnumeric_sheet_make_cell_visible (GnumericSheet *gsheet, int col, int row)
if (col < gsheet->left_col){
new_left_col = col;
} else if (col > gsheet->last_full_col){
ColRowInfo *ci;
int width = GTK_WIDGET (canvas)->allocation.width;
int allocated = 0;
int first_col;
for (first_col = col; first_col > 0; first_col--){
ci = sheet_col_get_info (sheet, first_col);
if (allocated + ci->pixels > width)
break;
allocated += ci->pixels;
ColRowInfo const * const ci = sheet_col_get_info (sheet, first_col);
int const tmp = ci->pixels;
if (tmp > 0) {
if (allocated + ci->pixels > width)
break;
allocated += ci->pixels;
}
}
new_left_col = first_col+1;
} else
......@@ -1261,17 +1262,18 @@ gnumeric_sheet_make_cell_visible (GnumericSheet *gsheet, int col, int row)
if (row < gsheet->top_row){
new_top_row = row;
} else if (row > gsheet->last_full_row){
ColRowInfo *ri;
int height = GTK_WIDGET (canvas)->allocation.height;
int allocated = 0;
int first_row;
for (first_row = row; first_row > 0; first_row--){
ri = sheet_row_get_info (sheet, first_row);
if (allocated + ri->pixels > height)
break;
allocated += ri->pixels;
ColRowInfo const * const ri = sheet_row_get_info (sheet, first_row);
int const tmp = ri->pixels;
if (tmp > 0) {
if (allocated + ri->pixels > height)
break;
allocated += ri->pixels;
}
}
new_top_row = first_row+1;
} else
......
......@@ -1078,25 +1078,25 @@ gnumeric_sheet_compute_visible_ranges (GnumericSheet *gsheet)
width = GTK_WIDGET (canvas)->allocation.width;
do {
ColRowInfo *ci;
int cb;
ci = sheet_col_get_info (gsheet->sheet_view->sheet, col);
cb = pixels + ci->pixels;
if (cb == width){
gsheet->last_visible_col = col;
gsheet->last_full_col = col;
break;
} if (cb > width){
gsheet->last_visible_col = col;
if (col == gsheet->left_col)
gsheet->last_full_col = gsheet->left_col;
else
gsheet->last_full_col = col - 1;
break;
ColRowInfo const * const ci = sheet_col_get_info (gsheet->sheet_view->sheet, col);
int const tmp = ci->pixels;
if (tmp > 0) {
int const cb = pixels + ci->pixels;
if (cb == width){
gsheet->last_visible_col = col;
gsheet->last_full_col = col;
break;
} if (cb > width){
gsheet->last_visible_col = col;
if (col == gsheet->left_col)
gsheet->last_full_col = gsheet->left_col;
else
gsheet->last_full_col = col - 1;
break;
}
pixels = cb;
}
pixels = cb;
++col;
} while (pixels < width && col < SHEET_MAX_COLS);
......@@ -1110,25 +1110,25 @@ gnumeric_sheet_compute_visible_ranges (GnumericSheet *gsheet)
row = gsheet->top_row;
height = GTK_WIDGET (canvas)->allocation.height;
do {
ColRowInfo *ri;
int cb;
ri = sheet_row_get_info (gsheet->sheet_view->sheet, row);
cb = pixels + ri->pixels;
if (cb == height){
gsheet->last_visible_row = row;
gsheet->last_full_row = row;
break;
} if (cb > height){
gsheet->last_visible_row = row;
if (row == gsheet->top_row)
gsheet->last_full_row = gsheet->top_row;
else
gsheet->last_full_row = row - 1;
break;
ColRowInfo const * const ri = sheet_row_get_info (gsheet->sheet_view->sheet, row);
int const tmp = ri->pixels;
if (tmp > 0) {
int const cb = pixels + ri->pixels;
if (cb == height){
gsheet->last_visible_row = row;
gsheet->last_full_row = row;
break;
} if (cb > height){
gsheet->last_visible_row = row;
if (row == gsheet->top_row)
gsheet->last_full_row = gsheet->top_row;
else
gsheet->last_full_row = row - 1;
break;
}
pixels = cb;
}
pixels = cb;
row++;
} while (pixels < height && row < SHEET_MAX_ROWS);
......@@ -1241,17 +1241,18 @@ gnumeric_sheet_make_cell_visible (GnumericSheet *gsheet, int col, int row)
if (col < gsheet->left_col){
new_left_col = col;
} else if (col > gsheet->last_full_col){
ColRowInfo *ci;
int width = GTK_WIDGET (canvas)->allocation.width;
int allocated = 0;
int first_col;
for (first_col = col; first_col > 0; first_col--){
ci = sheet_col_get_info (sheet, first_col);
if (allocated + ci->pixels > width)
break;
allocated += ci->pixels;
ColRowInfo const * const ci = sheet_col_get_info (sheet, first_col);
int const tmp = ci->pixels;
if (tmp > 0) {
if (allocated + ci->pixels > width)
break;
allocated += ci->pixels;
}
}
new_left_col = first_col+1;
} else
......@@ -1261,17 +1262,18 @@ gnumeric_sheet_make_cell_visible (GnumericSheet *gsheet, int col, int row)
if (row < gsheet->top_row){
new_top_row = row;
} else if (row > gsheet->last_full_row){
ColRowInfo *ri;
int height = GTK_WIDGET (canvas)->allocation.height;
int allocated = 0;
int first_row;
for (first_row = row; first_row > 0; first_row--){
ri = sheet_row_get_info (sheet, first_row);
if (allocated + ri->pixels > height)
break;
allocated += ri->pixels;
ColRowInfo const * const ri = sheet_row_get_info (sheet, first_row);
int const tmp = ri->pixels;
if (tmp > 0) {
if (allocated + ri->pixels > height)
break;
allocated += ri->pixels;
}
}
new_top_row = first_row+1;
} else
......
......@@ -237,14 +237,16 @@ item_bar_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int w
} else
pixels = item_bar->resize_width;
total += pixels;
if (total >= 0) {
char const * const str = get_row_name (element);
bar_draw_cell (item_bar, drawable,
sheet_row_selection_type (sheet, element),
str,
-x, 1 + total - pixels,
real_width, pixels);
if (pixels > 0) {
total += pixels;
if (total >= 0) {
char const * const str = get_row_name (element);
bar_draw_cell (item_bar, drawable,
sheet_row_selection_type (sheet, element),
str,
-x, 1 + total - pixels,
real_width, pixels);
}
}
++element;
} while (total < height);
......@@ -267,13 +269,15 @@ item_bar_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int w
} else
pixels = item_bar->resize_width;
total += pixels;
if (total >= 0)
bar_draw_cell (item_bar, drawable,
sheet_col_selection_type (sheet, element),
col_name (element),
1 + total - pixels, -y,
pixels, real_height);
if (pixels > 0) {
total += pixels;
if (total >= 0)
bar_draw_cell (item_bar, drawable,
sheet_col_selection_type (sheet, element),
col_name (element),
1 + total - pixels, -y,
pixels, real_height);
}
++element;
} while (total < width);
......@@ -299,7 +303,7 @@ is_pointer_on_division (ItemBar *item_bar, int pos, int *the_total, int *the_ele
{
ColRowInfo *cri;
Sheet *sheet;
int i, total;
int i, total, tmp;
total = 0;
sheet = item_bar->sheet_view->sheet;
......@@ -315,17 +319,20 @@ is_pointer_on_division (ItemBar *item_bar, int pos, int *the_total, int *the_ele
cri = sheet_col_get_info (sheet, i);
}
total += cri->pixels;
if ((total - 4 < pos) && (pos < total + 4)){
if (the_total)
*the_total = total;
if (the_element)
*the_element = i;
tmp = cri->pixels;
if (tmp > 0) {
total += tmp;
if ((total - 4 < pos) && (pos < total + 4)) {
if (the_total)
*the_total = total;
if (the_element)
*the_element = i;
return cri;
return cri;
}
}
if (total > pos){
if (total > pos) {
if (the_element)
*the_element = i;
return NULL;
......@@ -404,7 +411,7 @@ get_col_from_pos (ItemBar *item_bar, int pos)
{
ColRowInfo *cri;
Sheet *sheet;
int i, total;
int i, total, tmp;
total = 0;
sheet = item_bar->sheet_view->sheet;
......@@ -419,9 +426,12 @@ get_col_from_pos (ItemBar *item_bar, int pos)
cri = sheet_col_get_info (sheet, i);
}
total += cri->pixels;
if (total > pos)
return i;
tmp = cri->pixels;
if (tmp > 0) {
total += tmp;
if (total > pos)
return i;
}
}
return i;
}
......
......@@ -154,14 +154,18 @@ item_grid_find_col (ItemGrid *item_grid, int x, int *col_origin)
do {
ColRowInfo *ci = sheet_col_get_info (item_grid->sheet, col);
int const tmp = ci->pixels;
if (x >= pixel && x <= pixel + ci->pixels) {
if (col_origin)
*col_origin = pixel;
return col;
if (tmp > 0) {
if (x >= pixel && x <= pixel + tmp) {
if (col_origin)
*col_origin = pixel;
return col;
}
pixel += tmp;
}
col++;
pixel += ci->pixels;
} while (col < SHEET_MAX_COLS);
return SHEET_MAX_COLS-1;
......@@ -185,14 +189,17 @@ item_grid_find_row (ItemGrid *item_grid, int y, int *row_origin)
do {
ColRowInfo *ri = sheet_row_get_info (item_grid->sheet, row);
int const tmp = ri->pixels;
if (y >= pixel && y <= pixel + ri->pixels) {
if (row_origin)
*row_origin = pixel;
return row;
if (tmp > 0) {
if (y >= pixel && y <= pixel + tmp) {
if (row_origin)
*row_origin = pixel;
return row;
}
pixel += tmp;
}
row++;
pixel += ri->pixels;
} while (row < SHEET_MAX_ROWS);
return SHEET_MAX_ROWS-1;
}
......@@ -277,8 +284,12 @@ item_grid_draw_cell (GdkDrawable *drawable, ItemGrid *item_grid, Cell *cell, int
GdkGC *gc = item_grid->gc;
GdkColor *col;
int count = 1;
int w, h;
MStyle *mstyle;
int const w = cell->col->pixels;
int const h = cell->row->pixels;
if (w <= 0 || h <= 0)
return 0;
mstyle = sheet_style_compute (item_grid->sheet, cell->col->pos,
cell->row->pos);
......@@ -298,9 +309,6 @@ item_grid_draw_cell (GdkDrawable *drawable, ItemGrid *item_grid, Cell *cell, int
} else
gdk_gc_set_background (gc, &item_grid->background);
w = cell->col->pixels;
h = cell->row->pixels;
/* Draw cell contents BEFORE border */
if (cell->sheet->display_zero || !cell_is_zero (cell))
count = cell_draw (cell, item_grid->sheet_view, gc, drawable, x1, y1);
......@@ -321,6 +329,11 @@ item_grid_paint_empty_cell (GdkDrawable *drawable, ItemGrid *item_grid,
{
MStyle *mstyle;
GdkGC *gc = item_grid->empty_gc;
int const w = ci->pixels;
int const h = ri->pixels;
if (w <= 0 || h <= 0)
return;
mstyle = sheet_style_compute (item_grid->sheet, col, row);
......@@ -328,9 +341,9 @@ item_grid_paint_empty_cell (GdkDrawable *drawable, ItemGrid *item_grid,
/* Ignore margins. Fill the entire cell (including the right
* hand divider) */
gdk_draw_rectangle (drawable, gc, TRUE,
x, y, ci->pixels+1, ri->pixels+1);
x, y, w+1, h+1);
item_grid_draw_border (drawable, mstyle, x, y, ci->pixels, ri->pixels,
item_grid_draw_border (drawable, mstyle, x, y, w, h,
span_count > 1,
span_count > 0);
......@@ -366,20 +379,24 @@ item_grid_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int
if (sheet->show_grid) {
col = paint_col;
for (x_paint = -diff_x; x_paint < end_x && col < SHEET_MAX_COLS; ++col){
ColRowInfo *ci;
ColRowInfo const * const ci = sheet_col_get_info (sheet, col);
int const tmp = ci->pixels;
ci = sheet_col_get_info (sheet, col);
gdk_draw_line (drawable, grid_gc, x_paint, 0, x_paint, height);
x_paint += ci->pixels;
if (tmp > 0) {
gdk_draw_line (drawable, grid_gc, x_paint, 0, x_paint, height);
x_paint += ci->pixels;
}
}
row = paint_row;
for (y_paint = -diff_y; y_paint < end_y && row < SHEET_MAX_ROWS; ++row){
ColRowInfo *ri;
ColRowInfo const * const ri = sheet_row_get_info (sheet, row);
int const tmp = ri->pixels;
ri = sheet_row_get_info (sheet, row);
gdk_draw_line (drawable, grid_gc, 0, y_paint, width, y_paint);
y_paint += ri->pixels;
if (tmp > 0) {
gdk_draw_line (drawable, grid_gc, 0, y_paint, width, y_paint);
y_paint += ri->pixels;
}
}
}
......@@ -388,11 +405,15 @@ item_grid_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int
row = paint_row;
for (y_paint = -diff_y; y_paint < end_y && row < SHEET_MAX_ROWS; row++) {
ColRowInfo const * const ri = sheet_row_get_info (sheet, row);
if (ri->pixels <= 0)
continue;
col = paint_col;
for (x_paint = -diff_x; x_paint < end_x && col < SHEET_MAX_COLS; ++col) {
ColRowInfo const * const ci = sheet_col_get_info (sheet, col);
Cell *cell = sheet_cell_get (sheet, col, row);
if (ci->pixels <= 0)
continue;
/* If the cell does not exist paint it as an empty cell */
if (cell == NULL) {
......@@ -427,21 +448,20 @@ item_grid_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int
* Either adjust the left part
*/
for (i = cell->col->pos; i < col; i++) {
ColRowInfo *tci;
tci = sheet_col_get_info (sheet, i);
real_x -= tci->pixels;
ColRowInfo const * const tci = sheet_col_get_info (sheet, i);
int const tmp = tci->pixels;
if (tmp > 0)
real_x -= tci->pixels;
}
/*
* Or adjust the right part
*/
for (i = col; i < cell->col->pos; i++) {
ColRowInfo *tci;
tci = sheet_col_get_info (
sheet, i);
real_x += tci->pixels;
ColRowInfo const * const tci = sheet_col_get_info (sheet, i);
int const tmp = tci->pixels;
if (tmp > 0)
real_x += tci->pixels;
}
/*
......@@ -459,12 +479,10 @@ item_grid_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int
end_col = cell->col->pos + count;
for (i = col+1; i < end_col; i++, col++) {
ColRowInfo *tci;
tci = sheet_col_get_info (
sheet, i);
x_paint += tci->pixels;
ColRowInfo const * const tci = sheet_col_get_info (sheet, i);
int const tmp = tci->pixels;
if (tmp > 0)
x_paint += tci->pixels;
}
} /* if cell */
}
......@@ -478,25 +496,23 @@ item_grid_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int
row = paint_row;
for (y_paint = -diff_y; y_paint < end_y && row < SHEET_MAX_ROWS; row++) {
ColRowInfo *ri, *ci;
ColRowInfo const * const ri = sheet_row_get_info (sheet, row);
if (ri->pixels <= 0)
continue;
ri = sheet_row_get_info (sheet, row);
col = paint_col;
for (x_paint = -diff_x;
x_paint < end_x && col < SHEET_MAX_COLS;
++col, x_paint += ci->pixels){
ci = sheet_col_get_info (sheet, col);
if (sheet->cursor_col == col && sheet->cursor_row == row)
continue;
if (!sheet_selection_is_cell_selected (sheet, col, row))
for (x_paint = -diff_x; x_paint < end_x && col < SHEET_MAX_COLS; ++col) {
ColRowInfo const * const ci = sheet_col_get_info (sheet, col);
if (ci->pixels <= 0)
continue;