Commit a0702de1 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Allow pasting just formats.

2001-02-17  Jody Goldberg <jgoldberg@home.com>

	* src/clipboard.c (clipboard_paste_region) : Allow pasting just
	  formats.

	* src/commands.c (cmd_clear_undo) : reset the selection to queue a
	  redraw.
parent b699da7f
2001-02-17 Jody Goldberg <jgoldberg@home.com>
* src/commands.c (cmd_clear_undo) : reset the selection to queue a
redraw.
* src/cell-draw.c (cell_draw) : take the coords of the center of the
region directly, rather than the left offset.
......
2001-02-17 Jody Goldberg <jgoldberg@home.com>
* src/commands.c (cmd_clear_undo) : reset the selection to queue a
redraw.
* src/cell-draw.c (cell_draw) : take the coords of the center of the
region directly, rather than the left offset.
......
2001-02-17 Jody Goldberg <jgoldberg@home.com>
* src/commands.c (cmd_clear_undo) : reset the selection to queue a
redraw.
* src/cell-draw.c (cell_draw) : take the coords of the center of the
region directly, rather than the left offset.
......
2001-02-17 Jody Goldberg <jgoldberg@home.com>
* src/commands.c (cmd_clear_undo) : reset the selection to queue a
redraw.
* src/cell-draw.c (cell_draw) : take the coords of the center of the
region directly, rather than the left offset.
......
2001-02-17 Jody Goldberg <jgoldberg@home.com>
* src/commands.c (cmd_clear_undo) : reset the selection to queue a
redraw.
* src/cell-draw.c (cell_draw) : take the coords of the center of the
region directly, rather than the left offset.
......
......@@ -151,11 +151,11 @@ module GNOME {
void cell_set_alignment (in long col, in long row,
in long halign, in long valign,
in long orientation, in boolean auto_return)
in long orientation, in boolean wrap_text)
raises (OutOfRange);
void cell_get_alignment (in long col, in long row,
out long halign, out long valign,
out long orientation, out boolean auto_return)
out long orientation, out boolean wrap_text)
raises (OutOfRange);
//
......
......@@ -151,11 +151,11 @@ module GNOME {
void cell_set_alignment (in long col, in long row,
in long halign, in long valign,
in long orientation, in boolean auto_return)
in long orientation, in boolean wrap_text)
raises (OutOfRange);
void cell_get_alignment (in long col, in long row,
out long halign, out long valign,
out long orientation, out boolean auto_return)
out long orientation, out boolean wrap_text)
raises (OutOfRange);
//
......
......@@ -254,10 +254,13 @@ clipboard_paste_region (WorkbookControl *wbc,
int dst_rows = pt->range.end.row - pt->range.start.row + 1;
int src_cols = content->cols;
int src_rows = content->rows;
gboolean has_content;
g_return_val_if_fail (pt != NULL, TRUE);
g_return_val_if_fail ((pt->paste_flags & PASTE_CONTENT) !=
(pt->paste_flags & PASTE_AS_VALUES), TRUE);
has_content = pt->paste_flags & (PASTE_CONTENT|PASTE_AS_VALUES);
g_return_val_if_fail (has_content != (PASTE_CONTENT|PASTE_AS_VALUES), TRUE);
if (pt->paste_flags & PASTE_TRANSPOSE) {
int tmp = src_cols;
......@@ -300,7 +303,7 @@ clipboard_paste_region (WorkbookControl *wbc,
tmp = 0;
/* clear the region where we will paste */
if (pt->paste_flags & (PASTE_CONTENT | PASTE_AS_VALUES))
if (has_content)
tmp = CLEAR_VALUES | CLEAR_COMMENTS;
/* No need to clear the formats. We will paste over top of these. */
......@@ -319,7 +322,7 @@ clipboard_paste_region (WorkbookControl *wbc,
}
/* remove and merged regions in the target range */
{
if (has_content) {
GSList *merged, *ptr;
merged = sheet_merge_get_overlap (pt->sheet, &pt->range);
for (ptr = merged ; ptr != NULL ; ptr = ptr->next)
......@@ -361,7 +364,7 @@ clipboard_paste_region (WorkbookControl *wbc,
content->styles);
}
if (!(pt->paste_flags & PASTE_DONT_MERGE)) {
if (has_content && !(pt->paste_flags & PASTE_DONT_MERGE)) {
GSList *ptr;
for (ptr = content->merged; ptr != NULL ; ptr = ptr->next) {
Range tmp = *((Range const *)ptr->data);
......@@ -370,6 +373,9 @@ clipboard_paste_region (WorkbookControl *wbc,
}
}
if (!has_content)
continue;
for (l = content->list; l; l = l->next) {
CellCopy *c_copy = l->data;
int target_col = left;
......@@ -404,13 +410,14 @@ clipboard_paste_region (WorkbookControl *wbc,
}
}
if (pt->paste_flags & (PASTE_CONTENT | PASTE_AS_VALUES)) {
if (has_content) {
GList *deps = sheet_region_get_deps (pt->sheet, &pt->range);
if (deps)
dependent_queue_recalc_list (deps, TRUE);
sheet_range_calc_spans (pt->sheet, pt->range, SPANCALC_RENDER);
sheet_flag_status_update_range (pt->sheet, &pt->range);
}
} else
sheet_flag_format_update_range (pt->sheet, &pt->range);
if (pt->paste_flags & PASTE_UPDATE_ROW_HEIGHT)
rows_height_update (pt->sheet, &pt->range);
......
......@@ -1029,6 +1029,9 @@ cmd_clear_undo (GnumericCommand *cmd, WorkbookControl *wbc)
g_return_val_if_fail (me->selection != NULL, TRUE);
g_return_val_if_fail (me->old_content != NULL, TRUE);
/* reset the selection as a convenience AND to queue a redraw */
sheet_selection_reset (me->sheet);
for (ranges = me->selection; ranges != NULL ; ranges = ranges->next) {
Range const * const r = ranges->data;
PasteTarget pt;
......@@ -1042,6 +1045,10 @@ cmd_clear_undo (GnumericCommand *cmd, WorkbookControl *wbc)
c);
clipboard_release (c);
me->old_content = g_slist_remove (me->old_content, c);
sheet_selection_add_range (me->sheet,
r->start.col, r->start.row,
r->start.col, r->start.row,
r->end.col, r->end.row);
}
g_return_val_if_fail (me->old_content == NULL, TRUE);
......
......@@ -124,7 +124,7 @@ const char *mstyle_names[MSTYLE_ELEMENT_MAX] = {
"Align.h",
"Indent",
"Orientation",
"FitInCell"
"WrapText"
};
guint
......
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