Commit 1d26df50 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg
Browse files

Size the content if it has not yet been sized.


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

	* src/sheet.c (sheet_cell_calc_span) : Size the content if
	  it has not yet been sized.

	* src/commands.c (cmd_area_set_text_redo) : Do not queue the
	  resize, rerender, and respan until after the recalc.
parent 98cec9b6
2000-05-07 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_calc_span) : Size the content if
it has not yet been sized.
* src/commands.c (cmd_area_set_text_redo) : Do not queue the
resize, rerender, and respan until after the recalc.
2000-05-06 Jody Goldberg <jgoldberg@home.com>
* src/main.c (gnumeric_main) : Re-disable the style tests.
* src/cell.c (cell_set_expr_unsafe) : Split from cell_set_expr.
* src/eval.c (invalidate_refs) : Use cell_set_expr_unsafe.
......
2000-05-07 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_calc_span) : Size the content if
it has not yet been sized.
* src/commands.c (cmd_area_set_text_redo) : Do not queue the
resize, rerender, and respan until after the recalc.
2000-05-06 Jody Goldberg <jgoldberg@home.com>
* src/main.c (gnumeric_main) : Re-disable the style tests.
* src/cell.c (cell_set_expr_unsafe) : Split from cell_set_expr.
* src/eval.c (invalidate_refs) : Use cell_set_expr_unsafe.
......
2000-05-07 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_calc_span) : Size the content if
it has not yet been sized.
* src/commands.c (cmd_area_set_text_redo) : Do not queue the
resize, rerender, and respan until after the recalc.
2000-05-06 Jody Goldberg <jgoldberg@home.com>
* src/main.c (gnumeric_main) : Re-disable the style tests.
* src/cell.c (cell_set_expr_unsafe) : Split from cell_set_expr.
* src/eval.c (invalidate_refs) : Use cell_set_expr_unsafe.
......
2000-05-07 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_calc_span) : Size the content if
it has not yet been sized.
* src/commands.c (cmd_area_set_text_redo) : Do not queue the
resize, rerender, and respan until after the recalc.
2000-05-06 Jody Goldberg <jgoldberg@home.com>
* src/main.c (gnumeric_main) : Re-disable the style tests.
* src/cell.c (cell_set_expr_unsafe) : Split from cell_set_expr.
* src/eval.c (invalidate_refs) : Use cell_set_expr_unsafe.
......
2000-05-07 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_calc_span) : Size the content if
it has not yet been sized.
* src/commands.c (cmd_area_set_text_redo) : Do not queue the
resize, rerender, and respan until after the recalc.
2000-05-06 Jody Goldberg <jgoldberg@home.com>
* src/main.c (gnumeric_main) : Re-disable the style tests.
* src/cell.c (cell_set_expr_unsafe) : Split from cell_set_expr.
* src/eval.c (invalidate_refs) : Use cell_set_expr_unsafe.
......
2000-05-07 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_calc_span) : Size the content if
it has not yet been sized.
* src/commands.c (cmd_area_set_text_redo) : Do not queue the
resize, rerender, and respan until after the recalc.
2000-05-06 Jody Goldberg <jgoldberg@home.com>
* src/main.c (gnumeric_main) : Re-disable the style tests.
* src/cell.c (cell_set_expr_unsafe) : Split from cell_set_expr.
* src/eval.c (invalidate_refs) : Use cell_set_expr_unsafe.
......
2000-05-07 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_calc_span) : Size the content if
it has not yet been sized.
* src/commands.c (cmd_area_set_text_redo) : Do not queue the
resize, rerender, and respan until after the recalc.
2000-05-06 Jody Goldberg <jgoldberg@home.com>
* src/main.c (gnumeric_main) : Re-disable the style tests.
* src/cell.c (cell_set_expr_unsafe) : Split from cell_set_expr.
* src/eval.c (invalidate_refs) : Use cell_set_expr_unsafe.
......
......@@ -521,6 +521,19 @@ cmd_area_set_text_redo (GnumericCommand *cmd, CommandContext *context)
sheet_set_dirty (me->pos.sheet, TRUE);
workbook_recalc (me->pos.sheet->workbook);
/*
* Now that things have been filled in and recalculated we can generate
* the spans. Non expression cells need to be rendered.
* TODO : We could be smarter here. Only the left and
* right columns can span,
* so there is no need to check the middles.
*/
for (l = me->selection ; l != NULL ; l = l->next) {
Range const * const r = l->data;
sheet_range_calc_spans (me->pos.sheet, *r, SPANCALC_RENDER);
}
sheet_update (me->pos.sheet);
return FALSE;
......
......@@ -196,7 +196,7 @@ gnumeric_main (void *closure, int argc, char *argv [])
if (!opened_workbook) {
new_book = workbook_new_with_sheets (1);
#if 1
#if 0
workbook_style_test (new_book);
#endif
gtk_widget_show (new_book->toplevel);
......
......@@ -196,7 +196,7 @@ gnumeric_main (void *closure, int argc, char *argv [])
if (!opened_workbook) {
new_book = workbook_new_with_sheets (1);
#if 1
#if 0
workbook_style_test (new_book);
#endif
gtk_widget_show (new_book->toplevel);
......
......@@ -364,16 +364,24 @@ sheet_cell_calc_span (Cell const *cell, SpanCalcFlags const flags)
CellSpanInfo const * span;
int left, right;
int other_left, other_right;
gboolean full;
gboolean render = (flags & SPANCALC_RE_RENDER);
gboolean resize = (flags & SPANCALC_RESIZE);
g_return_if_fail (cell != NULL);
full = (flags & SPANCALC_RENDER) && cell->rendered_value == NULL;
if (flags & SPANCALC_RENDER) {
RenderedValue const *rv = cell->rendered_value;
if (rv == NULL) {
render = TRUE;
resize = TRUE;
} else if (rv->width_pixel == 0 && rv->width_pixel == 0)
resize = TRUE;
}
if (full || (flags & SPANCALC_RE_RENDER))
if (render)
cell_render_value ((Cell *)cell);
if (full || (flags & SPANCALC_RESIZE))
if (resize)
rendered_value_calc_size (cell);
/* Calculate the span of the cell */
......@@ -1091,11 +1099,16 @@ cb_set_cell_content (Sheet *sheet, int col, int row, Cell *cell,
/**
* sheet_range_set_text :
*
* @pos : The position from which to parse an expression.
* @r : The range to fill
* @str : The text to be parsed and assigned.
*
* Does NOT check for array division.
* Does NOT redraw
* Does NOT generate spans.
*/
void
sheet_range_set_text (EvalPos const * const pos,
Range const *r, char const *str)
sheet_range_set_text (EvalPos const *pos, Range const *r, char const *str)
{
closure_set_cell_value closure;
......
......@@ -332,11 +332,10 @@ void sheet_destroy_cell_select_cursor (Sheet *sheet);
* redraws and rendering as required. Does NOT check for
* division of arrays.
*/
void sheet_cell_set_expr (Cell *cell, ExprTree *expr);
void sheet_cell_set_value (Cell *cell, Value *v, char const *optional_format);
void sheet_cell_set_text (Cell *cell, char const *str);
void sheet_range_set_text (EvalPos const * const pos,
Range const *r, char const *string);
void sheet_cell_set_expr (Cell *cell, ExprTree *expr);
void sheet_cell_set_value (Cell *cell, Value *v, char const *optional_format);
void sheet_cell_set_text (Cell *cell, char const *str);
void sheet_range_set_text (EvalPos const *pos, Range const *r, char const *str);
typedef enum {
SPANCALC_SIMPLE = 0x0, /* Just calc spans */
......
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