Commit 4da5da9f authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

: (sheet_region_unmerge) : (sheet_region_merge) : implement.


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

	* src/sheet.c (sheet_region_is_merge_cell) :
	(sheet_region_get_merged) :
	(sheet_region_unmerge) :
	(sheet_region_merge) : implement.

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

	* src/item-grid.c (item_grid_draw_merged_range) : new function.
	  This may be clearer if we draw the grid lines after the background.
	  It does not support borders or selection yet.
	(item_grid_draw) : Use it.

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

	* src/cellspan.c (cell_is_empty) : new utility function.
	  span calculation is now rather inefficent.  We could be smarter if
	  we had a better representation of spans.  For now adding support for
	  merged cells here would be enough.
	(cell_calc_span) : Use it.

	* src/cell-draw.c (cell_draw) : decrease dependence on
	  Cell::{col,row})_info::size_pixels.  This is not accurate for merged
	  cells.  More work is needed.  I have not converted the multiline
	  formating yet.  The signature of this function sucks.
	  We should pass in either span or width height, not both.

	* src/print-cell.c (print_cell) : Stay consistent with cell_draw.
	  NOTE : I have not ported over the merged cell support.  It seems
	  pointless until it is working completely for drawing.

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

	* s/sheet_view/scg/

	* src/formats.c (currency_symbols) : Add the slovenian tolar.

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

	* src/sheet-control-gui.c (scg_context_menu) : renamed from
	  item_grid_popoup_menu and moved here where it makes more sense.
parent 8d7a4326
......@@ -8,12 +8,16 @@ Release Critical
- new wb_controls do not display
: selection string
- we leak merged regions on exit
Long term breakage
------------------
- Look into ability to identify versions of gnumeric xml that are newer than we
are. Ask DV about name spaces.
- Entering "=1e11111" yields "Syntax Error", not "overflow".
In general parsing needs better error messages.
- Why does the number matching bother comparing against formats that are
covered by 'General' ?
......
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_region_is_merge_cell) :
(sheet_region_get_merged) :
(sheet_region_unmerge) :
(sheet_region_merge) : implement.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (item_grid_draw_merged_range) : new function.
This may be clearer if we draw the grid lines after the background.
It does not support borders or selection yet.
(item_grid_draw) : Use it.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/cellspan.c (cell_is_empty) : new utility function.
span calculation is now rather inefficent. We could be smarter if
we had a better representation of spans. For now adding support for
merged cells here would be enough.
(cell_calc_span) : Use it.
* src/cell-draw.c (cell_draw) : decrease dependence on
Cell::{col,row})_info::size_pixels. This is not accurate for merged
cells. More work is needed. I have not converted the multiline
formating yet. The signature of this function sucks.
We should pass in either span or width height, not both.
* src/print-cell.c (print_cell) : Stay consistent with cell_draw.
NOTE : I have not ported over the merged cell support. It seems
pointless until it is working completely for drawing.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* s/sheet_view/scg/
* src/formats.c (currency_symbols) : Add the slovenian tolar.
2000-11-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control-gui.c (scg_context_menu) : renamed from
item_grid_popoup_menu and moved here where it makes more sense.
* src/sheet.c (sheet_merge_region) : implement.
(sheet_unnmerge_region) : Ditto.
(sheet_get_merged_regions) : Ditto.
2000-11-18 Jody Goldberg <jgoldberg@home.com>
* configure.in : Bump to 0.60 post release
......
Gnumeric 0.60
Jody:
* Initial work on supporting merged cells.
Jon Kåre:
* Improve XL export of non-builtin functions.
--------------------------------------------------------------------------
Gnumeric 0.59
......
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_region_is_merge_cell) :
(sheet_region_get_merged) :
(sheet_region_unmerge) :
(sheet_region_merge) : implement.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (item_grid_draw_merged_range) : new function.
This may be clearer if we draw the grid lines after the background.
It does not support borders or selection yet.
(item_grid_draw) : Use it.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/cellspan.c (cell_is_empty) : new utility function.
span calculation is now rather inefficent. We could be smarter if
we had a better representation of spans. For now adding support for
merged cells here would be enough.
(cell_calc_span) : Use it.
* src/cell-draw.c (cell_draw) : decrease dependence on
Cell::{col,row})_info::size_pixels. This is not accurate for merged
cells. More work is needed. I have not converted the multiline
formating yet. The signature of this function sucks.
We should pass in either span or width height, not both.
* src/print-cell.c (print_cell) : Stay consistent with cell_draw.
NOTE : I have not ported over the merged cell support. It seems
pointless until it is working completely for drawing.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* s/sheet_view/scg/
* src/formats.c (currency_symbols) : Add the slovenian tolar.
2000-11-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control-gui.c (scg_context_menu) : renamed from
item_grid_popoup_menu and moved here where it makes more sense.
* src/sheet.c (sheet_merge_region) : implement.
(sheet_unnmerge_region) : Ditto.
(sheet_get_merged_regions) : Ditto.
2000-11-18 Jody Goldberg <jgoldberg@home.com>
* configure.in : Bump to 0.60 post release
......
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_region_is_merge_cell) :
(sheet_region_get_merged) :
(sheet_region_unmerge) :
(sheet_region_merge) : implement.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (item_grid_draw_merged_range) : new function.
This may be clearer if we draw the grid lines after the background.
It does not support borders or selection yet.
(item_grid_draw) : Use it.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/cellspan.c (cell_is_empty) : new utility function.
span calculation is now rather inefficent. We could be smarter if
we had a better representation of spans. For now adding support for
merged cells here would be enough.
(cell_calc_span) : Use it.
* src/cell-draw.c (cell_draw) : decrease dependence on
Cell::{col,row})_info::size_pixels. This is not accurate for merged
cells. More work is needed. I have not converted the multiline
formating yet. The signature of this function sucks.
We should pass in either span or width height, not both.
* src/print-cell.c (print_cell) : Stay consistent with cell_draw.
NOTE : I have not ported over the merged cell support. It seems
pointless until it is working completely for drawing.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* s/sheet_view/scg/
* src/formats.c (currency_symbols) : Add the slovenian tolar.
2000-11-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control-gui.c (scg_context_menu) : renamed from
item_grid_popoup_menu and moved here where it makes more sense.
* src/sheet.c (sheet_merge_region) : implement.
(sheet_unnmerge_region) : Ditto.
(sheet_get_merged_regions) : Ditto.
2000-11-18 Jody Goldberg <jgoldberg@home.com>
* configure.in : Bump to 0.60 post release
......
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_region_is_merge_cell) :
(sheet_region_get_merged) :
(sheet_region_unmerge) :
(sheet_region_merge) : implement.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (item_grid_draw_merged_range) : new function.
This may be clearer if we draw the grid lines after the background.
It does not support borders or selection yet.
(item_grid_draw) : Use it.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/cellspan.c (cell_is_empty) : new utility function.
span calculation is now rather inefficent. We could be smarter if
we had a better representation of spans. For now adding support for
merged cells here would be enough.
(cell_calc_span) : Use it.
* src/cell-draw.c (cell_draw) : decrease dependence on
Cell::{col,row})_info::size_pixels. This is not accurate for merged
cells. More work is needed. I have not converted the multiline
formating yet. The signature of this function sucks.
We should pass in either span or width height, not both.
* src/print-cell.c (print_cell) : Stay consistent with cell_draw.
NOTE : I have not ported over the merged cell support. It seems
pointless until it is working completely for drawing.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* s/sheet_view/scg/
* src/formats.c (currency_symbols) : Add the slovenian tolar.
2000-11-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control-gui.c (scg_context_menu) : renamed from
item_grid_popoup_menu and moved here where it makes more sense.
* src/sheet.c (sheet_merge_region) : implement.
(sheet_unnmerge_region) : Ditto.
(sheet_get_merged_regions) : Ditto.
2000-11-18 Jody Goldberg <jgoldberg@home.com>
* configure.in : Bump to 0.60 post release
......
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_region_is_merge_cell) :
(sheet_region_get_merged) :
(sheet_region_unmerge) :
(sheet_region_merge) : implement.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (item_grid_draw_merged_range) : new function.
This may be clearer if we draw the grid lines after the background.
It does not support borders or selection yet.
(item_grid_draw) : Use it.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* src/cellspan.c (cell_is_empty) : new utility function.
span calculation is now rather inefficent. We could be smarter if
we had a better representation of spans. For now adding support for
merged cells here would be enough.
(cell_calc_span) : Use it.
* src/cell-draw.c (cell_draw) : decrease dependence on
Cell::{col,row})_info::size_pixels. This is not accurate for merged
cells. More work is needed. I have not converted the multiline
formating yet. The signature of this function sucks.
We should pass in either span or width height, not both.
* src/print-cell.c (print_cell) : Stay consistent with cell_draw.
NOTE : I have not ported over the merged cell support. It seems
pointless until it is working completely for drawing.
2000-11-19 Jody Goldberg <jgoldberg@home.com>
* s/sheet_view/scg/
* src/formats.c (currency_symbols) : Add the slovenian tolar.
2000-11-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control-gui.c (scg_context_menu) : renamed from
item_grid_popoup_menu and moved here where it makes more sense.
* src/sheet.c (sheet_merge_region) : implement.
(sheet_unnmerge_region) : Ditto.
(sheet_get_merged_regions) : Ditto.
2000-11-18 Jody Goldberg <jgoldberg@home.com>
* configure.in : Bump to 0.60 post release
......
......@@ -119,11 +119,11 @@ cell_comment_realize (Cell *cell)
sheet_cell_comment_link (cell);
for (l = cell->base.sheet->sheet_views; l; l = l->next){
SheetControlGUI *sheet_view = SHEET_CONTROL_GUI (l->data);
SheetControlGUI *scg = SHEET_CONTROL_GUI (l->data);
GnomeCanvasItem *o;
o = sheet_view_comment_create_marker (
sheet_view,
scg,
cell->pos.col, cell->pos.row);
gtk_object_ref (GTK_OBJECT (o));
......@@ -209,9 +209,9 @@ cell_comment_reposition (Cell *cell)
/* FIXME : This should use the sheet_view list */
for (l = cell->comment->realized_list; l; l = l->next){
GnomeCanvasItem *o = l->data;
SheetControlGUI *sheet_view = GNUMERIC_SHEET (o->canvas)->sheet_view;
SheetControlGUI *scg = GNUMERIC_SHEET (o->canvas)->scg;
sheet_view_comment_relocate (sheet_view, cell->pos.col, cell->pos.row, o);
sheet_view_comment_relocate (scg, cell->pos.col, cell->pos.row, o);
}
}
......
......@@ -140,7 +140,7 @@ cell_split_text (GdkFont *font, char const *text, int const width)
*/
void
cell_draw (Cell const *cell, MStyle *mstyle, CellSpanInfo const * const spaninfo,
GdkGC *gc, GdkDrawable *drawable, int x1, int y1)
GdkGC *gc, GdkDrawable *drawable, int x1, int y1, int width, int height)
{
StyleFont *style_font;
GdkFont *font;
......@@ -149,15 +149,12 @@ cell_draw (Cell const *cell, MStyle *mstyle, CellSpanInfo const * const spaninfo
Sheet const * const sheet = cell->base.sheet;
ColRowInfo const * const ci = cell->col_info;
ColRowInfo const * const ri = cell->row_info;
int start_col, end_col;
int width, height;
int text_base;
int font_height;
StyleHAlignFlags halign;
StyleVAlignFlags valign;
int num_lines = 0;
int line_offset[3]; /* There are up to 3 lines, double underlined strikethroughs */
gboolean is_single_line;
char const *text;
StyleColor *fore;
int cell_width_pixel;
......@@ -168,7 +165,9 @@ cell_draw (Cell const *cell, MStyle *mstyle, CellSpanInfo const * const spaninfo
* Don't print zeros if they should be ignored.
*/
if (sheet &&
(!sheet->display_formulas && !sheet->display_zero && cell_is_zero (cell)))
(!sheet->display_formulas &&
!sheet->display_zero &&
cell_is_zero (cell)))
return;
g_return_if_fail (cell->rendered_value);
......@@ -181,15 +180,11 @@ cell_draw (Cell const *cell, MStyle *mstyle, CellSpanInfo const * const spaninfo
} else
text = cell->rendered_value->rendered_text->str;
if (spaninfo != NULL) {
start_col = spaninfo->left;
end_col = spaninfo->right;
} else
start_col = end_col = cell->pos.col;
/* Get the sizes exclusive of margins and grids */
width = ci->size_pixels - (ci->margin_b + ci->margin_a + 1);
height = ri->size_pixels - (ri->margin_b + ri->margin_a + 1);
if (width < 0)
width = ci->size_pixels - (ci->margin_b + ci->margin_a + 1);
if (height < 0)
height = ri->size_pixels - (ri->margin_b + ri->margin_a + 1);
style_font = sheet_view_get_style_font (sheet, mstyle);
......@@ -197,6 +192,13 @@ cell_draw (Cell const *cell, MStyle *mstyle, CellSpanInfo const * const spaninfo
font_height = style_font_get_height (style_font);
valign = mstyle_get_align_v (mstyle);
/* This rectangle has the whole area used by this cell
* excluding the surrounding grid lines and margins */
rect.x = x1 + 1 + ci->margin_a;
rect.y = y1 + 1 + ri->margin_a;
rect.width = width;
rect.height = height;
switch (valign) {
default:
g_warning ("Unhandled cell vertical alignment\n");
......@@ -204,69 +206,50 @@ cell_draw (Cell const *cell, MStyle *mstyle, CellSpanInfo const * const spaninfo
case VALIGN_JUSTIFY:
case VALIGN_TOP:
/*
* y1 == top grid line.
* add top margin
* rect.y == first pixel past margin
* add font ascent
*/
text_base = y1 + font->ascent + ri->margin_a;
text_base = rect.y + font->ascent;
break;
case VALIGN_CENTER:
text_base = y1 + font->ascent + ri->margin_a +
text_base = rect.y + font->ascent +
(height - font_height) / 2;
break;
case VALIGN_BOTTOM:
/*
* y1 + ri->size_pixels == bottom grid line.
* subtract bottom margin
* rect.y == first pixel past margin
* add height == first pixel in lower margin
* subtract font descent
*/
text_base = y1 + ri->size_pixels - font->descent - ri->margin_b;
text_base = rect.y + height - font->descent;
break;
}
halign = cell_default_halign (cell, mstyle);
is_single_line = (halign != HALIGN_JUSTIFY &&
valign != VALIGN_JUSTIFY &&
!mstyle_get_fit_in_cell (mstyle));
/* This rectangle has the whole area used by this cell
* including the surrounding grid lines */
rect.x = x1;
rect.y = y1;
rect.width = ci->size_pixels + 1;
rect.height = ri->size_pixels + 1;
/*
* x1, y1 are relative to this cell origin, but the cell might be using
* columns to the left (if it is set to right justify or center justify)
* compute the pixel difference
* NOTE : If sheet is null than center across selection will not work
* currently this is only applicable to the preview-grid (preview-grid.c)
*/
if (sheet && start_col != cell->pos.col) {
int const offset =
sheet_col_get_distance_pixels (sheet,
start_col, cell->pos.col);
rect.x -= offset;
rect.width += offset;
}
if (sheet && end_col != cell->pos.col) {
int const offset =
sheet_col_get_distance_pixels (sheet,
cell->pos.col+1, end_col+1);
rect.width += offset;
if (spaninfo != NULL && sheet != NULL) {
/* x1, y1 are relative to this cell origin, but the cell
* might be using columns to the left (if it is set to right
* justify or center justify) compute the pixel difference
*
* NOTE : If sheet is null than center across selection will not
* work currently this is only applicable to the preview-grid
* (preview-grid.c)
*/
if (spaninfo->left != cell->pos.col) {
int offset = sheet_col_get_distance_pixels (sheet,
spaninfo->left, cell->pos.col);
rect.x -= offset;
rect.width += offset;
}
if (spaninfo->right != cell->pos.col)
rect.width += sheet_col_get_distance_pixels (sheet,
cell->pos.col+1, spaninfo->right+1);
}
/* Do not allow text to impinge upon the grid lines or margins
* FIXME : Should use margins from start_col and end_col
* FIXME : Should use margins from spaninfo->left and spaninfo->right
*/
rect.x += 1 + ci->margin_a;
rect.y += 1 + ri->margin_a;
rect.width -= 2 + ci->margin_a + ci->margin_b;
rect.height -= 2 + ri->margin_a + ri->margin_b;
gdk_gc_set_clip_rectangle (gc, &rect);
/* Set the font colour */
......@@ -298,14 +281,15 @@ cell_draw (Cell const *cell, MStyle *mstyle, CellSpanInfo const * const spaninfo
/* if a number overflows, do special drawing */
if (width < cell_width_pixel && cell_is_number (cell) &&
sheet && !sheet->display_formulas) {
draw_overflow (drawable, gc, font,
x1 + ci->margin_a + 1,
draw_overflow (drawable, gc, font, rect.x,
text_base, width, line_offset, num_lines);
style_font_unref (style_font);
return;
}
if (is_single_line) {
halign = cell_default_halign (cell, mstyle);
if (halign != HALIGN_JUSTIFY && valign != VALIGN_JUSTIFY &&
!mstyle_get_fit_in_cell (mstyle)) {
int total, len = cell_width_pixel;
switch (halign) {
......@@ -314,24 +298,21 @@ cell_draw (Cell const *cell, MStyle *mstyle, CellSpanInfo const * const spaninfo
/* fall through */
case HALIGN_LEFT:
x1 += 1 + ci->margin_a;
x1 = rect.x;
break;
case HALIGN_RIGHT:
x1 += ci->size_pixels - ci->margin_b - cell_width_pixel;
x1 = rect.x + rect.width - cell_width_pixel;
break;
case HALIGN_CENTER:
x1 += 1 + ci->margin_a + (width - cell_width_pixel) / 2;
break;
case HALIGN_CENTER_ACROSS_SELECTION:
x1 = rect.x + (rect.width - cell_width_pixel) / 2;
break;
default:
g_warning ("Single-line justification style not supported\n");
x1 += 1 + ci->margin_a;
x1 = rect.x;
}
total = 0;
......
......@@ -6,6 +6,6 @@
#include "cellspan.h"
void cell_draw (Cell const *cell, MStyle *mstyle, CellSpanInfo const * const spaninfo,
GdkGC *gc, GdkDrawable *drawable, int x, int y);
GdkGC *gc, GdkDrawable *drawable, int x, int y, int height, int width);
#endif /* GNUMERIC_CELL_DRAW_H */
......@@ -146,6 +146,33 @@ cell_contents_fit_inside_column (const Cell *cell)
return (tmp <= COL_INTERNAL_WIDTH (cell->col_info));
}
/**
* cell_is_empty :
*
* Utility to ensure that a cell is completly empty.
* - no spans
* - no merged regions
* - no content
*
* returns TRUE if the cell is empty.
*/
static inline gboolean
cell_is_empty (Cell const * cell, int col, ColRowInfo const *ri)
{
CellSpanInfo const *span = row_span_get (ri, col);
if (span != NULL && span->cell != cell)
return FALSE;
if (!cell_is_blank (sheet_cell_get (cell->base.sheet, col, ri->pos)))
return FALSE;
/* FIXME : ensure that there are no merged cells checking for the upper
* left is inexpensive, checking for impinging on other areas is not.
*/
return TRUE;
}
/*
* cell_calc_span:
* @cell: The cell we will examine
......@@ -162,19 +189,26 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
int row, pos, margin;
int cell_width_pixel;
MStyle *mstyle;
ColRowInfo const *ri;
g_return_if_fail (cell != NULL);
sheet = cell->base.sheet;
ri = cell->row_info;
/*
* If the cell is a number, or the text fits inside the column, or the
* alignment modes are set to "justify", then we report only one
* column is used.
* Report only one column is used if
* - cell is a number
* - Cell is the top left of a merged cell
* - the text fits inside column (for non center across selection)
* - the alignment mode are set to "justify"
*/
if (cell_is_number (cell) &&
sheet != NULL && !sheet->display_formulas) {
*col1 = *col2 = cell->pos.col;
return;
if (sheet != NULL) {
if (sheet_region_is_merge_cell (sheet, &cell->pos) ||
(!sheet->display_formulas && cell_is_number (cell))) {
*col1 = *col2 = cell->pos.col;
return;
}
}
mstyle = cell_get_mstyle (cell);
......@@ -206,9 +240,7 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
ColRowInfo *ci = sheet_col_get_info (sheet, pos);
if (ci->visible) {
Cell *sibling =sheet_cell_get (sheet, pos, row);
if (!cell_is_blank (sibling))
if (!cell_is_empty (cell, pos, ri))
return;
/* The space consumed is:
......@@ -233,9 +265,7 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
ColRowInfo *ci = sheet_col_get_info (sheet, pos);
if (ci->visible) {
Cell *sibling =sheet_cell_get (sheet, pos, row);
if (!cell_is_blank (sibling))
if (!cell_is_empty (cell, pos, ri))
return;
/* The space consumed is:
......@@ -251,62 +281,55 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
return;
case HALIGN_CENTER: {
int left_left, left_right;
int remain_left, remain_right;
int margin_a, margin_b;
*col1 = *col2 = cell->pos.col;
left = cell_width_pixel - COL_INTERNAL_WIDTH (cell->col_info);
left_left = left / 2 + (left % 2);
left_right = left / 2;
remain_left = left / 2 + (left % 2);
remain_right = left / 2;
margin_a = cell->col_info->margin_a;
margin_b = cell->col_info->margin_b;
for (; left_left > 0 || left_right > 0;){
for (; remain_left > 0 || remain_right > 0;){
ColRowInfo *ci;
Cell *left_sibling, *right_sibling;
if (*col1 - 1 >= 0){
ci = sheet_col_get_info (sheet, *col1 - 1);
if (ci->visible) {
left_sibling = sheet_cell_get (sheet, *col1 - 1, row);
if (!cell_is_blank (left_sibling))
left_left = 0;
else {
left_left -= COL_INTERNAL_WIDTH (ci) +
if (cell_is_empty (cell, *col1 - 1, ri)) {
remain_left -= COL_INTERNAL_WIDTH (ci) +
margin_a + ci->margin_b;
margin_a = ci->margin_a;
(*col1)--;
}
} else
remain_left = 0;
} else {
margin_a = ci->margin_a;
(*col1)--;
}
} else
left_left = 0;
remain_left = 0;
if (*col2 + 1 < SHEET_MAX_COLS-1){
ci = sheet_col_get_info (sheet, *col2 + 1);
if (ci->visible) {
right_sibling = sheet_cell_get (sheet, *col2 + 1, row);
if (!cell_is_blank (right_sibling))
left_right = 0;
else {
left_right -= COL_INTERNAL_WIDTH (ci) +
if (cell_is_empty (cell, *col2 + 1, ri)) {
remain_right -= COL_INTERNAL_WIDTH (ci) +
margin_b + ci->margin_a;
margin_b = ci->margin_b;
(*col2)++;
}
} else
remain_right = 0;
} else {
margin_b = ci->margin_b;
(*col2)++;
}
} else
left_right = 0;
remain_right = 0;
} /* for */
break;
......@@ -315,7 +338,6 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
case HALIGN_CENTER_ACROSS_SELECTION:
{
ColRowInfo const *ci;
ColRowInfo const *ri = cell->row_info;
int const row = ri->pos;
int left = cell->pos.col, right = left;
int tmp;
......@@ -326,8 +348,7 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
if (tmp >= 0) {
ci = sheet_col_get_info (sheet, tmp);
if (ci->visible) {
if (cell_is_blank (sheet_cell_get (sheet, tmp, row)) &&
NULL == row_span_get (ri, tmp)) {
if (cell_is_empty (cell, tmp, ri)) {
MStyle * const mstyle =
sheet_style_compute (cell->base.sheet, tmp, row);
gboolean const res =
......@@ -349,7 +370,7 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
if (tmp < SHEET_MAX_COLS) {
ci = sheet_col_get_info (sheet, tmp);
if (ci->visible) {
if (cell_is_blank (sheet_cell_get (sheet, tmp, row))) {
if (cell_is_empty (cell, tmp, ri)) {
MStyle * const mstyle =
sheet_style_compute (cell->base.sheet, tmp, row);
gboolean const res =
......
......@@ -351,6 +351,7 @@ CurrencySymbol const currency_symbols[] =
{N_("[$SEK]"), N_("Swedish krona") },
{N_("[$SGD]"), N_("Singapore dollar") },
{N_("[$SHP]"), N_("St.Helena pound") },
{N_("[$SIT]"), N_("Slovenia tolar") },
{N_("[$SLL]"), N_("Sierra Leone leone") },
{N_("[$SOS]"), N_("Somali shilling") },
{N_("[$SRG]"), N_("Suriname guilder") },
......
......@@ -44,7 +44,7 @@ gnumeric_sheet_destroy (GtkObject *object)
}
static GnumericSheet *
gnumeric_sheet_create (SheetControlGUI *sheet_view)
gnumeric_sheet_create (SheetControlGUI *scg)
{
GnumericSheet *gsheet;
GnomeCanvas *canvas;
......@@ -52,7 +52,7 @@ gnumeric_sheet_create (SheetControlGUI *sheet_view)
gsheet = gtk_type_new (gnumeric_sheet_get_type ());
canvas = GNOME_CANVAS (gsheet);
gsheet->sheet_view = sheet_view;
gsheet->scg = scg;