Commit 6f6a117b authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

- Fix lack of array merge test for paste_copy

- Fix range checking for expr range fill

2001-05-15  Jody Goldberg <jgoldberg@home.com>

	* src/sheet.c (sheet_stop_range_selection) : delete.

	* src/commands.c (cmd_paste_copy) : call splits_region to check for
	  partial arrays and merged regions.

	* src/sheet.c (cb_set_cell_content) : Use the bounding box.
	(sheet_range_set_text) : set the bounding box.
parent a4a97170
2001-05-15 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_stop_range_selection) : delete.
* src/commands.c (cmd_paste_copy) : call splits_region to check for
partial arrays and merged regions.
* src/sheet.c (cb_set_cell_content) : Use the bounding box.
(sheet_range_set_text) : set the bounding box.
2001-05-15 Jon K Hellan <hellan@acm.org>
* src/workbook-control.h: Define menu state enums for print setup,
......
2001-05-15 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_stop_range_selection) : delete.
* src/commands.c (cmd_paste_copy) : call splits_region to check for
partial arrays and merged regions.
* src/sheet.c (cb_set_cell_content) : Use the bounding box.
(sheet_range_set_text) : set the bounding box.
2001-05-15 Jon K Hellan <hellan@acm.org>
* src/workbook-control.h: Define menu state enums for print setup,
......
2001-05-15 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_stop_range_selection) : delete.
* src/commands.c (cmd_paste_copy) : call splits_region to check for
partial arrays and merged regions.
* src/sheet.c (cb_set_cell_content) : Use the bounding box.
(sheet_range_set_text) : set the bounding box.
2001-05-15 Jon K Hellan <hellan@acm.org>
* src/workbook-control.h: Define menu state enums for print setup,
......
2001-05-15 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_stop_range_selection) : delete.
* src/commands.c (cmd_paste_copy) : call splits_region to check for
partial arrays and merged regions.
* src/sheet.c (cb_set_cell_content) : Use the bounding box.
(sheet_range_set_text) : set the bounding box.
2001-05-15 Jon K Hellan <hellan@acm.org>
* src/workbook-control.h: Define menu state enums for print setup,
......
2001-05-15 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_stop_range_selection) : delete.
* src/commands.c (cmd_paste_copy) : call splits_region to check for
partial arrays and merged regions.
* src/sheet.c (cb_set_cell_content) : Use the bounding box.
(sheet_range_set_text) : set the bounding box.
2001-05-15 Jon K Hellan <hellan@acm.org>
* src/workbook-control.h: Define menu state enums for print setup,
......
......@@ -2562,6 +2562,13 @@ cmd_paste_copy (WorkbookControl *wbc,
return TRUE;
}
/* Check array subdivision & merged regions */
if (sheet_range_splits_region (pt->sheet, &me->dst.range,
NULL, wbc, me->parent.cmd_descriptor)) {
gtk_object_destroy (GTK_OBJECT (me));
return TRUE;
}
/* Register the command object */
return command_push_undo (wbc, obj);
}
......
......@@ -1247,17 +1247,36 @@ typedef struct {
StyleFormat *format;
Value *val;
ExprTree *expr;
Range expr_bound;
} closure_set_cell_value;
static Value *
cb_set_cell_content (Sheet *sheet, int col, int row, Cell *cell,
closure_set_cell_value *info)
{
ExprTree *expr = info->expr;
if (cell == NULL)
cell = sheet_cell_new (sheet, col, row);
if (info->expr != NULL)
cell_set_expr (cell, info->expr, info->format);
else
if (expr != NULL) {
if (!range_contains (&info->expr_bound, col, row)) {
ExprRewriteInfo rwinfo;
rwinfo.type = EXPR_REWRITE_RELOCATE;
rwinfo.u.relocate.pos.eval.col =
rwinfo.u.relocate.origin.start.col =
rwinfo.u.relocate.origin.end.col = col;
rwinfo.u.relocate.pos.eval.row =
rwinfo.u.relocate.origin.start.row =
rwinfo.u.relocate.origin.end.row = row;
rwinfo.u.relocate.pos.sheet =
rwinfo.u.relocate.origin_sheet =
rwinfo.u.relocate.target_sheet = sheet;
rwinfo.u.relocate.col_offset =
rwinfo.u.relocate.row_offset = 0;
expr = expr_rewrite (expr, &rwinfo);
}
cell_set_expr (cell, expr, info->format);
} else
cell_set_value (cell, value_duplicate (info->val),
info->format);
return NULL;
......@@ -1297,6 +1316,10 @@ sheet_range_set_text (EvalPos const *pos, Range const *r, char const *str)
&closure.val, &closure.expr,
NULL /* TODO : Use edit_pos format ?? */);
if (NULL != closure.expr)
expr_tree_boundingbox (closure.expr,
range_init_full_sheet (&closure.expr_bound));
/* Store the parsed result creating any cells necessary */
sheet_foreach_cell_in_range (pos->sheet, FALSE,
r->start.col, r->start.row,
......@@ -3941,15 +3964,6 @@ sheet_row_set_default_size_pixels (Sheet *sheet, int height_pixels)
/****************************************************************************/
void
sheet_stop_range_selection (Sheet *sheet, gboolean clear_string)
{
g_return_if_fail (IS_SHEET (sheet));
SHEET_FOREACH_CONTROL (sheet, control,
scg_rangesel_stop (control, clear_string););
}
void
sheet_scrollbar_config (Sheet const *sheet)
{
......
......@@ -255,9 +255,6 @@ void sheet_move_range (WorkbookControl *context,
char *sheet_name_quote (char const *unquoted_name);
Sheet *sheet_lookup_by_name (Workbook *wb, char const *name);
/* Utilities for various flavours of cursor */
void sheet_stop_range_selection (Sheet *sheet, gboolean clear_string);
/*
* Utilities to set cell contents, queueing recalcs,
* redraws and rendering as required. Does NOT check for
......
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