Commit 88b2f76c authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

only print warning once. (cmd_clear_undo) : There is no undo for pasting


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

	* src/commands.c (cmd_clear_selection) : only print warning once.
	(cmd_clear_undo) : There is no undo for pasting comments.
	(cmd_paste_copy) : doh! We can not print the name of the target range,
	  it is out of bounds!
	(cmd_paste_cut) : ditto.
parent d92daca1
......@@ -2,6 +2,9 @@
* src/commands.c (cmd_clear_selection) : only print warning once.
(cmd_clear_undo) : There is no undo for pasting comments.
(cmd_paste_copy) : doh! We can not print the name of the target range,
it is out of bounds!
(cmd_paste_cut) : ditto.
* src/item-grid.c (item_grid_draw) : If everything is hidden we can
get into odd states.
......
......@@ -2,6 +2,9 @@
* src/commands.c (cmd_clear_selection) : only print warning once.
(cmd_clear_undo) : There is no undo for pasting comments.
(cmd_paste_copy) : doh! We can not print the name of the target range,
it is out of bounds!
(cmd_paste_cut) : ditto.
* src/item-grid.c (item_grid_draw) : If everything is hidden we can
get into odd states.
......
......@@ -2,6 +2,9 @@
* src/commands.c (cmd_clear_selection) : only print warning once.
(cmd_clear_undo) : There is no undo for pasting comments.
(cmd_paste_copy) : doh! We can not print the name of the target range,
it is out of bounds!
(cmd_paste_cut) : ditto.
* src/item-grid.c (item_grid_draw) : If everything is hidden we can
get into odd states.
......
......@@ -2,6 +2,9 @@
* src/commands.c (cmd_clear_selection) : only print warning once.
(cmd_clear_undo) : There is no undo for pasting comments.
(cmd_paste_copy) : doh! We can not print the name of the target range,
it is out of bounds!
(cmd_paste_cut) : ditto.
* src/item-grid.c (item_grid_draw) : If everything is hidden we can
get into odd states.
......
......@@ -2,6 +2,9 @@
* src/commands.c (cmd_clear_selection) : only print warning once.
(cmd_clear_undo) : There is no undo for pasting comments.
(cmd_paste_copy) : doh! We can not print the name of the target range,
it is out of bounds!
(cmd_paste_cut) : ditto.
* src/item-grid.c (item_grid_draw) : If everything is hidden we can
get into odd states.
......
......@@ -2356,11 +2356,9 @@ cmd_paste_cut (WorkbookControl *wbc, ExprRelocateInfo const *info,
r = info->origin;
if (range_translate (&r, info->col_offset, info->row_offset)) {
char *msg = g_strdup_printf (_("to %s is beyond the sheet boundaries"),
range_name (&r));
gnumeric_error_invalid (COMMAND_CONTEXT (wbc), descriptor, msg);
g_free (msg);
gnumeric_error_invalid (COMMAND_CONTEXT (wbc), descriptor,
_("is beyond sheet boundaries"));
g_free (descriptor);
return TRUE;
}
......@@ -2505,6 +2503,10 @@ cmd_paste_copy (WorkbookControl *wbc,
me = CMD_PASTE_COPY (obj);
/* Store the specs for the object */
me->parent.sheet = pt->sheet;
me->parent.size = 1; /* FIXME? */
me->parent.cmd_descriptor = g_strdup_printf (_("Pasting into %s"),
range_name (&pt->range));
me->dst = *pt;
me->content = content;
me->has_been_through_cycle = FALSE;
......@@ -2528,10 +2530,14 @@ cmd_paste_copy (WorkbookControl *wbc,
}
}
me->parent.sheet = pt->sheet;
me->parent.size = 1; /* FIXME? */
me->parent.cmd_descriptor = g_strdup_printf (_("Pasting into %s"),
range_name (&pt->range));
/* Use translate to do a quiet sanity check */
if (range_translate (&me->dst.range, 0, 0)) {
gnumeric_error_invalid (COMMAND_CONTEXT (wbc),
me->parent.cmd_descriptor,
_("is beyond sheet boundaries"));
gtk_object_destroy (GTK_OBJECT (me));
return TRUE;
}
/* Register the command object */
return command_push_undo (wbc, obj);
......
......@@ -1142,8 +1142,6 @@ range_is_sane (Range const *range)
return TRUE;
}
gboolean
range_is_sane (Range const *range);
/**
* range_transpose:
* @range: The range.
......@@ -1214,48 +1212,3 @@ range_transpose (Range *range, CellPos const *origin)
return clipped;
}
/**
* range_expand:
* @range: the range to expand
* @d_tlx: top left column delta
* @d_tly: top left row delta
* @d_brx: bottom right column delta
* @d_bry: bottom right row delta
*
* Attempts to expand a ranges area
*
* Return value: TRUE if we can expand, FALSE if not enough room.
**/
gboolean
range_expand (Range *range, int d_tlx, int d_tly, int d_brx, int d_bry)
{
int t;
t = range->start.col + d_tlx;
if (t < 0 ||
t >= SHEET_MAX_COLS)
return FALSE;
range->start.col = t;
t = range->start.row + d_tly;
if (t < 0 ||
t >= SHEET_MAX_ROWS)
return FALSE;
range->start.row = t;
t = range->end.col + d_brx;
if (t < 0 ||
t >= SHEET_MAX_COLS)
return FALSE;
range->end.col = t;
t = range->end.row + d_bry;
if (t < 0 ||
t >= SHEET_MAX_ROWS)
return FALSE;
range->end.row = t;
return TRUE;
}
......@@ -97,9 +97,6 @@ void range_ensure_sanity (Range *range);
gboolean range_is_sane (Range const *range);
gboolean range_translate (Range *range, int col_offset, int row_offset);
gboolean range_transpose (Range *range, CellPos const *origin);
gboolean range_expand (Range *range,
int d_tlx, int d_tly,
int d_brx, int d_bry);
gboolean range_has_header (Sheet const *sheet, Range const *src,
gboolean top);
......
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