Commit 0426031a authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Merged Cells are now complete.

Please beat the crap out of them

2001-01-25  Jody Goldberg <jgoldberg@home.com>

	* src/cmd-edit.c (cmd_paste_to_selection) : allow merged regions

	* src/clipboard.c (clipboard_paste_region) : Optionally paste merged
	  regions too.

	* src/style-border.c (style_border_fetch) : add margins.
parent 10efe742
......@@ -5,19 +5,18 @@ and longer term bugs.
Release Critical
----------------
- Autoformat - border warnings
- Styles
- uniform_get
- test persistance
- more tuning
- Merged Cells
- copy/paste (cut works)
- fix undo ins/del row/col to restore lost merged regions
- Fix Borders
- border style double_line does not handle all of the different
intersection cases.
- diagonals
* intersection cases
* border style double_line does not handle all of the different
intersection cases.
Long term breakage
------------------
......
2001-01-25 Jody Goldberg <jgoldberg@home.com>
* src/cmd-edit.c (cmd_paste_to_selection) : allow merged regions
* src/clipboard.c (clipboard_paste_region) : Optionally paste merged
regions too.
* src/style-border.c (style_border_fetch) : add margins.
2001-01-24 Morten Welinder <terra@diku.dk>
* src/commands.c (cmd_search_replace_update_after_action): New
......
2001-01-25 Jody Goldberg <jgoldberg@home.com>
* src/cmd-edit.c (cmd_paste_to_selection) : allow merged regions
* src/clipboard.c (clipboard_paste_region) : Optionally paste merged
regions too.
* src/style-border.c (style_border_fetch) : add margins.
2001-01-24 Morten Welinder <terra@diku.dk>
* src/commands.c (cmd_search_replace_update_after_action): New
......
2001-01-25 Jody Goldberg <jgoldberg@home.com>
* src/cmd-edit.c (cmd_paste_to_selection) : allow merged regions
* src/clipboard.c (clipboard_paste_region) : Optionally paste merged
regions too.
* src/style-border.c (style_border_fetch) : add margins.
2001-01-24 Morten Welinder <terra@diku.dk>
* src/commands.c (cmd_search_replace_update_after_action): New
......
2001-01-25 Jody Goldberg <jgoldberg@home.com>
* src/cmd-edit.c (cmd_paste_to_selection) : allow merged regions
* src/clipboard.c (clipboard_paste_region) : Optionally paste merged
regions too.
* src/style-border.c (style_border_fetch) : add margins.
2001-01-24 Morten Welinder <terra@diku.dk>
* src/commands.c (cmd_search_replace_update_after_action): New
......
2001-01-25 Jody Goldberg <jgoldberg@home.com>
* src/cmd-edit.c (cmd_paste_to_selection) : allow merged regions
* src/clipboard.c (clipboard_paste_region) : Optionally paste merged
regions too.
* src/style-border.c (style_border_fetch) : add margins.
2001-01-24 Morten Welinder <terra@diku.dk>
* src/commands.c (cmd_search_replace_update_after_action): New
......
......@@ -318,6 +318,14 @@ clipboard_paste_region (WorkbookControl *wbc,
tmp);
}
/* remove and merged regions in the target range */
{
GSList *merged, *ptr;
merged = sheet_merge_get_overlap (pt->sheet, &pt->range);
for (ptr = merged ; ptr != NULL ; ptr = ptr->next)
sheet_merge_remove (wbc, pt->sheet, ptr->data);
}
for (tmp = repeat_vertical; repeat_horizontal-- > 0 ; repeat_vertical = tmp)
while (repeat_vertical-- > 0) {
int const left = repeat_horizontal * src_cols + pt->range.start.col;
......@@ -345,17 +353,23 @@ clipboard_paste_region (WorkbookControl *wbc,
/* Move the styles on here so we get correct formats before recalc */
if (pt->paste_flags & PASTE_FORMATS) {
Range boundary = pt->range;
boundary.start.col = left;
boundary.start.row = top;
boundary.end.col = left + src_cols - 1;
boundary.end.row = top + src_rows - 1;
sheet_style_set_list (pt->sheet, &boundary.start,
CellPos pos;
pos.col = left;
pos.row = top;
sheet_style_set_list (pt->sheet, &pos,
(pt->paste_flags & PASTE_TRANSPOSE),
content->styles);
}
if (!(pt->paste_flags & PASTE_DONT_MERGE)) {
GSList *ptr;
for (ptr = content->merged; ptr != NULL ; ptr = ptr->next) {
Range tmp = *((Range const *)ptr->data);
if (!range_translate (&tmp, left, top))
sheet_merge_add (wbc, pt->sheet, &tmp, TRUE);
}
}
for (l = content->list; l; l = l->next) {
CellCopy *c_copy = l->data;
int target_col = left;
......@@ -459,8 +473,11 @@ clipboard_copy_range (Sheet *sheet, Range const *r)
c->merged = NULL;
merged = sheet_merge_get_overlap (sheet, r);
for (ptr = merged ; ptr != NULL ; ptr = ptr->next)
c->merged = g_slist_prepend (c->merged, range_copy (ptr->data));
for (ptr = merged ; ptr != NULL ; ptr = ptr->next) {
Range *tmp = range_copy (ptr->data);
range_translate (tmp, -r->start.col, -r->start.row);
c->merged = g_slist_prepend (c->merged, tmp);
}
g_slist_free (merged);
return c;
......
......@@ -22,7 +22,10 @@ enum {
/* If copying a range that includes blank cells, this
prevents pasting blank cells over existing data */
PASTE_SKIP_BLANKS = 1 << 11
PASTE_SKIP_BLANKS = 1 << 11,
/* Do not paste merged regions (probably not needed) */
PASTE_DONT_MERGE = 1 << 12
};
#define PASTE_ALL_TYPES (PASTE_CONTENT | PASTE_FORMATS)
......
......@@ -353,7 +353,7 @@ cmd_paste_to_selection (WorkbookControl *wbc, Sheet *dest_sheet, int paste_flags
Range const *dest_range;
PasteTarget pt;
if (!selection_is_simple (wbc, dest_sheet, _("Paste"), FALSE, FALSE))
if (!selection_is_simple (wbc, dest_sheet, _("Paste"), TRUE, FALSE))
return;
dest_range = selection_first_range (dest_sheet, FALSE);
......
......@@ -129,6 +129,7 @@ style_border_none (void)
none = g_new0 (StyleBorder, 1);
none->line_type = STYLE_BORDER_NONE;
none->color = style_color_new (0,0,0);
none->begin_margin = none->end_margin = 0;
none->ref_count = 1;
}
......@@ -180,6 +181,8 @@ style_border_fetch (StyleBorderType const line_type,
g_hash_table_insert (border_hash, border, border);
border->ref_count = 1;
border->gc = NULL;
border->begin_margin = style_border_get_width (line_type) > 1 ? 1 : 0;
border->end_margin = style_border_get_width (line_type) > 2 ? 1 : 0;
return border;
}
......
......@@ -52,6 +52,7 @@ struct _StyleBorder {
/* Key elements */
StyleBorderType line_type;
StyleColor *color;
int begin_margin, end_margin;
/* Private */
GdkGC *gc;
......
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