Ben Pfaff [Sat, 12 Jan 2013 17:43:18 +0000 (09:43 -0800)]
cairo: Include command name in error messages.
Commit ddb7b52128d8 (output: Make errors, warnings, and notes into a new
"message_item".) changed command name tracking to a responsibility of
individual output drivers, and converted the output drivers to do it.
However, the conversion of the cairo driver was incomplete. This commit
fixes that problem.
John Darrington [Sun, 6 Jan 2013 18:14:32 +0000 (19:14 +0100)]
Fixed a bug reading gnumeric files.
Some gnumeric files use <gnm:Name> tags for miscellaneous purposes. Our code
had always assumed that it represented the name of the Sheet. Hence these files
would read the wrong sheet of a workbook. This change fixes it. Closes 38028
Ben Pfaff [Fri, 4 Jan 2013 05:34:25 +0000 (21:34 -0800)]
identifier: Broaden the class of characters allowed in identifiers.
It appears that SPSS allows almost any Unicode character in an identifier,
and particular U+00B4 ACUTE ACCENT. This commit adds more permitted
characters to the identifier checks.
Reported by Helen Barghan <kenny4president@web.de>.
Ben Pfaff [Wed, 2 Jan 2013 06:06:59 +0000 (22:06 -0800)]
expressions: Fix dependency on current year in tests.
The tests for expressions broke on Jan 1, 2013 because the default epoch
depends on the current year. This commit fixes the tests by setting a
fixed epoch for dates.
Ben Pfaff [Wed, 2 Jan 2013 03:18:31 +0000 (19:18 -0800)]
perl-module: Rename sysfile_info to syswriter_info.
This module had sysfile_info and sysreader_info. The former was a writer,
the latter a reader. I found the asymmetric names a little confusing, so
this commit renames them more consistently.
John Darrington [Tue, 1 Jan 2013 17:32:03 +0000 (18:32 +0100)]
Update tests to reflect change in EXAMINE / EXTREME behaviour.
Commit bd156adaff5b7c1bbe48b5c64006ead58d9a37d6 slightly changed the
behaviour of the EXTREME subcommand of the EXAMINE procedure, but the
tests did not reflect this.
This change updates the tests accordingly. Thanks to Zoltan Fabian
for confirming which was the correct behaviour.
John Darrington [Mon, 31 Dec 2012 10:33:38 +0000 (11:33 +0100)]
Remove assertions which compare the sum of weights between passes.
These asserted that the sum of case-weights of a dataset calculated
in one pass, was the same as that calculated in a second pass.
Algebraically this is correct. However, for optimisation purposes,
it is sometimes desireable that the second pass occurs after the
data has been reordered. If that happens, the sum of weights can
be slightly different due to floating point rounding errors. This
happens particularly when the caseweights are fractional.
Ben Pfaff [Fri, 28 Dec 2012 05:17:43 +0000 (21:17 -0800)]
csv-file-writer: Fix implementation of decimal point option.
Now that pspp sets LC_NUMERIC, dtoastr() might yield either '.' or ',' as
the decimal point, so the CSV writer needs to check for either one and
replace it by the decimal point requested by the caller.
Ben Pfaff [Fri, 28 Dec 2012 03:32:40 +0000 (19:32 -0800)]
Use UTF-8 case-insensitive hashes and comparisons for language identifiers.
The PSPP language has case-insensitive identifiers (variable names, etc.)
but until now it has only implemented case insensitivity for ASCII
characters. This commit properly implements case insensitivity for all
Unicode characters, using libunistring.
Ben Pfaff [Wed, 26 Dec 2012 03:09:12 +0000 (19:09 -0800)]
Use "C" locale comparisons for language constructs.
These language constructs are ASCII so there's no need for a
locale-independent comparison and it seems to me that one would not make
sense in edge cases.
John Darrington [Mon, 10 Dec 2012 17:32:25 +0000 (18:32 +0100)]
Set the LC_NUMERIC locale category on startup.
Previously, for rather unsatisfactory reasons, pspp and psppire set all locale
categories except LC_NUMERIC. The reasons for doing this have now been
resolved. So this change sets all locale categories including LC_NUMERIC.
Ben Pfaff [Mon, 24 Dec 2012 22:18:01 +0000 (14:18 -0800)]
u8-line: Add new u8_line_set_length() function.
The other functions in the u8-line library come directly from the ASCII
output driver. This function is new, so I broke it into this separate
commit to emphasize that.
John Darrington [Sat, 22 Dec 2012 16:40:09 +0000 (17:40 +0100)]
str.c: New functions ds_put_c_vformat and ds_put_c_format
Added a new printf-like functions which are locale independent.
Added this new function, and changed syntax_gen_pspp_valist to use it.
Rationale: syntax generation should never be locale dependent.
This function used *printf with a %f directive, which under certain
locales would have generated a string like "270,00x210,00mm" which the
print driver would have rejected.
This change uses the newly available c_xasprintf function from gnulib
to alleviate this problem.
Ben Pfaff [Tue, 27 Nov 2012 05:15:02 +0000 (21:15 -0800)]
histogram: Add missing #include.
Commit 02b9b37698eb "Disable asserts in histogram code except in
--testing-mode" added a use of settings_get_testing_mode() but didn't
include the proper header. This fixes the problem.
John Darrington [Mon, 26 Nov 2012 20:09:08 +0000 (21:09 +0100)]
Disable asserts in histogram code except in --testing-mode
The assertions in histogram.c are algebraically correct,
but due to floating point errors may not actually be true.
This change disables them except when in testing mode.
The tests in charts.at rely upon them being enabled.
Closes bug #36395
Ben Pfaff [Mon, 26 Nov 2012 07:04:50 +0000 (23:04 -0800)]
DESCRIPTIVES: Make Z score calculation honor SPLIT FILE.
Until now, DESCRIPTIVES has not supported SPLIT FILE in Z score
calculations. That is, Z scores have been calculated on the basis of a
single group for the entire file, which doesn't make any sense. This
commit properly implements Z score calculation on a per-split group basis.
Ben Pfaff [Sun, 25 Nov 2012 17:04:54 +0000 (09:04 -0800)]
Remove feature to automatically connect to GDB when debugging is enabled.
This feature caused a few problems in "make check" on some distributions
when debugging was enabled at compile time. It is probably possible to
find and fix those particular problems, but the feature itself is
little-used, so this commit instead removes it.
Ben Pfaff [Sun, 25 Nov 2012 05:41:00 +0000 (21:41 -0800)]
psppire-data-window: Only allow saving a file with at least one variable.
A data file with no variables can't be saved to a file. Until now, this
wasn't detected until the user had already chosen a file name, and the
message used to report it was confusing: "SAVE is allowed only after the
active file has been defined." With this commit, the menu item and toolbar
item for save operations is, instead, disabled if the file has no
variables.
Bug #30700.
Reported by eric thivant, via Harry Thijssen, with help from Michel
Boaventura.
Ben Pfaff [Sun, 25 Nov 2012 01:50:05 +0000 (17:50 -0800)]
DATA LIST: Accept freefield format types without widths use minimum width.
A user reported that SPSS accepts syntax such as "DATA LIST FREE/
d (DATETIME)." using a default width for the field with no specified width.
This commit makes PSPP accept this syntax too, although it does not get
the width exactly right (please let me know if you figure out how to do
that).
Ben Pfaff [Sun, 25 Nov 2012 01:26:38 +0000 (17:26 -0800)]
format-parser: Improve error message when format specifier lacks width.
Until now, parse_format_specifier() was willing to parse, e.g. "datetime"
as a format specifier. It would then be rejected later by e.g.
fmt_check_input() with a message like "Input format DATETIME0.0 specifies
width 0, but DATETIME requires a width between 17 and 40," which makes no
sense to the user. This commit improves the error message.
Ben Pfaff [Sat, 24 Nov 2012 23:51:33 +0000 (15:51 -0800)]
data-parser: Use data-file error types for data-file errors.
The SW error type that these calls to msg() used before this command
include the name of the executing command in the error message. This can
be confusing because the executing command may not have any connection to
the command that said to read the data file. This commit changes these
error types to DW, which is intended for errors in a data file (and omits
the command name).
Ben Pfaff [Sat, 24 Nov 2012 22:14:16 +0000 (14:14 -0800)]
INPUT PROGRAM: Don't break out of INPUT PROGRAM on interactive error.
Until now, any erroneous command typed within an input program at an
interactive command prompt implicitly "broke out" of the input program,
causing confusing behavior. This commit fixes the problem: commands
following an erroneous command within INPUT PROGRAM continue to be part of
the input program.
Ben Pfaff [Sat, 24 Nov 2012 21:47:06 +0000 (13:47 -0800)]
DATA LIST FREE: Warn when a quoted string is not followed by a delimiter.
A field parsed by DATA LIST FREE (or LIST) is either quoted or unquoted.
When it is quoted, this means that the entire field has to be quoted, that
is, it is not possible to quote some initial part of the field, then leave
some part of it unquoted (then possibly quote an additional part, etc.).
That means that the quoted portion should be followed by a delimiter,
such as white space, a comma, or end of line, but PSPP didn't warn when
it was not. This commit makes PSPP warn in this situation, which makes
errors in the input easier to find.
Bug #26522.
Reported by Pascal Barbedor <pbarbedor@gmail.com>.
Ben Pfaff [Sat, 24 Nov 2012 20:03:42 +0000 (12:03 -0800)]
output: Make default output file name depend on the format.
Before this commit, "-O html" caused HTML output to be written to a file
named "-", which is confusing. After this commit, it is written to a file
named "pspp.html". Similarly for other output drivers, except that text
and CSV output are still written to stdout by default.
John Darrington [Fri, 23 Nov 2012 18:49:03 +0000 (19:49 +0100)]
Refactoring: common function set_sensitivity from toggle
Many dialog boxes have a signal handler to set the sensitivity
of a widget, according to the state of a toggle button. Until
now, they had all written their own.
John Darrington [Fri, 23 Nov 2012 08:01:36 +0000 (09:01 +0100)]
Logistic Regression: Ignore cases with missing dependent variables.
Prior to this change, cases with missing values in the predictor
variables were ignored, but cases with missing values only in the
dependent variable would provoke an error. Subsequent to this change
such cases are also ignored. This seems to be the behaviour of other
software, despite what their documentation may suggest.
John Darrington [Wed, 21 Nov 2012 21:13:27 +0000 (22:13 +0100)]
Logistic Regression: Calculate the logs of the likelihood instead of the raw value.
The likelihood values can become extremely large which can result in
lost precision in a double. This change therefore calculates the
logarithms of the likelihoods instead of their actual value.