Ben Pfaff [Sun, 21 Feb 2021 18:32:37 +0000 (10:32 -0800)]
ascii: Always include <sys/ioctl.h> if we're calling ioctl.
This file included sys/ioctl.h if it was necessary to use the TIOCGWINSZ
constant, but in fact it's needed to call ioctl() at all, so this commit
moves the #include so that it's included whenever we use ioctl().
Ben Pfaff [Sun, 7 Feb 2021 03:52:24 +0000 (19:52 -0800)]
spvbin-helpers: Properly handle parsing strings with no destination.
binary-parser-generator will pass a null pointer to spvbin_parse_string()
or spvbin_parse_bestring() for a string that should be parsed but not
stored. In such a case, the implementation would dereference a null
pointer. This fixes the problem.
This is only a theoretical problem because the grammars PSPP uses now
always store the strings that they parse.
Ben Pfaff [Mon, 25 Jan 2021 05:09:08 +0000 (21:09 -0800)]
output: Replace OUTPUT_ITEM_PAGE_SETUP by a new driver function.
OUTPUT_ITEM_PAGE_SETUP was a special case that only the Cairo and SPV
drivers could implement, and it could only come first in the output stream
anyway, so it didn't make much sense. This commit gets rid of it in favor
of adding a new driver class function for setting the page setup.
Ben Pfaff [Thu, 14 Jan 2021 06:05:05 +0000 (22:05 -0800)]
output: Make groups contain their subitems, and get rid of spv_item.
Until now, the output subsystem has had two different ideas for output
items: struct output_item, which is the primary representation, and
struct spv_item, which represents an output item read from an .spv file.
The biggest difference, until now, has been that spv_item contains its
children, whereas output_item bracketed children inside open/close pairs.
This commit unifies them under output_item, making output_item adopt the
container abstraction.
Ben Pfaff [Sat, 23 Jan 2021 22:34:03 +0000 (14:34 -0800)]
zip-reader: Switch to a more usual error reporting mechanism.
Having the client pass in a string buffer was clever but it gave the
zip_reader some shared state with its client that will be difficult to
deal with in future use cases.
Ben Pfaff [Mon, 25 Jan 2021 00:59:29 +0000 (16:59 -0800)]
DEBUG EVALUATE: Use output_log() instead of printf().
I found that with upcoming changes to the output engine, the relative
ordering of output from printf() and from the output engine changed. This
commit makes it all go through the output engine, which keeps it
consistent as the output engine changes.
Ben Pfaff [Tue, 12 Jan 2021 04:38:21 +0000 (20:38 -0800)]
configure: Require @clicksequence to be present.
Occasionally someone tries to build with a really old Texinfo. It doesn't
work now, although it once did, but before this commit it would
successfully configure. By preventing configure from finishing, I think
that this will produce a clearer error message earlier in the build
process, ultimately making life easier for users.
Ben Pfaff [Mon, 11 Jan 2021 06:19:35 +0000 (22:19 -0800)]
output-item: Collapse the inheritance hierarchy into a single struct.
When I designed this inheritance hierarchy, what was really needed was a
bit of a mystery. Now, it's pretty clear what is really going to be here,
and it simplifies and clarifies code a lot to just have a struct with an
embedded union. It also removes, net, about 1000 lines of code.
Ben Pfaff [Mon, 11 Jan 2021 02:20:11 +0000 (18:20 -0800)]
output-item: Make command name part of every output_item.
Until now, group_items and text_items have had a command name, but SPV
files make the command name part of every output_item. This change
make output_item better aligned.
Ben Pfaff [Sun, 10 Jan 2021 04:01:12 +0000 (20:01 -0800)]
pivot-table: Test round-tripping to an .spv file.
Displaying a pivot table directly should produce the same results as
writing it to an .spv file and then re-reading the .spv file. This wasn't
consistently the case before the last few patches. This set of test
updates guards against regression.
Ben Pfaff [Sun, 10 Jan 2021 02:02:50 +0000 (18:02 -0800)]
pivot-table: Allow footnote marker style to change after creation.
Footnote markers can be set as numeric or alphabetic. Until now, the code
for this has only honored this setting at the time the footnote was added.
With this commit, changes in this setting are also honored after adding it.
Ben Pfaff [Sat, 9 Jan 2021 07:02:23 +0000 (23:02 -0800)]
spv-light-decoder: Add back character set encoding support.
Originally, SPV light member decoding would obtain the member's declared
character set encoding and recode all strings from that encoding into
UTF-8.
The SPV file submitted along with bug #59837, however, showed that SPV
files actually contain UTF-8 strings despite their declared character
encoding. This SPV file declared windows-1253 encoding. It contained 221
unique strings, 52 of which contained non-ASCII characters, and all of
which were valid UTF-8. Therefore, commit db9a44802bb9
("spv-light-decoder: Text strings are all UTF-8 encoded.") changed the
SPV light member decoder to treat all strings as UTF-8 encoded.
Unfortunately, further examination of the SPV corpus showed that there is
no consistency. Some files do contain all UTF-8 despite declaring another
character set. For example:
Ben Pfaff [Thu, 7 Jan 2021 01:03:43 +0000 (17:03 -0800)]
pivot-table: Incorporate format settings.
This allows pivot tables to save the decimal point and custom
currency settings that were in effect when they were created,
and to honor the ones read from an .spv file.
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.