John Darrington [Fri, 8 Mar 2013 13:03:12 +0000 (14:03 +0100)]
New module: psppire-spreadsheet-model.c
Provides an implementation of a GtkTreeModel which can be used to
display the meta data of Gnumeric or Opendocument spreadsheet files.
Potentially, other spreadsheet files could be added too.
Used for upcomming gui features.
Ben Pfaff [Sun, 3 Mar 2013 06:28:09 +0000 (22:28 -0800)]
pspp-sheet-view: Get rid of ctrl_pressed and shift_pressed.
Having these as member variables made it hard to keep key
press status separate from whether we want to extend or
toggle row selection. Most of the time, these are the
same, but there are some cases (e.g. Shift+Tab) where they
don't coincide, and an upcoming commit will add another
case.
John Darrington [Wed, 13 Feb 2013 12:03:00 +0000 (13:03 +0100)]
Examine vs. Boxplots: Avoid labels overlapping one another
One factored boxplots remove the name of the factor variables, since
these can be inferred from the chart title. Also trim off any
leading whitespace from the values. This reduces the chances of the
labels clashing with one another when many boxplots appear on the
same chart.
When exporting the output viewer using the file chooser, automatically append
a . and a three letter suffix indicating the format of the export.
Closes bug #38133
Ben Pfaff [Tue, 5 Feb 2013 06:40:50 +0000 (22:40 -0800)]
psppire-window: Avoid doubled separator in Windows menu.
John Darrington noticed that sometimes the separator was doubled in the
Windows menu. It seems that the code for detecting that we've already
added the separator was unreliable, because it would re-add the separator
if the number of windows increased from zero, dropped to zero, and then
increased again.
Ben Pfaff [Mon, 4 Feb 2013 08:03:56 +0000 (00:03 -0800)]
pspp-sheet-view: Make Control+Left, Control+Right go to ends of lines.
John Darrington reported that, in Gnumeric, Control+Left goes to the first
column and Control+Right goes to the last column. This commit changes
the data sheet to do the same
Ben Pfaff [Thu, 31 Jan 2013 07:03:29 +0000 (23:03 -0800)]
RANK: Adopt a new ranking implementation.
Before this commit, the implementation of RANK made multiple passes
through the active file, opening and closing it (with proc_open()
and proc_commit()) as many times as there were input variables.
This worked in simple cases, but it could never work with
TEMPORARY since the second proc_open() will see a different set
of data from the first one.
This commit rewrites RANK to open and read the active file only
once. It does not make RANK properly work with TEMPORARY, but
it brings it much closer. It may also be faster in some cases
because, although it makes the same number of passes through
the input data (necessarily), each pass discards all the input
columns except the ones that are really need for that pass.
Ben Pfaff [Thu, 31 Jan 2013 06:51:02 +0000 (22:51 -0800)]
RANK: Create all variables together, in order.
An upcoming commit will rewrite the RANK implementation so that the
new variables are not created until after a pass through the data.
(This makes sense because their values cannot actually be determined
until that pass is complete, so there is no point in allocating space
for them in cases.) To do that, it is necessary to figure out the
variable names (and that they will be valid variable names) in
advance. This commit switches to that approach in advance.
This approach has another small advantage: the order of the variables
added by RANK to the dictionary does not depend on whether the
variables are named by the user or by generating a name. (This
is why the rank.at test case changes.)
Ben Pfaff [Tue, 29 Jan 2013 06:54:18 +0000 (22:54 -0800)]
transformations: Relax the rules for transformation finalizing.
The trns_chain data structure has a barely useful concept called
"finalization". In practice this is used to make sure that control
structures (e.g. DO IF) that are opened get closed (e.g. END IF). There
are currently some restrictions on finalizing: namely, transformations
can't be added after a chain is finalized. Since finalizers are barely
used, we can relax this restriction, which this commit does. This will be
used in an upcoming commit where the ability to add a transformation to a
finalized change becomes useful for a corner case.
John Darrington [Mon, 28 Jan 2013 18:00:29 +0000 (19:00 +0100)]
Ensure that RELIABILITY is always fully constructed.
Commit e94a39ff572a51907545497c26faccdf4b2c5ada added a 'no crash' test
checking that RELIABILITY's destructor didn't cause any problems when
the procedure was presented with invalid syntax. Unfortunately the
associated fix was only half done. The scale_name variable was being
destroyed when it hadn't been initialised. This change fixes that.
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.