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

save the manual recalc flag.

2003-11-15  Jody Goldberg <jody@gnome.org>

	* ms-excel-write.c (write_sheet_head) : save the manual recalc flag.

2003-11-15  Jody Goldberg <jody@gnome.org>

	* gnumeric.xsd : Add the Calculation info

	* src/xml-io.c (xml_workbook_write) : Save manual recalc and iteration
	  preferences.
	(xml_workbook_read) : And read them.

	http://bugzilla.gnome.org/show_bug.cgi?id=126907
	* src/commands.c (cmd_set_text_redo) : even when using manual recalc
	  we should calculate newly entered expression.
parent 442a8bc9
......@@ -8,6 +8,7 @@ release, and longer term bugs.
Release Critical
----------------
http://bugzilla.gnome.org/show_bug.cgi?id=126907 [manual recalc]
: X axis label seperation
: text in boxes for text-xls/pivot.xls is white ??
: guia.xls complains of problems importing autofilter
......@@ -219,8 +220,8 @@ Short Term Goals
1.14.16) Respect user supplied min/max/major/minor (DONE)
1.14.17) Draw major ticks in (DONE)
1.14.18) Draw major ticks out (DONE)
1.14.19) Draw minor ticks in
1.14.20) Draw minor ticks out
1.14.19) Draw minor ticks in (DONE)
1.14.20) Draw minor ticks out (DONE)
1.14.21) Why don't we honour selected font ? (DONE)
1.15) per series plot type specific data (DONE)
1.16) libart based render akin to guppicanvas. (DONE)
......@@ -241,12 +242,12 @@ Short Term Goals
1.18) Extend sheet object anchor assignment to call object (DONE)
specfic handlers so that we can set the logical size
of the graph.
1.19) Precedence
1.19) Precedence (DONE)
1.19.1) Sort GogObject::children (DONE)
1.19.2) Keep corresponding views in sync (DONE)
1.19.3) Have guru maintain order for add/remove (DONE)
1.19.4) api for changing order
1.19.5) Extend Guru to support changing precedence
1.19.4) api for changing order (DONE)
1.19.5) Extend Guru to support changing precedence (DONE)
1.20) GogStyle Editor page
1.20.1) fill type (DONE)
1.20.1.1) none (DONE)
......@@ -261,7 +262,7 @@ Short Term Goals
1.20.4.1) outline (colour) (DONE)
1.20.4.2) line (color) (DONE)
1.20.4.3) fill (colors) (DONE)
1.20.4.4) marker
1.20.4.4) marker (DONE)
1.20.4.5) font
1.20.4.6) fill type
1.20.5) image selector
......@@ -411,6 +412,15 @@ Short Term Goals
6.13.1) Excel95
6.13.1) Excel97
6.14) chart export
6.15) Store and round trip macros
6.15.1) blob CompObj stream (DONE)
6.15.2) blob property streams to get the flags (DONE)
6.15.3) export OBPROJ record if necessary (DONE)
6.15.4) export CODENAME records if necessary (DONE)
6.15.5) Store a workbook local function stub in import
6.15.6) use appropriate NAME record for function stubs
6.15.7) generate CompObj stream
6.15.8) generate property streams to get the flags
14) Polish up Open and Save
14.1) merge open and import dialogs (DONE)
......
2003-11-15 Jody Goldberg <jody@gnome.org>
* gnumeric.xsd : Add the Calculation info
* src/xml-io.c (xml_workbook_write) : Save manual recalc and iteration
preferences.
(xml_workbook_read) : And read them.
http://bugzilla.gnome.org/show_bug.cgi?id=126907
* src/commands.c (cmd_set_text_redo) : even when using manual recalc
we should calculate newly entered expression.
2003-11-14 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=68794
......
......@@ -85,6 +85,9 @@ Jody:
* default to rows when rows == cols
* Support minor ticks
* Tune chart axis ticks to avoid anti-aliasing blur
* Export 'Manual Recalc' flag to xls
http://bugzilla.gnome.org/show_bug.cgi?id=126907
* Recalc new expressions even when manually recalculating
Morten:
* Fix crash with STF import and gazillions of columns.
......
2003-11-15 Jody Goldberg <jody@gnome.org>
* gnumeric.xsd : Add the Calculation info
* src/xml-io.c (xml_workbook_write) : Save manual recalc and iteration
preferences.
(xml_workbook_read) : And read them.
http://bugzilla.gnome.org/show_bug.cgi?id=126907
* src/commands.c (cmd_set_text_redo) : even when using manual recalc
we should calculate newly entered expression.
2003-11-14 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=68794
......
2003-11-15 Jody Goldberg <jody@gnome.org>
* gnumeric.xsd : Add the Calculation info
* src/xml-io.c (xml_workbook_write) : Save manual recalc and iteration
preferences.
(xml_workbook_read) : And read them.
http://bugzilla.gnome.org/show_bug.cgi?id=126907
* src/commands.c (cmd_set_text_redo) : even when using manual recalc
we should calculate newly entered expression.
2003-11-14 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=68794
......
......@@ -8,7 +8,7 @@
<xsd:annotation>
<xsd:documentation xml:lang="en">
Schema for gnumeric spreadsheet documents
Assumes Gnumeric 1.0.3
Assumes Gnumeric 1.2.2
Based on gnumeric source code and sample gnumeric documents
Author: Marc Johnson (marc_johnson27591@hotmail.com)
</xsd:documentation>
......@@ -42,6 +42,14 @@
<xsd:attribute name="SelectedTab" type="xsd:nonNegativeInteger" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="Calculation">
<xsd:complexType>
<xsd:attribute name="ManualRecalc" type="xsd:boolean"/>
<xsd:attribute name="EnableIteration" type="xsd:boolean"/>
<xsd:attribute name="MaxIterations" type="xsd:nonNegativeInteger"/>
<xsd:attribute name="IterationTolerance" type="xsd:double"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<!-- version number should be v10 - - &gt;
<xsd:attribute name="gmr" type="gmr:namespace" use="required"/> -->
......
2003-11-15 Jody Goldberg <jody@gnome.org>
* ms-excel-write.c (write_sheet_head) : save the manual recalc flag.
2003-11-14 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=126908
......
......@@ -3311,7 +3311,7 @@ write_sheet_head (BiffPut *bp, ExcelWriteSheet *esheet)
{
guint8 *data;
PrintInformation *pi;
Workbook *ewb = esheet->gnum_sheet->workbook;
Workbook *wb = esheet->gnum_sheet->workbook;
double header = 0, footer = 0, left = 0, right = 0;
g_return_if_fail (esheet != NULL);
......@@ -3322,27 +3322,27 @@ write_sheet_head (BiffPut *bp, ExcelWriteSheet *esheet)
/* See: S59D63.HTM */
data = ms_biff_put_len_next (bp, BIFF_CALCMODE, 2);
GSF_LE_SET_GUINT16 (data, 0x0001);
GSF_LE_SET_GUINT16 (data, wb->recalc_auto ? 1 : 0);
ms_biff_put_commit (bp);
/* See: S59D62.HTM */
data = ms_biff_put_len_next (bp, BIFF_CALCCOUNT, 2);
GSF_LE_SET_GUINT16 (data, ewb->iteration.max_number);
GSF_LE_SET_GUINT16 (data, wb->iteration.max_number);
ms_biff_put_commit (bp);
/* See: S59DD7.HTM */
data = ms_biff_put_len_next (bp, BIFF_REFMODE, 2);
GSF_LE_SET_GUINT16 (data, 0x0001);
GSF_LE_SET_GUINT16 (data, 0x0001); /* A1 */
ms_biff_put_commit (bp);
/* See: S59D9C.HTM */
data = ms_biff_put_len_next (bp, BIFF_ITERATION, 2);
GSF_LE_SET_GUINT16 (data, ewb->iteration.enabled ? 1 : 0);
GSF_LE_SET_GUINT16 (data, wb->iteration.enabled ? 1 : 0);
ms_biff_put_commit (bp);
/* See: S59D75.HTM */
data = ms_biff_put_len_next (bp, BIFF_DELTA, 8);
gsf_le_set_double (data, ewb->iteration.tolerance);
gsf_le_set_double (data, wb->iteration.tolerance);
ms_biff_put_commit (bp);
/* See: S59DDD.HTM */
......
2003-11-15 Jody Goldberg <jody@gnome.org>
* xml-sax-read.c (xml_sax_calculation) : read the new calculation attrs.
* xml-sax-write.c (xml_write_calculation) : write them.
2003-10-08 Jody Goldberg <jody@gnome.org>
* Release 1.2.1
......
......@@ -341,6 +341,26 @@ xml_sax_wb_view (GsfXMLIn *gsf_state, xmlChar const **attrs)
if (width > 0 && height > 0)
wb_view_preferred_size (state->wb_view, width, height);
}
static void
xml_sax_calculation (GsfXMLIn *gsf_state, xmlChar const **attrs)
{
XMLSaxParseState *state = (XMLSaxParseState *)gsf_state;
gboolean b;
int i;
double d;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (xml_sax_attr_bool (attrs, "ManualRecalc", &b))
workbook_autorecalc_enable (state->wb, b);
else if (xml_sax_attr_bool (attrs, "EnableIteration", &b))
workbook_iteration_enabled (state->wb, b);
else if (xml_sax_attr_int (attrs, "MaxIterations", &i))
workbook_iteration_max_number (state->wb, i);
else if (xml_sax_attr_double (attrs, "IterationTolerance", &d))
workbook_iteration_tolerance (state->wb, d);
else
unknown_attr (state, attrs, "WorkbookView");
}
static void
xml_sax_finish_parse_wb_attr (GsfXMLIn *gsf_state, G_GNUC_UNUSED GsfXMLBlob *blob)
......@@ -1464,6 +1484,7 @@ GSF_XML_IN_NODE_FULL (START, WB, GNM, "Workbook", FALSE, TRUE, FALSE, &xml_sax_w
GSF_XML_IN_NODE (WB, WB_GEOMETRY, GNM, "Geometry", FALSE, &xml_sax_wb_view, NULL),
GSF_XML_IN_NODE (WB, WB_VIEW, GNM, "UIData", FALSE, &xml_sax_wb_view, NULL),
GSF_XML_IN_NODE (WB, WB_CALC, GNM, "Calculation", FALSE, &xml_sax_calculation, NULL),
{ NULL }
};
static GsfXMLInDoc *doc;
......
......@@ -1050,6 +1050,21 @@ xml_write_uidata (GnmOutputXML *state)
gsf_xml_out_end_element (state->output); /* </gmr:UIData> */
}
static void
xml_write_calculation (GnmOutputXML *state)
{
gsf_xml_out_start_element (state->output, GMR "Calculation");
gsf_xml_out_add_bool (state->output,
"ManualRecalc", !state->wb->recalc_auto);
gsf_xml_out_add_bool (state->output,
"EnableIteration", state->wb->iteration.enabled);
gsf_xml_out_add_int (state->output,
"MaxIterations", state->wb->iteration.max_number);
gsf_xml_out_add_float (state->output,
"IterationTolerance", state->wb->iteration.tolerance, -1);
gsf_xml_out_end_element (state->output); /* </gmr:Calculation> */
}
static GnmExprConventions *
xml_io_conventions (void)
{
......@@ -1113,6 +1128,7 @@ xml_sax_file_save (GnmFileSaver const *fs, IOContext *io_context,
xml_write_geometry (&state);
xml_write_sheets (&state);
xml_write_uidata (&state);
xml_write_calculation (&state);
gsf_xml_out_end_element (state.output); /* </Workbook> */
......
......@@ -852,6 +852,10 @@ cmd_set_text_redo (GnmCommand *cmd, WorkbookControl *wbc)
}
}
/* even for manual recalc we need to calc the new cell */
if (expr != NULL && !me->pos.sheet->workbook->recalc_auto)
cell_eval (cell);
return FALSE;
}
......
......@@ -3561,6 +3561,12 @@ xml_workbook_write (XmlParseContext *ctxt)
xml_node_set_int (child, "SelectedTab", wb_view_cur_sheet (ctxt->wb_view)->index_in_wb);
xmlAddChild (cur, child);
child = xmlNewChild (cur, ctxt->ns, CC2XML ("Calculation"), NULL);
xml_node_set_bool (child, "ManualRecalc", !ctxt->wb->recalc_auto);
xml_node_set_bool (child, "EnableIteration", ctxt->wb->iteration.enabled);
xml_node_set_int (child, "MaxIterations", ctxt->wb->iteration.max_number);
xml_node_set_double (child, "IterationTolerance", ctxt->wb->iteration.tolerance, -1);
gnumeric_setlocale (LC_MONETARY, old_monetary_locale);
g_free (old_monetary_locale);
gnumeric_setlocale (LC_NUMERIC, old_num_locale);
......@@ -3738,6 +3744,22 @@ xml_workbook_read (IOContext *context,
workbook_sheet_by_index (ctxt->wb, sheet_index));
}
child = e_xml_get_child_by_name (tree, CC2XML ("Calculation"));
if (child != NULL) {
gboolean b;
int i;
double d;
if (xml_node_get_bool (child, "ManualRecalc", &b))
workbook_autorecalc_enable (ctxt->wb, b);
if (xml_node_get_bool (child, "EnableIteration", &b))
workbook_iteration_enabled (ctxt->wb, b);
if (xml_node_get_int (child, "MaxIterations", &i))
workbook_iteration_max_number (ctxt->wb, i);
if (xml_node_get_double (child, "IterationTolerance", &d))
workbook_iteration_tolerance (ctxt->wb, d);
}
gnumeric_setlocale (LC_MONETARY, old_monetary_locale);
g_free (old_monetary_locale);
gnumeric_setlocale (LC_NUMERIC, old_num_locale);
......
......@@ -341,6 +341,26 @@ xml_sax_wb_view (GsfXMLIn *gsf_state, xmlChar const **attrs)
if (width > 0 && height > 0)
wb_view_preferred_size (state->wb_view, width, height);
}
static void
xml_sax_calculation (GsfXMLIn *gsf_state, xmlChar const **attrs)
{
XMLSaxParseState *state = (XMLSaxParseState *)gsf_state;
gboolean b;
int i;
double d;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (xml_sax_attr_bool (attrs, "ManualRecalc", &b))
workbook_autorecalc_enable (state->wb, b);
else if (xml_sax_attr_bool (attrs, "EnableIteration", &b))
workbook_iteration_enabled (state->wb, b);
else if (xml_sax_attr_int (attrs, "MaxIterations", &i))
workbook_iteration_max_number (state->wb, i);
else if (xml_sax_attr_double (attrs, "IterationTolerance", &d))
workbook_iteration_tolerance (state->wb, d);
else
unknown_attr (state, attrs, "WorkbookView");
}
static void
xml_sax_finish_parse_wb_attr (GsfXMLIn *gsf_state, G_GNUC_UNUSED GsfXMLBlob *blob)
......@@ -1464,6 +1484,7 @@ GSF_XML_IN_NODE_FULL (START, WB, GNM, "Workbook", FALSE, TRUE, FALSE, &xml_sax_w
GSF_XML_IN_NODE (WB, WB_GEOMETRY, GNM, "Geometry", FALSE, &xml_sax_wb_view, NULL),
GSF_XML_IN_NODE (WB, WB_VIEW, GNM, "UIData", FALSE, &xml_sax_wb_view, NULL),
GSF_XML_IN_NODE (WB, WB_CALC, GNM, "Calculation", FALSE, &xml_sax_calculation, NULL),
{ NULL }
};
static GsfXMLInDoc *doc;
......
......@@ -1050,6 +1050,21 @@ xml_write_uidata (GnmOutputXML *state)
gsf_xml_out_end_element (state->output); /* </gmr:UIData> */
}
static void
xml_write_calculation (GnmOutputXML *state)
{
gsf_xml_out_start_element (state->output, GMR "Calculation");
gsf_xml_out_add_bool (state->output,
"ManualRecalc", !state->wb->recalc_auto);
gsf_xml_out_add_bool (state->output,
"EnableIteration", state->wb->iteration.enabled);
gsf_xml_out_add_int (state->output,
"MaxIterations", state->wb->iteration.max_number);
gsf_xml_out_add_float (state->output,
"IterationTolerance", state->wb->iteration.tolerance, -1);
gsf_xml_out_end_element (state->output); /* </gmr:Calculation> */
}
static GnmExprConventions *
xml_io_conventions (void)
{
......@@ -1113,6 +1128,7 @@ xml_sax_file_save (GnmFileSaver const *fs, IOContext *io_context,
xml_write_geometry (&state);
xml_write_sheets (&state);
xml_write_uidata (&state);
xml_write_calculation (&state);
gsf_xml_out_end_element (state.output); /* </Workbook> */
......
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