John Darrington [Sun, 28 Apr 2013 07:15:28 +0000 (09:15 +0200)]
Fix recently introduces bug in LIST /CASES
Commit 4e5a6cc044c6c82e6c4d842bf056579b6bc47d48 contained a bug. This change
corrects the bug, and updates a test, such that the bug will be caught, should
it ever reappear.
Ben Pfaff [Fri, 26 Apr 2013 06:03:45 +0000 (23:03 -0700)]
FLIP: Fix use-after-free error with temporary transformations.
The FLIP procedure keeps a reference to the dictionary from before running
a procedure and then uses that reference after calling proc_commit(). When
temporary transformations are present, this dictionary disappears. The
"SPLIT FILE - vs procedures" test triggers this issue because it uses
FILTER, which is implemented as a temporary transformation.
This commit fixes the problem by avoiding a reference to the old
dictionary after proc_commit().
Ben Pfaff [Thu, 25 Apr 2013 05:26:06 +0000 (22:26 -0700)]
u8-istream: Fix reading UTF-16 and UTF-32 files.
Before this commit, u8_istream_for_fd() would obtain the correct encoding
from encoding_guess_head_encoding() for UTF-16 and UTF-32 files, and then
it would ignore it and use the default encoding returned by
encoding_guess_parse_encoding(). This commit fixes the problem.
John Darrington [Sun, 14 Apr 2013 11:36:42 +0000 (13:36 +0200)]
Terminal reader: Interruptable command line interface
This change alters the behaviour of the command line interface such that
upon receiving SIGINT, instead of immediately aborting, the current command
being read will be interrupted and a new PSPP> prompt appears.
Ben Pfaff [Sun, 7 Apr 2013 22:06:35 +0000 (15:06 -0700)]
AUTORECODE: Avoid use-after-free error with TEMPORARY.
When TEMPORARY is in effect, proc_commit() destroys the temporary
dictionary. This means that any procedure that does not somehow disable
temporary transformations and refers to a variable following proc_commit()
has a use-after-free error.
Until now, AUTORECODE had this problem. This commit fixes it and adds a
test.
Ben Pfaff [Sun, 7 Apr 2013 19:57:32 +0000 (12:57 -0700)]
ascii: Omit whitespace at the end of a line.
Long string variables tend not to be completely filled with data, which
means that they end in a lot of spaces. The ASCII output driver didn't
handle these well. Instead, it put a blank line in the cell for each
trailing space.
Ben Pfaff [Sun, 7 Apr 2013 17:06:23 +0000 (10:06 -0700)]
CORRELATIONS: Fix crash with separate sets of row and column variables.
When WITH is specified, the column variables start at offset corr->n_vars1
within corr->vars. The calculation previously used here was incorrect and
caused an access beyond the end of the corr->vars array.
The code would be clearer if there were separate row_vars and col_vars
arrays, but that would be a larger change.
Ben Pfaff [Thu, 4 Apr 2013 16:26:03 +0000 (11:26 -0500)]
RELIABILITY: Fix memory leaks and dereferences of uninitialized pointers.
The 'total' struct and 'm' array in struct reliability were allocated once
per case group, but freed exactly once. If there were no case groups,
this caused a null dereference. If there was more than one case group,
this caused a memory leak. This commit fixes both problems.
This commit also fixes a related crash on bad syntax due to dereferencing
a null pointer in reliability_destroy().
John Darrington [Mon, 1 Apr 2013 05:34:28 +0000 (07:34 +0200)]
Work-around bug in GCC 4.4.5
Gcc 4.4.5 seems to be buggy. For some reason it miscompiles the code in
casereader_count_cases__ when compiled with -O2 by not allocating enough
stack. This commit works around that problem by putting a dummy variable
on the stack.
John Darrington [Sun, 31 Mar 2013 17:27:34 +0000 (19:27 +0200)]
ONEWAY /POSTHOC: Annotate output with dependent variable
The Multiple Comparisons table did not specify the variable to which it refered. This could be confusing
if more than one variable was specified.
Fixes bug #38635
John Darrington [Fri, 29 Mar 2013 11:13:43 +0000 (12:13 +0100)]
Fix order of text-import subdialogs.
Commit 29c1450251805417aacb9cecc84b03c81137c137 inadvertently reversed the
order of display of the the first-line and seperator subdialogs. Amoung
other problems, this meant that controls of the former were no longer
respected. This change restores the original order.
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.
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 [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.