Commit 7df72906 authored by Andreas J. Guelzow's avatar Andreas J. Guelzow Committed by Andreas J. Guelzow

delete again (unnecessary after Jody's fix of the root problem) preserve

2002-03-14  Andreas J. Guelzow <aguelzow@taliesin.ca>

	* src/sheet-object-widget.[ch] (sheet_widget_checkbox_switch_link_sheet) :
	  delete again (unnecessary after Jody's fix of the root problem)
	* src/colrow.c (colrow_set_states) : preserve the
	  ColRowStateList, it possibly should also be applied to other sheets
	* src/sheet.c : delete the ColRowStateList after colrow_set_states
	* src/commands.c : delete the ColRowStateList after colrow_set_states
	(cmd_merge_data_redo) : preserve column and row widths, etc.
parent b6d1a69f
2002-03-14 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/sheet-object-widget.[ch] (sheet_widget_checkbox_switch_link_sheet) :
delete again (unnecessary after Jody's fix of the root problem)
* src/colrow.c (colrow_set_states) : preserve the
ColRowStateList, it possibly should also be applied to other sheets
* src/sheet.c : delete the ColRowStateList after colrow_set_states
* src/commands.c : delete the ColRowStateList after colrow_set_states
(cmd_merge_data_redo) : preserve column and row widths, etc.
2002-03-13 Jody Goldberg <jody@gnome.org>
* src/sheet-object-widget.c (sheet_widget_scrollbar_get_ref) : Add a
......
2002-03-14 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/sheet-object-widget.[ch] (sheet_widget_checkbox_switch_link_sheet) :
delete again (unnecessary after Jody's fix of the root problem)
* src/colrow.c (colrow_set_states) : preserve the
ColRowStateList, it possibly should also be applied to other sheets
* src/sheet.c : delete the ColRowStateList after colrow_set_states
* src/commands.c : delete the ColRowStateList after colrow_set_states
(cmd_merge_data_redo) : preserve column and row widths, etc.
2002-03-13 Jody Goldberg <jody@gnome.org>
* src/sheet-object-widget.c (sheet_widget_scrollbar_get_ref) : Add a
......
2002-03-14 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/sheet-object-widget.[ch] (sheet_widget_checkbox_switch_link_sheet) :
delete again (unnecessary after Jody's fix of the root problem)
* src/colrow.c (colrow_set_states) : preserve the
ColRowStateList, it possibly should also be applied to other sheets
* src/sheet.c : delete the ColRowStateList after colrow_set_states
* src/commands.c : delete the ColRowStateList after colrow_set_states
(cmd_merge_data_redo) : preserve column and row widths, etc.
2002-03-13 Jody Goldberg <jody@gnome.org>
* src/sheet-object-widget.c (sheet_widget_scrollbar_get_ref) : Add a
......
......@@ -452,7 +452,11 @@ colrow_set_sizes (Sheet *sheet, gboolean is_cols,
/*
* NOTE : this is a low level routine it does not redraw or
* reposition objects
*
* NOTE : this does not delete states any longer since it may be used
* for several sheets.
*/
void
colrow_set_states (Sheet *sheet, gboolean is_cols,
int first, ColRowStateList *states)
......@@ -496,8 +500,6 @@ colrow_set_states (Sheet *sheet, gboolean is_cols,
offset += rles->length;
}
colrow_state_list_destroy (states);
/* Notify sheet of pending update */
sheet->priv->recompute_visibility = TRUE;
if (is_cols) {
......@@ -540,6 +542,7 @@ colrow_restore_state_group (Sheet *sheet, gboolean is_cols,
}
colrow_set_states (sheet, is_cols, index->first, ptr->data);
colrow_state_list_destroy (ptr->data);
selection = selection->prev;
}
......
......@@ -2119,6 +2119,7 @@ cmd_paste_cut_undo (GnumericCommand *cmd, WorkbookControl *wbc)
/* Restore the original row heights */
colrow_set_states (me->info.target_sheet, FALSE,
reverse.origin.start.row, me->saved_sizes);
colrow_state_list_destroy (me->saved_sizes);
me->saved_sizes = NULL;
/* Restore the changed expressions */
......@@ -2345,6 +2346,7 @@ cmd_paste_copy_impl (GnumericCommand *cmd, WorkbookControl *wbc,
if (is_undo) {
colrow_set_states (me->dst.sheet, FALSE,
me->dst.range.start.row, me->saved_sizes);
colrow_state_list_destroy (me->saved_sizes);
me->saved_sizes = NULL;
} else {
me->saved_sizes = colrow_get_states (me->dst.sheet,
......@@ -4441,15 +4443,24 @@ cmd_merge_data_redo (GnumericCommand *cmd, WorkbookControl *wbc)
CmdMergeData *me = CMD_MERGE_DATA (cmd);
int i;
CellRegion *merge_content;
Range merge_range;
RangeRef *cell = &me->merge_zone->v_range.cell;
PasteTarget pt;
GSList *this_field = me->merge_fields;
GSList *this_data = me->merge_data;
Sheet *source_sheet = cell->a.sheet;
GSList *target_sheet;
Range target_range;
Range source_range;
ColRowStateList *state_col;
ColRowStateList *state_row;
range_init (&merge_range, cell->a.col, cell->a.row,
range_init (&target_range, cell->a.col, cell->a.row,
cell->b.col, cell->b.row);
merge_content = clipboard_copy_range (cell->a.sheet, &merge_range);
merge_content = clipboard_copy_range (source_sheet, &target_range);
state_col = colrow_get_states (source_sheet, TRUE, target_range.start.col,
target_range.end.col);
state_row = colrow_get_states (source_sheet, FALSE, target_range.start.row,
target_range.end.row);
for (i = 0; i < me->n; i++) {
Sheet *new_sheet;
......@@ -4458,27 +4469,23 @@ cmd_merge_data_redo (GnumericCommand *cmd, WorkbookControl *wbc)
new_sheet = workbook_sheet_add (me->sheet->workbook, NULL, FALSE);
me->sheet_list = g_slist_prepend (me->sheet_list, new_sheet);
sheet_object_clone_sheet_in_range (cell->a.sheet, new_sheet, &merge_range);
check_boxes = sheet_objects_get (new_sheet, &merge_range,
colrow_set_states (new_sheet, TRUE, target_range.start.col, state_col);
colrow_set_states (new_sheet, FALSE, target_range.start.row, state_row);
sheet_object_clone_sheet_in_range (source_sheet, new_sheet, &target_range);
check_boxes = sheet_objects_get (new_sheet, &target_range,
sheet_widget_checkbox_get_type ());
a_box = check_boxes;
while (a_box) {
sheet_widget_checkbox_switch_link_sheet (SHEET_OBJECT (a_box->data),
cell->a.sheet, new_sheet);
a_box = a_box->next;
}
g_slist_free (check_boxes);
clipboard_paste_region (me->wbc, paste_target_init (&pt, new_sheet,
&merge_range, PASTE_ALL_TYPES),
&target_range, PASTE_ALL_TYPES),
merge_content);
}
me->sheet_list = g_slist_reverse (me->sheet_list);
colrow_state_list_destroy (state_col);
colrow_state_list_destroy (state_row);
while (this_field) {
Range target_range;
Range source_range;
Sheet *source_sheet;
GSList *target_sheet;
g_return_val_if_fail (this_data != NULL, TRUE);
cell = &((Value *)this_field->data)->v_range.cell;
......
......@@ -1333,30 +1333,6 @@ sheet_widget_checkbox_set_link (SheetObject *so, ExprTree *expr)
dependent_set_expr (&swc->dep, expr);
}
gboolean
sheet_widget_checkbox_switch_link_sheet (SheetObject *so, Sheet *old_sheet, Sheet *new_sheet)
{
SheetWidgetCheckbox *swc = SHEET_WIDGET_CHECKBOX (so);
if (swc->dep.expression != NULL) {
Value *val = expr_tree_get_range (swc->dep.expression);
if (val) {
ExprTree *expr;
RangeRef *cell = &val->v_range.cell;
if (cell->a.sheet == old_sheet)
cell->a.sheet = new_sheet;
if (cell->b.sheet == old_sheet)
cell->b.sheet = new_sheet;
expr = expr_tree_new_constant (val);
sheet_widget_checkbox_set_link (so, expr);
return TRUE;
}
}
return FALSE;
}
SOW_MAKE_TYPE (checkbox, Checkbox,
&sheet_widget_checkbox_user_config,
&sheet_widget_checkbox_set_sheet,
......
......@@ -21,6 +21,4 @@ void sheet_widget_scrollbar_set_details (SheetObject *so, ExprTree *link,
int value, int min, int max, int inc, int page);
void sheet_widget_checkbox_set_link (SheetObject *so, ExprTree *expr);
gboolean sheet_widget_checkbox_switch_link_sheet (SheetObject *so, Sheet *old_sheet, Sheet *new_sheet);
#endif /* GNUMERIC_SHEET_OBJECT_WIDGET_H */
......@@ -3387,6 +3387,7 @@ sheet_colrow_insdel_finish (ExprRelocateInfo const *rinfo, gboolean is_cols,
else
sheet->priv->reposition_objects.row = pos;
colrow_set_states (sheet, is_cols, state_start, states);
colrow_state_list_destroy (states);
}
static void
......
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