Ben Pfaff [Wed, 6 Jan 2021 23:07:19 +0000 (15:07 -0800)]
format: Make format settings structure smaller and cheaper.
Until now, there has only been one copy of the fmt_settings structure in a
given PSPP process, so it hardly mattered what size it was. In an upcoming
commit, there will be one copy per pivot table, so it becomes more
important. This commit shrinks it.
Ben Pfaff [Fri, 1 Jan 2021 06:44:23 +0000 (22:44 -0800)]
output: Make table_item a pivot_table, table_cell a pivot_value.
This greatly simplifies a lot of glue code and it brings the
internal representation of tables in output closer to the .spv
format representation, which will make better compatibility
possible in the future.
This commit gets rid of render-test, which was very specific
to the lower-level "table" representation, and replaces it
by pivot-table-test, which works in terms of the higher-level
pivot table representation.
Ben Pfaff [Tue, 29 Dec 2020 07:33:30 +0000 (23:33 -0800)]
table-provider: Remove "const" from struct table_cell members.
Until now, this struct has been used only in one particular place, where
the "const" is easy to handle. In an upcoming commit, it will be used more
widely, making the const-ness impractical to maintain, so this commit
removes it.
Ben Pfaff [Sun, 27 Dec 2020 20:12:13 +0000 (12:12 -0800)]
output-item: Make label a part of every output_item.
I didn't understand before that every output_item had a label of its own
that users could separately edit. The spv file format makes that clear,
though, so this commit acknowledges it.
Ben Pfaff [Fri, 1 Jan 2021 06:43:57 +0000 (22:43 -0800)]
tests: Break off --draw-mode from render-test into ascii-test.
My plan is for render-test to go away in favor of a comprehensive test for
pivot tables, which are the only kinds of tables that actually matter.
The --draw-mode tests are a different kind of beast, so it makes sense to
keep them and put them in a different place.
Ben Pfaff [Thu, 31 Dec 2020 22:19:11 +0000 (14:19 -0800)]
pivot-output: Fix vertical line presence and style.
This code failed to draw dividers between groups and it didn't
follow the same pattern as SPSS for choosing between
"dimension" and "category" style for vertical dividers. This
commit fixes both problems.
Ben Pfaff [Thu, 31 Dec 2020 03:27:10 +0000 (19:27 -0800)]
output: Remove superscript support.
The previous commit df5005061c03 ("pivot-output: Implement superscript.")
finished this support, but on further inspection, there's nothing in the
non-legacy .spv format that can set a superscript. The legacy .spv format
appears to be able to do it; I'll worry about that if it gets implemented
later.
Ben Pfaff [Mon, 28 Dec 2020 22:13:43 +0000 (14:13 -0800)]
html: Make <th> cells be font-weight: normal by default.
This overrides typical web browser defaults. That seems reasonable, since
the driver styles all the cells according to the user specifications. We
could just use <td> for all cells, but there might be semantic value in
having properly marked header cells.
This code had the wrong notion of which headers to rotate. It also didn't
implement the observed behavior of rotated headers always being centered
both horizontally and vertically.
John Darrington [Sun, 27 Dec 2020 07:47:51 +0000 (08:47 +0100)]
Remove dummy-prerequisite rule
As Ben pointed out, this probably did more harm than good. So instead,
this change adds some explicit dependencies where prerequisites are
known to be necessary.
Ben Pfaff [Sun, 27 Dec 2020 01:54:07 +0000 (17:54 -0800)]
cairo: Label pages in PDFs with page numbers.
These normally wouldn't do much, but PSPP does support an "initial page
number" setting, and if that is set to anything but 1 then it will make
a difference.
Ben Pfaff [Sat, 26 Dec 2020 05:54:48 +0000 (21:54 -0800)]
cairo: Avoid using cairo_t for a destroyed cairo_surface_t.
xr_pager_destroy() would destroy the latest cairo_t, if there was one.
Generally there wasn't, since in the common case it got destroyed by
xr_pager_run() when the fsm emptied out, but in the case of the last page
in a produced output file, xr_destroy() would call xr_pager_destroy()
after first destroying the surface_t it was drawing on. I don't think this
is an actual bug, because everything is properly reference-counted inside
Cairo (the cairo_t holds a reference on its cairo_surface_t) but I found it
confusing.
Ben Pfaff [Mon, 21 Dec 2020 04:30:18 +0000 (20:30 -0800)]
pivot-table: Change the default format to omit empty rows and columns.
By making this the default, it doesn't become necessary to make a lot of
procedures that yield output change the format to produce reasonable
output. This means that the user's settings for the format won't get
overridden.
This changes a lot of output that had empty columns, in particular
anything that used DISPLAY DICTIONARY with a dictionary that had no
variable labels or missing values. This commit also updates the expected
output to match.
An unexpected side effect was that some tables became empty entirely, for
example LIST with no rows. This seemed undesirable, so I changed
pivot_table_enumerate_axis() so if an axis was entirely empty due to
omit_empty, then omit_empty was suppressed for that axis.