Ben Pfaff [Mon, 8 Dec 2014 06:34:21 +0000 (22:34 -0800)]
command: Fix delayed execution of FINISH.
PSPP delayed the execution of FINISH until it read the first token
of the next command. This commit changes it to execute immediately,
as one would expect..
Ben Pfaff [Mon, 8 Dec 2014 06:13:44 +0000 (22:13 -0800)]
README.Git: Upgrade recommended Gnulib version.
Harry Thijssen reported that the older version of Gnulib failed to
build (in msvc-inval.c) on Windows, but that the newer version built
fine with the exception of the error that should have been fixed by
the previous commit.
Ben Pfaff [Mon, 8 Dec 2014 06:10:54 +0000 (22:10 -0800)]
lexer: Include <unistd.h> to ensure 'read' is consistently replaced.
On some platforms, Gnulib #defines read to rpl_read. The lexer uses
an unreleated function pointer member named 'read' in struct
lex_reader_class. It doesn't really matter whether this name gets
replaced with rpl_read as long as it always happens consistently.
Adding "#include <unistd.h>" to lexer.h should ensure that.
Ben Pfaff [Sat, 18 Oct 2014 19:11:34 +0000 (12:11 -0700)]
cairo: Add .5pt gutter around table rules.
Commit d3fef25674baf4f4 (output: Add footnote support.) removed the 3-pt
gutter around table rules, instead putting a margin around cell contents.
This usually worked out fine, but for some tables in the GUI it caused the
rightmost rule in the table to disappear. This is probably some kind of
off-by-one error in table size computation or clipping. We may have to
eventually resolve that. However, this commit seems like an adequate
temporary fix: instead of fixing the off-by-one error, add a thin gutter
around the rules, so that the actual content of the rule doesn't get
clipped off.
Ben Pfaff [Sat, 18 Oct 2014 19:06:11 +0000 (12:06 -0700)]
pspp-dev.texi: Add authors as @author arguments.
With a blank @author, makeinfo complains.
Without @author at all, the title page in TeX output looks funny.
So this commit simply names the authors, as determined by "git log" on
the doc/dev directory.
Ben Pfaff [Sat, 18 Oct 2014 17:38:53 +0000 (10:38 -0700)]
psppire-output-view: Properly render the first few items of output.
Commit 18f9e37c8bc5 (psppire-output-view: Only render output items once the
window is realized.) fixed a crashing bug, but when I tested it I didn't
carefully look at the output. In fact, any output items that were rendered
before the window was realized were not displayed, because the widgets
created for them were never shown or properly initialized. This commit
fixes the problem.
Ben Pfaff [Thu, 9 Oct 2014 05:39:18 +0000 (22:39 -0700)]
psppire-output-view: Only render output items once the window is realized.
Otherwise, in environments where the output view is not rendered
immediately upon the call to gtk_widget_show_all() from
psppire_output_submit(), psppire_output_view_put() called later in that
function would dereference a null pointer trying to create a rendering
from a null GTK_WIDGET (view->output)->window.
tests/output/render-test.c: In function ‘read_table’:
tests/output/render-test.c:491:19: error: format not a string literal and
no format arguments [-Werror=format-security]
Ben Pfaff [Sun, 14 Sep 2014 19:35:53 +0000 (12:35 -0700)]
render: Fix bug in render_pager_draw_region().
This bug, introduced in commit f1db96caae4 (ender: Fold caption drawing
into rendering engine.), could cause the title and body of a table to be
drawn overlapping.
Ben Pfaff [Sat, 13 Sep 2014 23:55:19 +0000 (16:55 -0700)]
output: Rename caption to title.
This brings PSPP a small step closer to the table model that SPSS uses,
which allows for a brief title above the table and a more verbose caption
below it.
Ben Pfaff [Sat, 13 Sep 2014 23:41:08 +0000 (16:41 -0700)]
output: Add footnote support.
The initials support for footnotes does not allow the client to specify
the markers and does not merge footnotes with the same text so that they
have the same markers. It might be necessary to implement one or both of
those features.
The footnote feature doesn't have any users yet, outside of the tests.
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.