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

send the actual record, not the 4 byte header that loses 4 trailing bytes.

2007-07-13  Jody Goldberg <jody@gnome.org>

	* ms-obj.c (ms_obj_read_biff8_obj) : send the actual record, not
	  the 4 byte header that loses 4 trailing bytes.
	(ms_obj_map_forms_obj) : Use existing tools to properly handle
	 longer names and objects with data sources (combos/lists).

	* xlsx-write.c (xlsx_write_calcPR) : new.

2007-07-13  Jody Goldberg <jody@gnome.org>

	* sylk.c (sylk_next_token) : initial version of accent support.  pango
	  does not handle it well.

2007-07-22  Jody Goldberg  <jody@gnome.org>

	* src/sheet.c (PROP_CONVENTIONS) : new property.
	(PROP_USE_R1C1) : made this a convenience wrapper for
	(sheet_set_conventions) : rename.
	(sheet_get_conventions) : renamed from sheet_conventions.

	* src/workbook.c (RECALC_MODE) : new property.

	* src/xml-sax-read.c (gnm_xml_attr_int) : make more rigorous.
	(xml_sax_calculation) : add DateConvention.
	(xml_sax_old_dateconvention) : new.
	(xml_sax_sheet_start) : store the name of the expr conv.
	(xml_sax_sheet_name) : assigned the named expr conv.

	* src/xml-sax-write.c (xml_write_sheet) : Use an enum in place of a
	  bool to store R1C1, for future expandability
	(xml_write_calculation) : Store the DateConvention here, rather than
	  in a magic element missing from the schema.
	* src/xml-io.c (xml_sheet_read) : support new ExprConvention hook.
	(xml_workbook_read) : support DateConvention in Calculation.

svn path=/trunk/; revision=15672
parent 96177c43
......@@ -7,19 +7,17 @@ release, and longer term bugs.
-------------------------------------------------------------------------------
Release Critical
----------------
- Convention sax export format
- finish workbook recalc prop
- finish xls Form import
- replicate col/row header redraw problem on scrolling
- fix python tests in configure.in
In Progress
-----------
Jody
- Convention sax export format
- mis-export of array expr
http://bugzilla.gnome.org/show_bug.cgi?id=322096
- Fix shrinking ranges on cell deletion. [#439347]
- win32 GOption fixes
- finish xls Form import
- replicate col/row header redraw problem on scrolling
Review
------
......
2007-07-13 Jody Goldberg <jody@gnome.org>
* sylk.c (sylk_next_token) : initial version of accent support. pango
does not handle it well.
2007-07-22 Jody Goldberg <jody@gnome.org>
* src/sheet.c (PROP_CONVENTIONS) : new property.
(PROP_USE_R1C1) : made this a convenience wrapper for
(sheet_set_conventions) : rename.
(sheet_get_conventions) : renamed from sheet_conventions.
* src/workbook.c (RECALC_MODE) : new property.
* src/xml-sax-read.c (gnm_xml_attr_int) : make more rigorous.
(xml_sax_calculation) : add DateConvention.
(xml_sax_old_dateconvention) : new.
(xml_sax_sheet_start) : store the name of the expr conv.
(xml_sax_sheet_name) : assigned the named expr conv.
* src/xml-sax-write.c (xml_write_sheet) : Use an enum in place of a
bool to store R1C1, for future expandability
(xml_write_calculation) : Store the DateConvention here, rather than
in a magic element missing from the schema.
* src/xml-io.c (xml_sheet_read) : support new ExprConvention hook.
(xml_workbook_read) : support DateConvention in Calculation.
2007-07-21 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/xml-sax-read.c (xml_sax_repeat_top): new
......@@ -56,6 +83,24 @@
* schemas/gnumeric-general.schemas.in : Add enter_moves_dir
* src/gnm-pane.c (gnm_pane_key_mode_sheet) : use it here.
2007-07-13 Jody Goldberg <jody@gnome.org>
* gnumeric.xsd : update the schema with the ExprConventions and add
some defaults.
* src/xml-sax-read.c (xml_sax_sheet_name) : handle the new
ExprConvention flags, just A1/R1C1 for now, but future proof it.
* src/xml-sax-write.c (xml_write_sheet) : ditto.
* src/sheet.c (sheet_set_conventions) : replaces sheet_set_use_r1c1.
(gnm_sheet_set_property) : added 'conventions' and made use-r1c1 a
convenience flag.
(gnm_sheet_get_property) : ditto.
(gnm_sheet_class_init) : ditto.
(sheet_dup) : use conventions rather than r1c1 flag.
(gnm_sheet_init) : init the convs directly.
(sheet_get_conventions) : renamed from sheet_conventions.
2007-07-13 Jody Goldberg <jody@gnome.org>
* configure.in : remove GTK_DISABLE_DEPRECATED for now. Gtk trunk has
......
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
Installation Instructions
*************************
This file is free documentation; the Free Software Foundation gives
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
......@@ -67,9 +70,9 @@ The simplest way to compile this package is:
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
......@@ -82,7 +85,7 @@ is an example:
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
......@@ -99,19 +102,19 @@ for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
......@@ -122,7 +125,7 @@ option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
......@@ -137,11 +140,11 @@ you can use the `configure' options `--x-includes=DIR' and
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
......@@ -156,7 +159,7 @@ where SYSTEM can have one of these forms:
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
......@@ -167,9 +170,9 @@ eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
......@@ -178,7 +181,7 @@ A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
......@@ -186,14 +189,18 @@ them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script). Here is a another example:
/bin/bash ./configure CONFIG_SHELL=/bin/bash
Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
configuration-related scripts to be executed by `/bin/bash'.
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
......
......@@ -9,11 +9,13 @@
<xsd:documentation xml:lang="en">
Schema for gnumeric spreadsheet documents
Created for Gnumeric 1.2.2,
Based on gnumeric source code and sample gnumeric documents
Author: Marc Johnson (marc_johnson27591@hotmail.com)
updated for 1.4.2 in Feb 2005
updated for 1.6.0 in Sept 2005
updated for 1.7.1 in Jun 2006
Based on gnumeric source code and sample gnumeric documents
Author: Marc Johnson (marc_johnson27591@hotmail.com)
updated for 1.7.11 in Jun 2007 jody@gnome.org
</xsd:documentation>
</xsd:annotation>
......@@ -35,6 +37,11 @@
<xsd:element name="SheetNameIndex" type="gnm:SheetNameIndex" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Names" type="gnm:Names" minOccurs="0" maxOccurs="1"/>
<!-- Deprecated, moved to Calculation and expanded in 1.7.11
Valid value == 1904, anything else == Lotus:1900 -->
<xsd:element name="DateConvention" type="xsd:int" minOccurs="0" maxOccurs="1"/>
<!-- preferred height and width -->
<xsd:element name="Geometry">
<xsd:complexType>
......@@ -51,24 +58,34 @@
</xsd:element>
<xsd:element name="Calculation" minOccurs="0" maxOccurs="1">
<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: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:attribute name="DateConvention" type="gnm:DateConvention" use="optional" default="Lotus:1900"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<!-- version number should be v10 - - &gt;
<xsd:attribute name="gnm" type="gnm:namespace" use="required"/> -->
</xsd:complexType>
<!--
<xsd:simpleType name="namespace">
<!-- How values are mapped to dates. All date functions are affected -->
<xsd:simpleType name="DateConvention">
<xsd:restriction base="xsd:string">
<xsd:pattern value="http://www.gnome.org/gnumeric/v\d+"/>
<xsd:enumeration value="Lotus:1900"/>
<xsd:enumeration value="Apple:1904"/>
<!-- future values. currently treated as Lotus:1900 -->
<xsd:enumeration value="ODF:1899"/>
</xsd:restriction>
</xsd:simpleType>
-->
<xsd:simpleType name="CellRef">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[A-Z]+\d+"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="Names">
<xsd:sequence>
......@@ -151,6 +168,7 @@
<xsd:element name="MergedRegions" type="gnm:MergedRegions" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Filters" type="gnm:Filters" minOccurs="0" maxOccurs="1"/>
<xsd:element name="SheetLayout" type="gnm:SheetLayout"/>
<xsd:element name="SheetFormat" type="gnm:SheetLayout"/>
<xsd:element name="Solver" type="gnm:Solver"/>
<xsd:element name="Scenarios" type="gnm:Scenarios" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
......@@ -158,23 +176,36 @@
gnumeric, in this element, always generates 'true' or
'false' for its attributes
-->
<xsd:attribute name="DisplayFormulas" type="xsd:boolean" use="required"/>
<xsd:attribute name="HideZero" type="xsd:boolean" use="required"/>
<xsd:attribute name="HideGrid" type="xsd:boolean" use="required"/>
<xsd:attribute name="HideColHeader" type="xsd:boolean" use="required"/>
<xsd:attribute name="HideRowHeader" type="xsd:boolean" use="required"/>
<xsd:attribute name="DisplayOutlines" type="xsd:boolean" use="required"/>
<xsd:attribute name="OutlineSymbolsBelow" type="xsd:boolean" use="required"/>
<xsd:attribute name="OutlineSymbolsRight" type="xsd:boolean" use="required"/>
<xsd:attribute name="RTL_Layout" type="xsd:boolean" use="optional"/>
<xsd:attribute name="Protected" type="xsd:boolean" use="optional"/>
<xsd:attribute name="DisplayFormulas" type="xsd:boolean" use="optional" default="false"/>
<xsd:attribute name="HideZero" type="xsd:boolean" use="optional" default="false"/>
<xsd:attribute name="HideGrid" type="xsd:boolean" use="optional" default="false"/>
<xsd:attribute name="HideColHeader" type="xsd:boolean" use="optional" default="false"/>
<xsd:attribute name="HideRowHeader" type="xsd:boolean" use="optional" default="false"/>
<xsd:attribute name="DisplayOutlines" type="xsd:boolean" use="optional" default="true"/>
<xsd:attribute name="OutlineSymbolsBelow" type="xsd:boolean" use="optional" default="true"/>
<xsd:attribute name="OutlineSymbolsRight" type="xsd:boolean" use="optional" default="true"/>
<xsd:attribute name="RTL_Layout" type="xsd:boolean" use="optional" default="false"/>
<xsd:attribute name="Protected" type="xsd:boolean" use="optional" default="false"/>
<xsd:attribute name="TabColor" type="gnm:color" use="optional"/>
<xsd:attribute name="TabTextColor" type="gnm:color" use="optional"/>
<xsd:attribute name="ExprConvention" type="gnm:ExprConvention" use="optional" default="gnumeric:A1"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<!-- How expressions are _displayed_ no impact on evaluation -->
<xsd:simpleType name="ExprConvention">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="gnumeric:A1"/>
<xsd:enumeration value="gnumeric:R1C1"/>
<!-- future values, currently displayed as gnumeric:A1 -->
<xsd:enumeration value="ODF:A1"/>
<xsd:enumeration value="Lotus:A1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="PrintInformation">
<xsd:sequence>
<xsd:element name="Margins">
......
2007-07-13 Jody Goldberg <jody@gnome.org>
* ms-obj.c (ms_obj_read_biff8_obj) : send the actual record, not
the 4 byte header that loses 4 trailing bytes.
(ms_obj_map_forms_obj) : Use existing tools to properly handle
longer names and objects with data sources (combos/lists).
* xlsx-write.c (xlsx_write_calcPR) : new.
2007-07-09 Jody Goldberg <jody@gnome.org>
* xlsx-read.c (xlsx_CT_CalcPr) : new. Read the iterate and recalc
properties. Need to add the refmode.
* xlsx-write.c (xlsx_write_calcPR) : ditto.
(xlsx_write_workbook) : called from here.
2007-07-14 Jody Goldberg <jody@gnome.org>
Report form coverity.
......
......@@ -59,7 +59,7 @@ GNM_PLUGIN_MODULE_HEADER;
* >1 increasing levels of detail.
*/
gint ms_excel_read_debug = 0;
gint ms_excel_pivot_debug = 10;
gint ms_excel_pivot_debug = 0;
gint ms_excel_escher_debug = 0;
gint ms_excel_formula_debug = 0;
gint ms_excel_chart_debug = 0;
......
......@@ -4336,7 +4336,7 @@ static void
excel_read_CALCMODE (BiffQuery *q, GnmXLImporter *importer)
{
XL_CHECK_CONDITION (q->length == 2);
workbook_autorecalc_enable (importer->wb,
workbook_set_recalcmode (importer->wb,
GSF_LE_GET_GUINT16 (q->data) != 0);
}
......
......@@ -4222,7 +4222,7 @@ write_sheet_head (BiffPut *bp, ExcelWriteSheet *esheet)
ms_biff_put_2byte (bp, BIFF_CALCMODE, wb->recalc_auto ? 1 : 0);
ms_biff_put_2byte (bp, BIFF_CALCCOUNT, wb->iteration.max_number);
ms_biff_put_2byte (bp, BIFF_REFMODE, sheet->r1c1_addresses ? 0 : 1);
ms_biff_put_2byte (bp, BIFF_REFMODE, sheet->convs->r1c1_addresses ? 0 : 1);
ms_biff_put_2byte (bp, BIFF_ITERATION, wb->iteration.enabled ? 1 : 0);
data = ms_biff_put_len_next (bp, BIFF_DELTA, 8);
......
......@@ -999,7 +999,8 @@ ms_obj_read_biff8_obj (BiffQuery *q, MSContainer *c, MSObj *obj)
case GR_PICTURE_FORMULA :
/* Check for form objects stored here for no apparent reason */
ms_obj_map_forms_obj (obj, c, data, len);
if (obj->excel_type == 8)
ms_obj_map_forms_obj (obj, c, data+4, len);
break;
case GR_CHECKBOX_LINK :
......
......@@ -2083,6 +2083,51 @@ GSF_XML_IN_NODE_END
/****************************************************************************/
static void
xlsx_CT_CalcPr (GsfXMLIn *xin, xmlChar const **attrs)
{
static EnumVal const calcModes[] = {
{ "manual", FALSE },
{ "auto", TRUE },
{ "autoNoTable", TRUE },
{ NULL, 0 }
};
static EnumVal const refModes[] = {
{ "A1", TRUE },
{ "R1C1", FALSE },
{ NULL, 0 }
};
int tmp;
gnm_float delta;
XLSXReadState *state = (XLSXReadState *)xin->user_state;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (attr_enum (xin, attrs, XL_NS_SS, "calcMode", calcModes, &tmp))
workbook_set_recalcmode (state->wb, tmp);
else if (attr_bool (xin, attrs, XL_NS_SS, "fullCalcOnLoad", &tmp))
;
else if (attr_enum (xin, attrs, XL_NS_SS, "refMode", refModes, &tmp))
;
else if (attr_bool (xin, attrs, XL_NS_SS, "iterate", &tmp))
workbook_iteration_enabled (state->wb, tmp);
else if (attr_int (xin, attrs, XL_NS_SS, "iterateCount", &tmp))
workbook_iteration_max_number (state->wb, tmp);
else if (attr_float (xin, attrs, XL_NS_SS, "iterateDelta", &delta))
workbook_iteration_tolerance (state->wb, delta);
else if (attr_bool (xin, attrs, XL_NS_SS, "fullPrecision", &tmp))
;
else if (attr_bool (xin, attrs, XL_NS_SS, "calcCompleted", &tmp))
;
else if (attr_bool (xin, attrs, XL_NS_SS, "calcOnSave", &tmp))
;
else if (attr_bool (xin, attrs, XL_NS_SS, "conncurrentCalc", &tmp))
;
else if (attr_bool (xin, attrs, XL_NS_SS, "forceFullCalc", &tmp))
;
else if (attr_int (xin, attrs, XL_NS_SS, "concurrentManualCalc", &tmp))
;
}
static void
xlsx_sheet_begin (GsfXMLIn *xin, xmlChar const **attrs)
{
......@@ -2151,7 +2196,7 @@ GSF_XML_IN_NODE_FULL (START, START, -1, NULL, GSF_XML_NO_CONTENT, FALSE, TRUE, N
GSF_XML_IN_NODE_FULL (START, WORKBOOK, XL_NS_SS, "workbook", GSF_XML_NO_CONTENT, FALSE, TRUE, NULL, &xlsx_wb_end, 0),
GSF_XML_IN_NODE (WORKBOOK, VERSION, XL_NS_SS, "fileVersion", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (WORKBOOK, PROPERTIES, XL_NS_SS, "workbookPr", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (WORKBOOK, CALC_PROPS, XL_NS_SS, "calcPr", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (WORKBOOK, CALC_PROPS, XL_NS_SS, "calcPr", GSF_XML_NO_CONTENT, &xlsx_CT_CalcPr, NULL),
GSF_XML_IN_NODE (WORKBOOK, VIEWS, XL_NS_SS, "bookViews", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (VIEWS, VIEW, XL_NS_SS, "workbookView", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (WORKBOOK, SHEETS, XL_NS_SS, "sheets", GSF_XML_NO_CONTENT, NULL, NULL),
......@@ -2928,14 +2973,6 @@ xlsx_file_open (GOFileOpener const *fo, IOContext *context,
}
/* TODO * TODO * TODO
*
* Named expressions
* rich text
* validation
* workbook/calc properties
* more print settings
* comments
* text direction in styles
*
* IMPROVE
* - column widths : Don't use hard coded font side
......
......@@ -736,6 +736,26 @@ xlsx_write_sheet (XLSXWriteState *state, GsfOutfile *dir, GsfOutfile *wb_part, u
return rId;
}
static void
xlsx_write_calcPR (XLSXWriteState *state, GsfXMLOut *xml)
{
Workbook const *wb = state->base.wb;
#warning Filter by defaults
gsf_xml_out_start_element (xml, "calcPr");
gsf_xml_out_add_cstr_unchecked (xml, "calcMode",
wb->recalc_auto ? "auto" : "manual");
xlsx_add_bool (xml, "iterate", wb->iteration.enabled);
gsf_xml_out_add_int (xml, "iterateCount",
wb->iteration.max_number);
gsf_xml_out_add_float (xml, "iterateDelta",
wb->iteration.tolerance, -1);
gsf_xml_out_end_element (xml);
}
static void
xlsx_write_workbook (XLSXWriteState *state, GsfOutfile *root_part)
{
......@@ -796,6 +816,8 @@ xlsx_write_workbook (XLSXWriteState *state, GsfOutfile *root_part)
}
gsf_xml_out_end_element (xml); /* </sheets> */
xlsx_write_calcPR (state, xml);
gsf_xml_out_start_element (xml, "webPublishing");
gsf_xml_out_add_int (xml, "codePage", 1252); /* FIXME : Use utf-8 ? */
gsf_xml_out_end_element (xml);
......
......@@ -1335,7 +1335,7 @@ gnumeric_info (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/* Current recalculation mode; returns "Automatic" or "Manual". */
Workbook const *wb = ei->pos->sheet->workbook;
return value_new_string (
workbook_autorecalc (wb) ? _("Automatic") : _("Manual"));
workbook_get_recalcmode (wb) ? _("Automatic") : _("Manual"));
} else if (!g_ascii_strcasecmp (info_type, "release")) {
/* Version of Gnumeric (Well, Microsoft Excel), as text. */
return value_new_string (GNUMERIC_VERSION);
......
2007-07-22 Jody Goldberg <jody@gnome.org>
Coverity reports 68-70.
* functions.c (gnumeric_linest) : init nx in the ARRAY case to make
coverity happy and make the code clearer.
(gnumeric_logreg) : ditto.
(gnumeric_logest) : ditto.
2007-07-20 Andreas J. Guelzow <aguelzow@pyrshep.ca>
......
......@@ -4043,7 +4043,7 @@ gnumeric_linest (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
gnm_float **xss = NULL, *ys = NULL;
GnmValue *result = NULL;
int nx, ny, dim, i;
int xarg = 0;
int xarg = 1;
gnm_float *linres = NULL;
gboolean affine, stat, err;
enum {
......@@ -4088,23 +4088,19 @@ gnumeric_linest (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
if (argv[1] == NULL || (ytype == ARRAY && argv[1]->type != VALUE_ARRAY) ||
(ytype != ARRAY && argv[1]->type != VALUE_CELLRANGE)){
xarg = 0;
dim = 1;
xss = g_new (gnm_float *, 1);
xss[0] = g_new (gnm_float, ny);
for (nx = 0; nx < ny; nx++)
xss[0][nx] = nx + 1;
}
else if (ytype == ARRAY){
xarg = 1;
/* Get xss from array argument argv[1] */
}
else if (ytype == SINGLE_COL){
int firstcol, lastcol;
GnmValue *copy;
xarg = 1;
firstcol = argv[1]->v_range.cell.a.col;
lastcol = argv[1]->v_range.cell.b.col;
} else if (ytype == ARRAY){
/* Get xss from array argument argv[1] */
nx = 0;
} else if (ytype == SINGLE_COL){
GnmValue *copy = value_dup (argv[1]);
int firstcol = argv[1]->v_range.cell.a.col;
int lastcol = argv[1]->v_range.cell.b.col;
if (firstcol > lastcol) {
int tmp = firstcol;
firstcol = lastcol;
......@@ -4112,7 +4108,6 @@ gnumeric_linest (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
}
dim = lastcol - firstcol + 1;
copy = value_dup (argv[1]);
xss = g_new (gnm_float *, dim);
for (i = firstcol; i <= lastcol; i++){
copy->v_range.cell.a.col = i;
......@@ -4134,14 +4129,10 @@ gnumeric_linest (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
}
}
value_release (copy);
}
else if (ytype == SINGLE_ROW){
int firstrow, lastrow;
GnmValue *copy;
xarg = 1;
firstrow = argv[1]->v_range.cell.a.row;
lastrow = argv[1]->v_range.cell.b.row;
} else if (ytype == SINGLE_ROW){
GnmValue *copy = value_dup (argv[1]);
int firstrow = argv[1]->v_range.cell.a.row;
int lastrow = argv[1]->v_range.cell.b.row;
if (firstrow < lastrow) {
int tmp = firstrow;
firstrow = lastrow;
......@@ -4149,7 +4140,6 @@ gnumeric_linest (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
}
dim = lastrow - firstrow + 1;
copy = value_dup (argv[1]);
xss = g_new (gnm_float *, dim);
for (i = firstrow; i <= lastrow; i++){
copy->v_range.cell.a.row = i;
......@@ -4171,9 +4161,7 @@ gnumeric_linest (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
}
}
value_release (copy);
}
else { /*Y is none of the above */
xarg = 1;
} else { /*Y is none of the above */
dim = 1;
xss = g_new (gnm_float *, dim);
xss[0] = collect_floats_value (argv[1], ei->pos,
......@@ -4320,10 +4308,10 @@ static GnmFuncHelp const help_logreg[] = {
static GnmValue *
gnumeric_logreg (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
gnm_float **xss = NULL, *ys = NULL;
GnmValue *result = NULL;
gnm_float **xss = NULL, *ys = NULL;
GnmValue *result = NULL;
int nx, ny, dim, i;
int xarg = 0;
int xarg = 1;
gnm_float *logreg_res = NULL;
gboolean affine, stat, err;
enum {
......@@ -4368,22 +4356,19 @@ gnumeric_logreg (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
if (argv[1] == NULL || (ytype == ARRAY && argv[1]->type != VALUE_ARRAY) ||
(ytype != ARRAY && argv[1]->type != VALUE_CELLRANGE)){
xarg = 0;
dim = 1;
xss = g_new (gnm_float *, 1);
xss[0] = g_new (gnm_float, ny);
for (nx = 0; nx < ny; nx++)
xss[0][nx] = nx + 1;
}
else if (ytype == ARRAY){
xarg = 1;
} else if (ytype == ARRAY) {
/* Get xss from array argument argv[1] */
}
else if (ytype == SINGLE_COL){
int firstcol, lastcol;
GnmValue *copy;
xarg = 1;
firstcol = argv[1]->v_range.cell.a.col;
lastcol = argv[1]->v_range.cell.b.col;
nx = 0;
} else if (ytype == SINGLE_COL) {
GnmValue *copy = value_dup (argv[1]);
int firstcol = argv[1]->v_range.cell.a.col;
int lastcol = argv[1]->v_range.cell.b.col;
if (firstcol < lastcol) {
int tmp = firstcol;
......@@ -4392,7 +4377,6 @@ gnumeric_logreg (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
}
dim = lastcol - firstcol + 1;
copy = value_dup (argv[1]);
xss = g_new (gnm_float *, dim);
for (i = firstcol; i <= lastcol; i++){
copy->v_range.cell.a.col = i;
......@@ -4414,13 +4398,10 @@ gnumeric_logreg (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
}
}
value_release (copy);
}
else if (ytype == SINGLE_ROW){
int firstrow, lastrow;
GnmValue *copy;
xarg = 1;
firstrow = argv[1]->v_range.cell.a.row;
lastrow = argv[1]->v_range.cell.b.row;
} else if (ytype == SINGLE_ROW) {
GnmValue *copy = value_dup (argv[1]);
int firstrow = argv[1]->v_range.cell.a.row;
int lastrow = argv[1]->v_range.cell.b.row;
if (firstrow < lastrow) {
int tmp = firstrow;
......@@ -4429,7 +4410,6 @@ gnumeric_logreg (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
}
dim = lastrow - firstrow + 1;
copy = value_dup (argv[1]);
xss = g_new (gnm_float *, dim);
for (i = firstrow; i <= lastrow; i++){
copy->v_range.cell.a.row = i;
......@@ -4451,9 +4431,7 @@ gnumeric_logreg (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
}
}
value_release (copy);
}
else { /*Y is none of the above */
xarg = 1;
} else { /*Y is none of the above */
dim = 1;
xss = g_new (gnm_float *, dim);
xss[0] = collect_floats_value (argv[1], ei->pos,
......@@ -4800,10 +4778,10 @@ static GnmFuncHelp const help_logest[] = {
static GnmValue *
gnumeric_logest (GnmFuncEvalInfo *ei, GnmValue const * const *argv)