Ben Pfaff [Sat, 13 Sep 2014 17:24:59 +0000 (10:24 -0700)]
render: Introduce render_pager to factor out code from drivers.
The render_break abstraction requires quite a bit of assistance from
drivers. By introducing a high-level render_pager abstraction we factor
out a bit of common code. Future refinements will allow putting more and
more functional in the common "render" interface.
Ben Pfaff [Tue, 9 Sep 2014 15:51:44 +0000 (08:51 -0700)]
u8-istream: Fix handling of partial reads.
The u8-istream code did not retry upon a partial read, assuming that that
was the end of the file. When the partial read was shorter than
ENCODING_GUESS_MIN, this could cause the encoding guesser, in turn, to
guess the wrong encoding (especially if the encoding was really UTF-16 and
the partial read was an odd number of bytes).
Reported at https://bugs.debian.org/760841.
Reported by Friedrich Beckmann and Steven Chamberlain.
Ben Pfaff [Thu, 4 Sep 2014 04:03:06 +0000 (21:03 -0700)]
zip-writer: Write size and CRC in local directory when possible.
Google Drive rejects ODT files as corrupted unless their size and CRC are
in local file headers, even though the zip file specification says that it
is OK for them to follow the file data. Thus, this commit changes the
zip writer to satisfy Google unless the output file is not seekable.
Ben Pfaff [Mon, 1 Sep 2014 00:57:29 +0000 (17:57 -0700)]
psppire-dialog-action-var-info: Only allow "Jump To" with one variable.
Until now, when at least one variable was selected, the user could click
on "Jump To", which would jump to the first selected variable. This commit
changes behavior so that "Jump To" is only enabled when exactly one
variable is selected, which makes it a lot less confusing about which
variable will be jumped to.
Suggested by Bastián Díaz <diaz.bastian@ymail.com> .
Ben Pfaff [Tue, 26 Aug 2014 01:08:06 +0000 (18:08 -0700)]
output: Make it possible to push and pop output engines.
This makes it possible to temporarily push a different set of output
drivers, which in turn makes it possible to do output as a pane within a
dialog or other window.
Ben Pfaff [Sun, 17 Aug 2014 17:40:56 +0000 (10:40 -0700)]
tests: Refactor rendering tests.
This will make it easier to test nested tables when support for them is
added in an upcoming commit, because it becomes possible to include
multiple of the complicated test tables in one file easily.
John Darrington [Sat, 9 Aug 2014 11:11:07 +0000 (13:11 +0200)]
Pspp.t: Sort value labels before comparing them.
This test failed on some platforms because it was iterating a hash. The
order of an iterated hash is undefined. This change sorts before comparing
thus avoiding the problem.
Ben Pfaff [Tue, 22 Jul 2014 04:56:39 +0000 (21:56 -0700)]
render: Rename 'cell' variables used for breaking to 'z'.
Upcoming changes will add an instance of a struct table_cell in
render_break_next(), whose name is naturally 'cell', so 'z' is a better
name for a cell index along the current axis.
Ben Pfaff [Sun, 20 Jul 2014 00:44:30 +0000 (17:44 -0700)]
render: Fix rendering corner cases when a cell is broken across pages.
The rendering code ability to break individual cells across multiple pages
has never received good test coverage because the criteria for doing that
are strict enough that the testsuite hardly ever does it. This commit adds
a "--min-break=0" version to each test in the testsuite, which uncovers a
number of bugs in the cell breaking code. It also fixes those bugs.
Ben Pfaff [Sun, 13 Jul 2014 17:47:43 +0000 (10:47 -0700)]
render: Don't add overflows when header is contiguous with body.
render_page_select() needs to calculate overflows when it cuts a header off
from the body of a table. Until now, it has considered headers and body to
always be cut off from each other, but this isn't true when the selected
body region is adjacent to one of the headers. This commit takes that into
consideration, producing better results in one of the tests in the
testsuite.
This commit is much smaller when viewed with whitespace changes ignored.
Ben Pfaff [Sun, 13 Jul 2014 17:41:13 +0000 (10:41 -0700)]
table-select: Only cut headers into two if needed in table_select_slice().
Until now, when including headers in the table it returns,
table_select_slice() has always either returned the entire original table
or a set of chunks: left header, selected body, right header. However, it
is possible to do better when the selected body includes all the cells
up to, say, the right header: then you only need a single chunk to include
the body and the right header. Besides saving memory, this also has the
advantage that, if a joined cell crosses between the body and the header,
it is not cut into two pieces by chunking. It doesn't make too much sense
to join a cell across body and header, but this still makes it easier to
render better if someone does that.
The testsuite includes a few tables that do join a cell across body and
header. This commit improves the output for one and changes some ugly
output to different ugly output for another. Additional changes in an
upcoming commit fix the latter and some other tables too.
Ben Pfaff [Tue, 24 Jun 2014 05:20:31 +0000 (22:20 -0700)]
cairo: Fix failures to scale between cairo and pango units.
The difference between Cairo and Pango units, as currently defined by
XR_POINT and PANGO_SCALE, is only 2.4% (1000 versus 1024). This makes the
difference rarely noticeable, and easy to miss when casually looking at
output. However, while continuing to develop the PSPP output drivers, I
did notice.
To make the difference obvious, I temporarily changed XR_POINT from 1000
to 500. This commit fixes the problems that this revealed.
Ben Pfaff [Sun, 25 May 2014 22:37:15 +0000 (15:37 -0700)]
variable: Report only changes in width that actually change it.
For me, this fixes the problem reported by Fran A. <pacodea2001@yahoo.es>
when I resize the width of the second variable in a data file provided
by John Darrington.
Ben Pfaff [Sun, 4 May 2014 18:45:22 +0000 (11:45 -0700)]
CROSSTABS: Add tests for Pearson's R, and update documentation.
PSPP seems to calculate Pearson's R values correctly, despite the
documentation that said otherwise. I don't have any remaining notes for
why the documentation said this, so I'm removing the claim that PSPP does
not calculate Pearson's R correctly.
John Darrington [Sat, 26 Apr 2014 05:33:08 +0000 (07:33 +0200)]
FREQUENCIES: Fixed crash showing histograms of limited range.
We had been using Freedman-Diaconis rule to select the bin width.
According to the literature this is better than Sturges rule.
However it cannot work when the interquartile range is zero, which
will happen for datasets with small range.
This change uses the Freedman-Diaconis rule and falls back to
Sturges when the IQR is zero.
Ben Pfaff [Fri, 4 Apr 2014 04:59:47 +0000 (21:59 -0700)]
psppire-syntax-window: Recode file from final encoding, not original one.
When syntax_load() reads a syntax file, it can guess the correct encoding
using encoding_guess_whole_file(). When it does that, it's supposed to
use the guessed encoding to recode the file data into UTF-8. In fact, it
was using the original (NULL or "") encoding, which didn't work out well.
This commit makes it use the guessed encoding.
John Darrington [Sat, 29 Mar 2014 07:12:43 +0000 (08:12 +0100)]
T-TEST: Fixed a bug in reporting the independent samples std err of the difference
The standard error of the difference and the confidence interval
for the unequal variances case was reported where the equal variances
case should have been. This change fixes that.
Reported by: Michael Schneider <m-schneider.klh@uni-wuerzburg.de>
Ben Pfaff [Sun, 9 Mar 2014 23:01:25 +0000 (16:01 -0700)]
line-reader: Fix bad math when size_t is bigger than off_t.
When size_t is bigger than off_t, pos - r->length will end up very large,
instead of negative, when r->length > pos, so the MAX didn't help to get
rid of negative values. I'm not sure that this should really happen in
practice, but it's better to avoid it.
John Darrington [Sat, 22 Feb 2014 14:07:31 +0000 (15:07 +0100)]
Fixed bug importing ODS files.
There was a typo which caused the import of ODS files in the gui to
not properly function. This change fixes the typo, but also re-arranges
the code such that similar errors are less likely to go unnoticed in the
future. It also brings the code more in concord with the GNU Coding
Standards (which were written that way exactly to prevent these errors).