Commit c93bc712 authored by Chema Celorio's avatar Chema Celorio Committed by Jody Goldberg

Merge Chema's copy sheet patch.

2000-08-16  Chema Celorio  <chema@celorio.com>

	* src/sheet.c (sheet_duplicate
		       sheet_clone_cells,
		       cb_sheet_cell_copy,
		       sheet_clone_objects,
		       sheet_clone_names,
		       sheet_clone_selection,
		       sheet_clone_styles,
		       sheet_clone_style_region,
		       sheet_clone_colrow_info,
		       sheet_clone_colrow_info_item) : New.

	* src/solver-lp.c (solver_lp_copy) : New func.

	* src/print-info.c (print_info_copy) : New func.
	(print_info_margin_copy) : Ditto.
	* src/workbook.c (sheet_action_clone_sheet) : New.

2000-08-16  Jody Goldberg <jgoldberg@home.com>

	* src/sheet.c (sheet_cell_insert) : Add a flag to disable span
	  recalculation.

	* src/sheet-style.c (sheet_get_style_list) : const.

	* src/position.c (parse_pos_init_cell) : Use Cell::pos.

	* src/clipboard.c (paste_cell_with_operation) : Changes to
	  sheet_cell_insert.
	(paste_cell) : Ditto.

	* src/analysis-tools.c (prepare_output) : Changes to
	  workbook_sheet_get_free_name.
	* src/workbook.c (insert_sheet_cmd) : ditto.
	(workbook_sheet_name_strip_number) : New.
	(workbook_sheet_get_free_name) : Handle names of the form 'bobo (2)'.
parent ecb35246
2000-08-16 Chema Celorio <chema@celorio.com>
* src/sheet.c (sheet_duplicate
sheet_clone_cells,
cb_sheet_cell_copy,
sheet_clone_objects,
sheet_clone_names,
sheet_clone_selection,
sheet_clone_styles,
sheet_clone_style_region,
sheet_clone_colrow_info,
sheet_clone_colrow_info_item) : New.
* src/solver-lp.c (solver_lp_copy) : New func.
* src/print-info.c (print_info_copy) : New func.
(print_info_margin_copy) : Ditto.
* src/workbook.c (sheet_action_clone_sheet) : New.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_insert) : Add a flag to disable span
recalculation.
* src/sheet-style.c (sheet_get_style_list) : const.
* src/position.c (parse_pos_init_cell) : Use Cell::pos.
* src/clipboard.c (paste_cell_with_operation) : Changes to
sheet_cell_insert.
(paste_cell) : Ditto.
* src/analysis-tools.c (prepare_output) : Changes to
workbook_sheet_get_free_name.
* src/workbook.c (insert_sheet_cmd) : ditto.
(workbook_sheet_name_strip_number) : New.
(workbook_sheet_get_free_name) : Handle names of the form 'bobo (2)'.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/workbook-view.c (workbook_view_set_size) : Back out switch to
......
2000-08-16 Chema Celorio <chema@celorio.com>
* src/sheet.c (sheet_duplicate
sheet_clone_cells,
cb_sheet_cell_copy,
sheet_clone_objects,
sheet_clone_names,
sheet_clone_selection,
sheet_clone_styles,
sheet_clone_style_region,
sheet_clone_colrow_info,
sheet_clone_colrow_info_item) : New.
* src/solver-lp.c (solver_lp_copy) : New func.
* src/print-info.c (print_info_copy) : New func.
(print_info_margin_copy) : Ditto.
* src/workbook.c (sheet_action_clone_sheet) : New.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_insert) : Add a flag to disable span
recalculation.
* src/sheet-style.c (sheet_get_style_list) : const.
* src/position.c (parse_pos_init_cell) : Use Cell::pos.
* src/clipboard.c (paste_cell_with_operation) : Changes to
sheet_cell_insert.
(paste_cell) : Ditto.
* src/analysis-tools.c (prepare_output) : Changes to
workbook_sheet_get_free_name.
* src/workbook.c (insert_sheet_cmd) : ditto.
(workbook_sheet_name_strip_number) : New.
(workbook_sheet_get_free_name) : Handle names of the form 'bobo (2)'.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/workbook-view.c (workbook_view_set_size) : Back out switch to
......
......@@ -4,6 +4,8 @@ Almer:
* Fix stf importer bugs
* Add "Autodiscovery" feature to stf fixed width importer.
Chema:
* Copy sheet.
Jody:
* Applix support mostly functional.
* Improve support for named expressions.
......
2000-08-16 Chema Celorio <chema@celorio.com>
* src/sheet.c (sheet_duplicate
sheet_clone_cells,
cb_sheet_cell_copy,
sheet_clone_objects,
sheet_clone_names,
sheet_clone_selection,
sheet_clone_styles,
sheet_clone_style_region,
sheet_clone_colrow_info,
sheet_clone_colrow_info_item) : New.
* src/solver-lp.c (solver_lp_copy) : New func.
* src/print-info.c (print_info_copy) : New func.
(print_info_margin_copy) : Ditto.
* src/workbook.c (sheet_action_clone_sheet) : New.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_insert) : Add a flag to disable span
recalculation.
* src/sheet-style.c (sheet_get_style_list) : const.
* src/position.c (parse_pos_init_cell) : Use Cell::pos.
* src/clipboard.c (paste_cell_with_operation) : Changes to
sheet_cell_insert.
(paste_cell) : Ditto.
* src/analysis-tools.c (prepare_output) : Changes to
workbook_sheet_get_free_name.
* src/workbook.c (insert_sheet_cmd) : ditto.
(workbook_sheet_name_strip_number) : New.
(workbook_sheet_get_free_name) : Handle names of the form 'bobo (2)'.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/workbook-view.c (workbook_view_set_size) : Back out switch to
......
2000-08-16 Chema Celorio <chema@celorio.com>
* src/sheet.c (sheet_duplicate
sheet_clone_cells,
cb_sheet_cell_copy,
sheet_clone_objects,
sheet_clone_names,
sheet_clone_selection,
sheet_clone_styles,
sheet_clone_style_region,
sheet_clone_colrow_info,
sheet_clone_colrow_info_item) : New.
* src/solver-lp.c (solver_lp_copy) : New func.
* src/print-info.c (print_info_copy) : New func.
(print_info_margin_copy) : Ditto.
* src/workbook.c (sheet_action_clone_sheet) : New.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_insert) : Add a flag to disable span
recalculation.
* src/sheet-style.c (sheet_get_style_list) : const.
* src/position.c (parse_pos_init_cell) : Use Cell::pos.
* src/clipboard.c (paste_cell_with_operation) : Changes to
sheet_cell_insert.
(paste_cell) : Ditto.
* src/analysis-tools.c (prepare_output) : Changes to
workbook_sheet_get_free_name.
* src/workbook.c (insert_sheet_cmd) : ditto.
(workbook_sheet_name_strip_number) : New.
(workbook_sheet_get_free_name) : Handle names of the form 'bobo (2)'.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/workbook-view.c (workbook_view_set_size) : Back out switch to
......
2000-08-16 Chema Celorio <chema@celorio.com>
* src/sheet.c (sheet_duplicate
sheet_clone_cells,
cb_sheet_cell_copy,
sheet_clone_objects,
sheet_clone_names,
sheet_clone_selection,
sheet_clone_styles,
sheet_clone_style_region,
sheet_clone_colrow_info,
sheet_clone_colrow_info_item) : New.
* src/solver-lp.c (solver_lp_copy) : New func.
* src/print-info.c (print_info_copy) : New func.
(print_info_margin_copy) : Ditto.
* src/workbook.c (sheet_action_clone_sheet) : New.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_insert) : Add a flag to disable span
recalculation.
* src/sheet-style.c (sheet_get_style_list) : const.
* src/position.c (parse_pos_init_cell) : Use Cell::pos.
* src/clipboard.c (paste_cell_with_operation) : Changes to
sheet_cell_insert.
(paste_cell) : Ditto.
* src/analysis-tools.c (prepare_output) : Changes to
workbook_sheet_get_free_name.
* src/workbook.c (insert_sheet_cmd) : ditto.
(workbook_sheet_name_strip_number) : New.
(workbook_sheet_get_free_name) : Handle names of the form 'bobo (2)'.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/workbook-view.c (workbook_view_set_size) : Back out switch to
......
2000-08-16 Chema Celorio <chema@celorio.com>
* src/sheet.c (sheet_duplicate
sheet_clone_cells,
cb_sheet_cell_copy,
sheet_clone_objects,
sheet_clone_names,
sheet_clone_selection,
sheet_clone_styles,
sheet_clone_style_region,
sheet_clone_colrow_info,
sheet_clone_colrow_info_item) : New.
* src/solver-lp.c (solver_lp_copy) : New func.
* src/print-info.c (print_info_copy) : New func.
(print_info_margin_copy) : Ditto.
* src/workbook.c (sheet_action_clone_sheet) : New.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_insert) : Add a flag to disable span
recalculation.
* src/sheet-style.c (sheet_get_style_list) : const.
* src/position.c (parse_pos_init_cell) : Use Cell::pos.
* src/clipboard.c (paste_cell_with_operation) : Changes to
sheet_cell_insert.
(paste_cell) : Ditto.
* src/analysis-tools.c (prepare_output) : Changes to
workbook_sheet_get_free_name.
* src/workbook.c (insert_sheet_cmd) : ditto.
(workbook_sheet_name_strip_number) : New.
(workbook_sheet_get_free_name) : Handle names of the form 'bobo (2)'.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/workbook-view.c (workbook_view_set_size) : Back out switch to
......
2000-08-16 Chema Celorio <chema@celorio.com>
* src/sheet.c (sheet_duplicate
sheet_clone_cells,
cb_sheet_cell_copy,
sheet_clone_objects,
sheet_clone_names,
sheet_clone_selection,
sheet_clone_styles,
sheet_clone_style_region,
sheet_clone_colrow_info,
sheet_clone_colrow_info_item) : New.
* src/solver-lp.c (solver_lp_copy) : New func.
* src/print-info.c (print_info_copy) : New func.
(print_info_margin_copy) : Ditto.
* src/workbook.c (sheet_action_clone_sheet) : New.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_cell_insert) : Add a flag to disable span
recalculation.
* src/sheet-style.c (sheet_get_style_list) : const.
* src/position.c (parse_pos_init_cell) : Use Cell::pos.
* src/clipboard.c (paste_cell_with_operation) : Changes to
sheet_cell_insert.
(paste_cell) : Ditto.
* src/analysis-tools.c (prepare_output) : Changes to
workbook_sheet_get_free_name.
* src/workbook.c (insert_sheet_cmd) : ditto.
(workbook_sheet_name_strip_number) : New.
(workbook_sheet_get_free_name) : Handle names of the form 'bobo (2)'.
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/workbook-view.c (workbook_view_set_size) : Back out switch to
......
......@@ -286,7 +286,7 @@ prepare_output (Workbook *wb, data_analysis_output_t *dao, const char *name)
char *unique_name;
if (dao->type == NewSheetOutput) {
unique_name = workbook_sheet_get_free_name (wb, name, FALSE);
unique_name = workbook_sheet_get_free_name (wb, name, FALSE, FALSE);
dao->sheet = sheet_new (wb, unique_name);
g_free (unique_name);
dao->start_col = dao->start_row = 0;
......
......@@ -180,7 +180,7 @@ paste_cell_with_operation (Sheet *dest_sheet,
cell_render_value (new_cell);
}
sheet_cell_insert (dest_sheet, new_cell, target_col, target_row);
sheet_cell_insert (dest_sheet, new_cell, target_col, target_row, TRUE);
}
static void
......@@ -245,7 +245,7 @@ paste_cell (Sheet *dest_sheet,
cell_render_value (new_cell);
}
sheet_cell_insert (dest_sheet, new_cell, target_col, target_row);
sheet_cell_insert (dest_sheet, new_cell, target_col, target_row, TRUE);
} else {
Cell *new_cell = sheet_cell_new (dest_sheet,
target_col, target_row);
......
......@@ -74,8 +74,8 @@
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow1</name>
<hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
......
......@@ -92,12 +92,8 @@ parse_pos_init_cell (ParsePos *pp, Cell const *cell)
g_return_val_if_fail (IS_SHEET (cell->sheet), NULL);
g_return_val_if_fail (cell->sheet->workbook != NULL, NULL);
return parse_pos_init (
pp,
NULL,
cell->sheet,
cell->col_info->pos,
cell->row_info->pos);
return parse_pos_init (pp, NULL, cell->sheet,
cell->pos.col, cell->pos.row);
}
ParsePos *
......
......@@ -678,3 +678,62 @@ print_shutdown (void)
save_formats ();
destroy_formats ();
}
static void
print_info_margin_copy (PrintUnit *src_print_unit, PrintUnit *dst_print_unit)
{
dst_print_unit->points = src_print_unit->points;
dst_print_unit->desired_display = dst_print_unit->desired_display;
}
PrintInformation *
print_info_copy (PrintInformation *src_pi)
{
PrintInformation *dst_pi;
dst_pi = print_info_new();
dst_pi->orientation = src_pi->orientation;
/* Print Scaling */
dst_pi->scaling.type = src_pi->scaling.type;
dst_pi->scaling.percentage = src_pi->scaling.percentage;
dst_pi->scaling.dim.cols = src_pi->scaling.dim.cols;
dst_pi->scaling.dim.rows = src_pi->scaling.dim.rows;
/* Margins */
print_info_margin_copy (&src_pi->margins.top, &dst_pi->margins.top);
print_info_margin_copy (&src_pi->margins.bottom, &dst_pi->margins.bottom);
print_info_margin_copy (&src_pi->margins.left, &dst_pi->margins.left);
print_info_margin_copy (&src_pi->margins.right, &dst_pi->margins.right);
print_info_margin_copy (&src_pi->margins.header, &dst_pi->margins.header);
print_info_margin_copy (&src_pi->margins.footer, &dst_pi->margins.footer);
/* Booleans */
dst_pi->center_vertically = src_pi->center_vertically;
dst_pi->center_horizontally = src_pi->center_horizontally;
dst_pi->print_line_divisions = src_pi->print_line_divisions;
dst_pi->print_black_and_white = src_pi->print_black_and_white;
dst_pi->print_as_draft = src_pi->print_as_draft;
dst_pi->print_titles = src_pi->print_titles;
dst_pi->print_order = src_pi->print_order;
/* Headers & Footers */
dst_pi->header->left_format = g_strdup (src_pi->header->left_format);
dst_pi->header->middle_format = g_strdup (src_pi->header->middle_format);
dst_pi->header->right_format = g_strdup (src_pi->header->right_format);
dst_pi->footer->left_format = g_strdup (src_pi->footer->left_format);
dst_pi->footer->middle_format = g_strdup (src_pi->footer->middle_format);
dst_pi->footer->right_format = g_strdup (src_pi->footer->right_format);
/* Paper */
dst_pi->paper = gnome_paper_with_name (gnome_paper_name (src_pi->paper));
/* Repeat Range */
dst_pi->repeat_top = src_pi->repeat_top;
dst_pi->repeat_left = src_pi->repeat_left;
return dst_pi;
}
......@@ -108,6 +108,7 @@ typedef struct {
PrintInformation *print_info_new (void);
void print_info_save (PrintInformation *pi);
void print_info_free (PrintInformation *pi);
PrintInformation *print_info_copy (PrintInformation *src_pi);
PrintHF *print_hf_new (const char *left_side_format,
const char *middle_format,
......
......@@ -58,7 +58,7 @@ int style_cache_range_hits = 0;
* For xml-io only.
*/
GList *
sheet_get_style_list (Sheet *sheet)
sheet_get_style_list (Sheet const *sheet)
{
g_return_val_if_fail (sheet != NULL, NULL);
g_return_val_if_fail (sheet->style_data != NULL, NULL);
......
......@@ -114,7 +114,7 @@ SheetView *
sheet_new_sheet_view (Sheet *sheet)
{
GtkWidget *sheet_view;
g_return_val_if_fail (sheet != NULL, NULL);
g_return_val_if_fail (IS_SHEET (sheet), NULL);
......@@ -133,7 +133,7 @@ sheet_destroy_sheet_view (Sheet *sheet, SheetView *sheet_view)
g_return_if_fail (IS_SHEET (sheet));
g_return_if_fail (sheet_view != NULL);
g_return_if_fail (IS_SHEET_VIEW (sheet_view));
sheet->sheet_views = g_list_remove (sheet->sheet_views, sheet_view);
gtk_object_unref (GTK_OBJECT (sheet_view));
}
......@@ -192,9 +192,9 @@ sheet_new (Workbook *wb, const char *name)
sheet->solver_parameters.constraints = NULL;
sheet->solver_parameters.target_cell = NULL;
g_ptr_array_set_size (sheet->cols.info = g_ptr_array_new (),
g_ptr_array_set_size (sheet->cols.info = g_ptr_array_new (),
COLROW_SEGMENT_INDEX (SHEET_MAX_COLS-1)+1);
g_ptr_array_set_size (sheet->rows.info = g_ptr_array_new (),
g_ptr_array_set_size (sheet->rows.info = g_ptr_array_new (),
COLROW_SEGMENT_INDEX (SHEET_MAX_ROWS-1)+1);
sheet->print_info = print_info_new ();
......@@ -296,7 +296,7 @@ cb_recalc_span1 (Sheet *sheet, int col, int row, Cell *cell, gpointer flags)
* @sheet: The sheet,
* @r: the region to update.
* @render_text: whether to re-render the text in cells
*
*
* This is used to re-calculate cell dimensions and re-render
* a cell's text. eg. if a format has changed we need to re-render
* the cached version of the rendered text in the cell.
......@@ -414,7 +414,7 @@ sheet_set_zoom_factor (Sheet *sheet, double f, gboolean force)
double factor;
g_return_if_fail (sheet != NULL);
/* Bound zoom between 10% and 500% */
factor = (f < .1) ? .1 : ((f > 5.) ? 5. : f);
if (!force) {
......@@ -676,7 +676,7 @@ sheet_update_controls (Sheet const *sheet)
workbook_feedback_set (sheet->workbook, mstyle);
mstyle_unref (mstyle);
}
}
/*
* sheet_update : Should be called after a logical command has finished processing
......@@ -818,14 +818,14 @@ sheet_cell_fetch (Sheet *sheet, int col, int row)
/**
* sheet_get_extent_cb:
*
*
* checks the cell to see if should be used to calculate sheet extent
**/
static void
sheet_get_extent_cb (gpointer key, gpointer value, gpointer data)
{
Cell *cell = (Cell *) value;
if (!cell_is_blank (cell)) {
Range *range = (Range *)data;
CellSpanInfo const *span = NULL;
......@@ -851,9 +851,9 @@ sheet_get_extent_cb (gpointer key, gpointer value, gpointer data)
/**
* sheet_get_extent:
* @sheet: the sheet
*
*
* calculates the area occupied by cell data.
*
*
* Return value: the range.
**/
Range
......@@ -1232,7 +1232,7 @@ sheet_update_zoom_controls (Sheet *sheet)
if (sheet == sheet->workbook->current_sheet)
workbook_zoom_feedback_set (sheet->workbook,
sheet->last_zoom_factor_used);
}
}
int
sheet_col_selection_type (Sheet const *sheet, int col)
......@@ -1552,7 +1552,7 @@ sheet_find_boundary_vertical (Sheet *sheet, int col, int start_row,
/*
* Handle special case where we are on the last
* non-null cell
*/
*/
if (iterations == 1)
keep_looking = find_nonblank = TRUE;
else
......@@ -1653,7 +1653,7 @@ sheet_range_splits_array (Sheet const *sheet, Range const *r)
&cb_check_array_horizontal,
&closure))
return TRUE;
closure.start = r->start.col;
closure.end = r->end.col;
if (closure.start <= 0) {
......@@ -1905,7 +1905,7 @@ sheet_cell_add_to_hash (Sheet *sheet, Cell *cell)
}
void
sheet_cell_insert (Sheet *sheet, Cell *cell, int col, int row)
sheet_cell_insert (Sheet *sheet, Cell *cell, int col, int row, gboolean recalc_span)
{
cell->sheet = sheet;
cell->pos.col = col;
......@@ -1915,7 +1915,7 @@ sheet_cell_insert (Sheet *sheet, Cell *cell, int col, int row)
cell_add_dependencies (cell);
cell_realize (cell);
if (!cell_needs_recalc(cell))
if (recalc_span && !cell_needs_recalc(cell))
sheet_cell_calc_span (cell, SPANCALC_RESIZE);
}
......@@ -2226,7 +2226,7 @@ sheet_destroy_contents (Sheet *sheet)
for (i = 0; i <= max_row; ++i)
sheet_row_destroy (sheet, i, FALSE);
/* Free segments too */
for (i = COLROW_SEGMENT_INDEX (max_col); i >= 0 ; --i)
if ((tmp = g_ptr_array_index (sheet->cols.info, i)) != NULL) {
......@@ -2260,7 +2260,7 @@ sheet_destroy (Sheet *sheet)
if (sheet->print_info) {
print_info_free (sheet->print_info);
sheet->print_info = NULL;
}
}
if (sheet->objects) {
g_warning ("Reminder: need to destroy SheetObjects");
......@@ -2279,7 +2279,7 @@ sheet_destroy (Sheet *sheet)
}
g_list_free (sheet->sheet_views);
sheet->sheet_views = NULL;
g_list_free (sheet->comment_list);
sheet->comment_list = NULL;
......@@ -2606,9 +2606,9 @@ sheet_show_cursor (Sheet *sheet)
/**
* sheet_name_quote:
* @name_unquoted: Unquoted name
*
*
* Quotes the sheet name for use with sheet_new, sheet_rename
*
*
* Return value: a safe sheet name.
*
**/
......@@ -2624,7 +2624,7 @@ sheet_name_quote (const char *name_unquoted)
needs_quotes = isdigit ((unsigned char)*name_unquoted);
if (!needs_quotes)
for (i = 0, quotes_embedded = 0; name_unquoted [i]; i++) {
for (j = 0; quote_chr [j]; j++)
for (j = 0; quote_chr [j]; j++)
if (name_unquoted [i] == quote_chr [j])
needs_quotes = TRUE;
if (name_unquoted [i] == '"')
......@@ -2645,7 +2645,7 @@ sheet_name_quote (const char *name_unquoted)
}
*dst++ = '"';
*dst = '\0';
return ret;
} else
return g_strdup (name_unquoted);
......@@ -2677,10 +2677,10 @@ sheet_set_dirty (Sheet *sheet, gboolean is_dirty)
/**
* sheet_is_pristine:
* @sheet:
*
* @sheet:
*
* Sees if the sheet has ever been touched.
*
*
* Return value: TRUE if it is perfectly clean.
**/
gboolean
......@@ -2911,7 +2911,7 @@ sheet_delete_cols (CommandContext *context, Sheet *sheet,
int i;
g_return_val_if_fail (reloc_storage != NULL, TRUE);
*reloc_storage = NULL;
g_return_val_if_fail (sheet != NULL, TRUE);
......@@ -2983,7 +2983,7 @@ sheet_insert_rows (CommandContext *context, Sheet *sheet,
int i;
g_return_val_if_fail (reloc_storage != NULL, TRUE);
*reloc_storage = NULL;
g_return_val_if_fail (sheet != NULL, TRUE);
......@@ -3059,7 +3059,7 @@ sheet_delete_rows (CommandContext *context, Sheet *sheet,
int i;
g_return_val_if_fail (reloc_storage != NULL, TRUE);
*reloc_storage = NULL;
g_return_val_if_fail (sheet != NULL, TRUE);
......@@ -3211,7 +3211,7 @@ sheet_move_range (CommandContext *context,
* region without worrying if it overlaps with the source,
* because we have already extracted the content.
*/
sheet_clear_region (context, rinfo->target_sheet,
sheet_clear_region (context, rinfo->target_sheet,
dst.start.col, dst.start.row,
dst.end.col, dst.end.row,
CLEAR_VALUES|CLEAR_COMMENTS); /* Do not to clear styles */
......@@ -3242,7 +3242,7 @@ sheet_move_range (CommandContext *context,
/* Update the location */
sheet_cell_insert (rinfo->target_sheet, cell,
cell->pos.col + rinfo->col_offset,
cell->pos.row + rinfo->row_offset);
cell->pos.row + rinfo->row_offset, TRUE);
if (inter_sheet_expr)
sheet_cell_expr_link (cell);
......@@ -3346,7 +3346,7 @@ sheet_col_get_distance_pts (Sheet const *sheet, int from, int to)
if (ci->visible)
units += ci->size_pts;
}
return units*sign;
}
......@@ -3367,7 +3367,7 @@ sheet_col_set_size_pts (Sheet *sheet, int col, double width_pts,
gboolean set_by_user)
{
ColRowInfo *ci;
g_return_if_fail (sheet != NULL);
g_return_if_fail (IS_SHEET (sheet));
g_return_if_fail (width_pts > 0.0);
......@@ -3422,7 +3422,7 @@ sheet_col_get_default_size_pts (Sheet const *sheet)
ColRowInfo const *ci;
g_assert (sheet != NULL);
ci = &sheet->cols.default_style;
return ci->size_pts;
}
......@@ -3561,7 +3561,7 @@ sheet_row_set_size_pts (Sheet *sheet, int row, double height_pts,
gboolean set_by_user)
{
ColRowInfo *ri;
g_return_if_fail (sheet != NULL);
g_return_if_fail (IS_SHEET (sheet));
g_return_if_fail (height_pts > 0.0);
......@@ -3629,7 +3629,7 @@ sheet_row_get_default_size_pts (Sheet const *sheet)
ColRowInfo const *ci;
g_assert (sheet != NULL);
ci = &sheet->rows.default_style;
return ci->size_pts;
}
......@@ -3686,3 +3686,224 @@ sheet_destroy_cell_select_cursor (Sheet *sheet, gboolean clear_string)
gnumeric_sheet_stop_cell_selection (gsheet, clear_string);
}
}
typedef struct
{
gboolean is_column;
Sheet *sheet;
} closure_clone_colrow;
static gboolean
sheet_clone_colrow_info_item (ColRowInfo *info, void *user_data)
{
ColRowInfo *new_colrow;
closure_clone_colrow * closure = user_data;
if (closure->is_column)
new_colrow = sheet_col_new (closure->sheet);
else
new_colrow = sheet_row_new (closure->sheet);
new_colrow->pos = info->pos;
new_colrow->margin_a = info->margin_a;
new_colrow->margin_b = info->margin_b;
new_colrow->hard_size = info->hard_size;
new_colrow->visible = info->visible;
if (closure->is_column) {
sheet_col_add (closure->sheet, new_colrow);
sheet_col_set_size_pts (closure->sheet, new_colrow->pos, info->size_pts, new_colrow->hard_size);
} else {
sheet_row_add (closure->sheet, new_colrow);
sheet_row_set_size_pts (closure->sheet, new_colrow->pos, info->size_pts, new_colrow->hard_size);
}
return FALSE;
}
static void
sheet_clone_colrow_info (Sheet const *source_sheet, Sheet *new_sheet)
{
closure_clone_colrow closure;
closure.sheet = new_sheet;