Commit 4f2a0ecd authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

dup the properties too.


2006-03-14  Jody Goldberg <jody@gnome.org>

	* src/sheet.c (sheet_dup) : dup the properties too.
parent 31dd5842
2006-03-14 Jody Goldberg <jody@gnome.org>
* src/sheet.c (sheet_dup) : dup the properties too.
2006-03-13 Morten Welinder <terra@gnome.org>
* src/xml-io.c (xml_sheet_read): Handle "protected" attribute.
......
Gnumeric 1.6.3
Jody:
* Backport duping sheet props when sheet is duped.
Klokan Pridal:
* Implement xml saving/loading of "protected" attribute. [#334257]
* Implement xls saving/loading of "protected" attribute. [#330129]
......
2006-03-14 Jody Goldberg <jody@gnome.org>
* src/sheet.c (sheet_dup) : dup the properties too.
2006-03-13 Morten Welinder <terra@gnome.org>
* src/xml-io.c (xml_sheet_read): Handle "protected" attribute.
......
......@@ -248,6 +248,9 @@ gnm_so_polygon_set_property (GObject *obj, guint param_id,
break;
case SOP_PROP_POINTS:
points = g_value_get_pointer (value);
g_return_if_fail (points != NULL);
if (sop->points != points) {
g_array_free (sop->points, TRUE);
sop->points = points;
......
......@@ -3,7 +3,7 @@
/*
* sheet.c: Implements the sheet management and per-sheet storage
*
* Copyright (C) 2000-2005 Jody Goldberg (jody@gnome.org)
* Copyright (C) 2000-2006 Jody Goldberg (jody@gnome.org)
* Copyright (C) 1997-1999 Miguel de Icaza (miguel@kernel.org)
*
* This program is free software; you can redistribute it and/or
......@@ -4370,9 +4370,12 @@ sheet_clone_colrow_info (Sheet const *src, Sheet *dst)
static void
sheet_clone_styles (Sheet const *src, Sheet *dst)
{
static GnmCellPos const corner = { 0, 0 };
GnmRange r;
GnmStyleList *styles;
GnmCellPos corner = { 0, 0 };
sheet_style_set_auto_pattern_color (
dst, sheet_style_get_auto_pattern_color (src));
styles = sheet_style_get_list (src, range_init_full_sheet (&r));
sheet_style_set_list (dst, &corner, FALSE, styles);
......@@ -4459,8 +4462,10 @@ sheet_clone_cells (Sheet const *src, Sheet *dst)
/**
* sheet_dup :
* @src :
*/
* @src : #Sheet
*
* Create a new Sheet and return it.
**/
Sheet *
sheet_dup (Sheet const *src)
{
......@@ -4477,13 +4482,27 @@ sheet_dup (Sheet const *src)
dst = sheet_new (wb, name);
g_free (name);
/* Copy the print info */
g_object_set (dst,
"zoom-factor", src->last_zoom_factor_used,
"text-is-rtl", src->text_is_rtl,
"visibility", src->visibility,
"protected", src->is_protected,
"display-formulas", src->display_formulas,
"display-zeros", !src->hide_zero,
"display-grid", !src->hide_grid,
"display-column-header", !src->hide_col_header,
"display-row-header", !src->hide_row_header,
"display-outlines", !src->display_outlines,
"display-outlines-below", src->outline_symbols_below,
"display-outlines-right", src->outline_symbols_right,
"use-r1c1", src->r1c1_addresses,
"tab-foreground", src->tab_text_color,
"tab-background", src->tab_color,
NULL);
print_info_free (dst->print_info);
dst->print_info = print_info_dup (src->print_info);
sheet_style_set_auto_pattern_color (
dst, sheet_style_get_auto_pattern_color (src));
sheet_clone_styles (src, dst);
sheet_clone_regions (src, dst);
sheet_clone_colrow_info (src, dst);
......@@ -4494,16 +4513,11 @@ sheet_dup (Sheet const *src)
#warning selection is in view
#warning freeze/thaw is in view
/* Copy the solver */
solver_param_destroy (dst->solver_parameters);
dst->solver_parameters = solver_lp_copy (src->solver_parameters, dst);
/* Copy scenarios */
dst->scenarios = scenario_copy_all (src->scenarios, dst);
/* We need a more general property copying solution. */
g_object_set (dst, "zoom-factor", src->last_zoom_factor_used, NULL);
sheet_set_dirty (dst, TRUE);
sheet_redraw_all (dst, TRUE);
......
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