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.
Bug #59818.
Ben Pfaff [Mon, 11 Jan 2021 06:32:21 +0000 (22:32 -0800)]
output: Add missing chart.h.
Fixes: 29917c4f5908 ("output-item: Collapse the inheritance hierarchy into a single struct.")
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 [Mon, 11 Jan 2021 02:03:09 +0000 (18:03 -0800)]
cairo-fsm: Remove dead code in xr_fsm_create().
This code can't be reached because code above it exits the function in the
case that it handles.
Ben Pfaff [Mon, 11 Jan 2021 01:46:48 +0000 (17:46 -0800)]
output: Change command names from uppercase to title case.
This is compatible and easier to read.
Ben Pfaff [Mon, 11 Jan 2021 01:29:38 +0000 (17:29 -0800)]
str: Add function xstrdup_if_nonnull() and introduce many users.
Ben Pfaff [Mon, 11 Jan 2021 00:49:37 +0000 (16:49 -0800)]
spv-file-format: Update understanding of commandName attribute.
Ben Pfaff [Sun, 10 Jan 2021 21:52:34 +0000 (13:52 -0800)]
text-item: Simplify text_item further to just hold a pivot_value.
pivot_value has built-in support for font styling, so it eliminates the
need for a separate font_style object.
Ben Pfaff [Sun, 10 Jan 2021 19:48:47 +0000 (11:48 -0800)]
output: Rename page-eject-item to page-break-item.
Seems like a better name to me.
Ben Pfaff [Sun, 10 Jan 2021 19:39:08 +0000 (11:39 -0800)]
spv-file-format: More detailed requirements for structure members.
Ben Pfaff [Sun, 10 Jan 2021 21:14:55 +0000 (13:14 -0800)]
text-item: Fix reference leak in text_item_to_table_item().
Ben Pfaff [Sun, 10 Jan 2021 07:19:26 +0000 (23:19 -0800)]
spv-file-format: Update heading, label elements in structure XML.
Ben Pfaff [Sun, 10 Jan 2021 06:20:56 +0000 (22:20 -0800)]
table-item: Don't unshare a pivot_table upon adding to table_item.
I don't know a reason to do so.
Ben Pfaff [Sun, 10 Jan 2021 06:20:26 +0000 (22:20 -0800)]
spv-writer: Consistently use label from output_item.
Ben Pfaff [Sun, 10 Jan 2021 05:28:37 +0000 (21:28 -0800)]
output: Make spv-writer code understand output_item.
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 03:59:48 +0000 (19:59 -0800)]
pivot-table: Fix handling of current-layer in spv files, and update display.
Ben Pfaff [Sun, 10 Jan 2021 03:25:34 +0000 (19:25 -0800)]
spv-light-decoder: Support special format 40 in decode_spvlb_value().
This was overlooked in implementing the format in commit
5bf763272ad7
("spv-file-format: Describe format 40 and the meaning of 'small'.")
Ben Pfaff [Sun, 10 Jan 2021 03:23:47 +0000 (19:23 -0800)]
spv-light-decoder: Drop special case for dim 0 in decode_data_index().
Ben Pfaff [Sun, 10 Jan 2021 02:27:36 +0000 (18:27 -0800)]
pivot-table: Implement hiding footnotes.
Ben Pfaff [Sun, 10 Jan 2021 02:01:52 +0000 (18:01 -0800)]
pivot-table: Add test for footnotes.
Ben Pfaff [Sun, 10 Jan 2021 02:01:42 +0000 (18:01 -0800)]
pivot-table: Always put footnote markers in sorted order.
This is compatible behavior.
Ben Pfaff [Sun, 10 Jan 2021 02:01:03 +0000 (18:01 -0800)]
ascii: Include footnote markers in output.
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 [Sun, 10 Jan 2021 01:57:16 +0000 (17:57 -0800)]
cairo-fsm: Honor displaying footnote markers as subscripts.
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:
00764b1c.spv: windows-1251: 481 unique strings, 123 non-ASCII, 123 UTF-8.
009bf8ba.spv: windows-1252: 76 unique strings, 9 non-ASCII, 9 UTF-8.
00b033b6.spv: windows-1252: 389 unique strings, 16 non-ASCII, 16 UTF-8.
014fc3df.spv: ISO_8859-1:1987: 81 unique strings, 4 non-ASCII, 4 UTF-8.
01a20a32.spv: windows-1254: 71 unique strings, 10 non-ASCII, 10 UTF-8.
01d41135.spv: windows-1251: 142 unique strings, 51 non-ASCII, 51 UTF-8.
01d7942a.spv: windows-1251: 64 unique strings, 43 non-ASCII, 0 UTF-8.
0203e88a.spv: windows-1254: 82 unique strings, 4 non-ASCII, 0 UTF-8.
0247cf5a.spv: windows-1256: 236 unique strings, 5 non-ASCII, 0 UTF-8.
026777ed.spv:
027b66dd.spv: windows-1252: 224 unique strings, 2 non-ASCII, 0 UTF-8.
02cc8c22.spv: windows-1254: 79 unique strings, 1 non-ASCII, 1 UTF-8.
...
Others are entirely non-UTF-8:
00029fbf.spv: windows-1251: 115 unique strings, 88 non-ASCII, 0 UTF-8.
00f101f5.spv: windows-1252: 94 unique strings, 1 non-ASCII, 0 UTF-8.
00ff0628.spv: windows-1252: 112 unique strings, 14 non-ASCII, 0 UTF-8.
01d7942a.spv: windows-1251: 64 unique strings, 43 non-ASCII, 0 UTF-8.
0203e88a.spv: windows-1254: 82 unique strings, 4 non-ASCII, 0 UTF-8.
0247cf5a.spv: windows-1256: 236 unique strings, 5 non-ASCII, 0 UTF-8.
027b66dd.spv: windows-1252: 224 unique strings, 2 non-ASCII, 0 UTF-8.
03235aa7.spv: windows-1254: 198 unique strings, 18 non-ASCII, 0 UTF-8.
07a43c5c.spv: ISO-8859-15: 124 unique strings, 13 non-ASCII, 0 UTF-8.
07a85498.spv: windows-1254: 86 unique strings, 1 non-ASCII, 0 UTF-8.
07a91f3e.spv: windows-1252: 111 unique strings, 13 non-ASCII, 0 UTF-8.
0ad295d8.spv: windows-1252: 81 unique strings, 1 non-ASCII, 0 UTF-8.
0ceb843b.spv: windows-1252: 3108 unique strings, 392 non-ASCII, 0 UTF-8.
and still others are a mix:
02f274e6.spv: windows-1252: 746 unique strings, 77 non-ASCII, 27 UTF-8.
0a7be05b.spv: windows-1255: 334 unique strings, 122 non-ASCII, 113 UTF-8.
4c7a575d.spv: windows-1250: 400 unique strings, 73 non-ASCII, 72 UTF-8.
785b0737.spv: windows-1250: 322 unique strings, 164 non-ASCII, 158 UTF-8.
94365e08.spv: windows-1250: 353 unique strings, 77 non-ASCII, 2 UTF-8.
This commit just gives up and interprets any string that is valid UTF-8 as
UTF-8. So far, it works in practice.
Ben Pfaff [Sat, 9 Jan 2021 19:26:37 +0000 (11:26 -0800)]
pspp-output: New "strings" developer command.
Ben Pfaff [Sat, 9 Jan 2021 19:24:22 +0000 (11:24 -0800)]
string-array: New function string_array_uniq().
Ben Pfaff [Sat, 9 Jan 2021 06:20:42 +0000 (22:20 -0800)]
pspp-output: Minor coding style, comment fixes.
Ben Pfaff [Sat, 9 Jan 2021 06:20:26 +0000 (22:20 -0800)]
pspp-output: Don't write binary data to a terminal for dump-legacy-data.
Ben Pfaff [Sat, 9 Jan 2021 06:20:07 +0000 (22:20 -0800)]
pspp-output: Add --help-developer option.
Ben Pfaff [Sat, 9 Jan 2021 06:18:35 +0000 (22:18 -0800)]
pivot-table: Minor coding style improvements.
Ben Pfaff [Sat, 9 Jan 2021 06:18:12 +0000 (22:18 -0800)]
pivot-table: Tolerate nulls in pivot_value_clone().
These members should not be null, but there is little cost and perhaps some
benefit in allowing it.
Ben Pfaff [Sat, 9 Jan 2021 06:17:30 +0000 (22:17 -0800)]
spv-legacy-decoder: Initialize all members for SPV_VALUE_TEXT.
These were supposed to always be nonnull but this code didn't do it
properly.
Ben Pfaff [Sat, 9 Jan 2021 06:16:11 +0000 (22:16 -0800)]
spv-legacy-decoder: Set data_index and presentation_index in leaves.
This allows the new assertions in clone_category() to pass.
Ben Pfaff [Sat, 9 Jan 2021 06:14:47 +0000 (22:14 -0800)]
spv-select: Allow structure_member and png_member to be selected also.
Ben Pfaff [Sat, 9 Jan 2021 05:24:13 +0000 (21:24 -0800)]
pivot-table: Fix cut and paste error in pivot_value_clone().
Ben Pfaff [Sat, 9 Jan 2021 03:48:00 +0000 (19:48 -0800)]
Make the Cairo and Pango libraries required rather than optional.
This eliminates a lot of difficult-to-maintain conditional compilation.
It also fixes the broken build of the manual when Cairo was not available.
Ben Pfaff [Fri, 8 Jan 2021 06:49:24 +0000 (22:49 -0800)]
Add support for PNG images in .spv files.
This also allows us to save charts to .spv files as images.
Ben Pfaff [Fri, 8 Jan 2021 04:51:15 +0000 (20:51 -0800)]
zip-writer: Add functions for writing a member over multiple calls.
Ben Pfaff [Fri, 8 Jan 2021 02:06:08 +0000 (18:06 -0800)]
cairo-fsm: Tolerate negative "space" argument to xr_fsm_draw_slice().
Fixes infinite loop converting the .spv file attached to bug #59837
to a PDF file.
Ben Pfaff [Fri, 8 Jan 2021 00:38:53 +0000 (16:38 -0800)]
spv-file-format: Revise .spv light member documentation.
Ben Pfaff [Fri, 8 Jan 2021 00:48:27 +0000 (16:48 -0800)]
spv: Encode and decode AHEX format in light binary members.
Ben Pfaff [Fri, 8 Jan 2021 00:38:18 +0000 (16:38 -0800)]
spv-light-decoder: Text strings are all UTF-8 encoded.
Thanks to elias tsolis for reporting this bug.
Bug #59837.
Ben Pfaff [Thu, 7 Jan 2021 06:16:46 +0000 (22:16 -0800)]
perl-module: Fix to build with recent changes.
Ben Pfaff [Thu, 7 Jan 2021 04:39:40 +0000 (20:39 -0800)]
spv-file-format: Describe format 40 and the meaning of 'small'.
Ben Pfaff [Thu, 7 Jan 2021 04:27:54 +0000 (20:27 -0800)]
pivot-table: Implement SET SMALL.
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 [Thu, 7 Jan 2021 00:24:46 +0000 (16:24 -0800)]
Make data input and output take a fmt_settings structure.
This will allow pivot_table formatting to supply its own.
Ben Pfaff [Wed, 6 Jan 2021 23:24:01 +0000 (15:24 -0800)]
format: Move epoch into struct fmt_settings.
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 [Tue, 5 Jan 2021 22:20:16 +0000 (14:20 -0800)]
format: Fix typo in comment.
Ben Pfaff [Mon, 4 Jan 2021 00:08:09 +0000 (16:08 -0800)]
configure: Ensure the version always has 3 parts in PSPP_CHECK_XGETTEXT.
Makes configure succeed on Debian for me, where "xgettext --version" prints
0.21 as the version.
John Darrington [Sun, 3 Jan 2021 07:44:23 +0000 (08:44 +0100)]
acinclude.m4 (PSPP_CHECK_XGETTEXT): Use sed instead of parameter expansion
Several persons have said that the initial version of this macro failed on their
systems. Hopefully this will work better.
Ben Pfaff [Sat, 2 Jan 2021 23:07:39 +0000 (15:07 -0800)]
pivot-table: Add more tests for pivot table rendering.
John Darrington [Sat, 2 Jan 2021 09:57:23 +0000 (10:57 +0100)]
Recent gettext to version 0.20 or later
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 [Fri, 1 Jan 2021 06:25:51 +0000 (22:25 -0800)]
csv: Change footnote format.
Ben Pfaff [Fri, 1 Jan 2021 06:21:48 +0000 (22:21 -0800)]
pivot-table: Add some more utility functions for pivot data structures.
Ben Pfaff [Fri, 1 Jan 2021 06:19:13 +0000 (22:19 -0800)]
pivot-table: Define numeric formats of categories as well as their cells.
Ben Pfaff [Fri, 1 Jan 2021 06:13:59 +0000 (22:13 -0800)]
pivot-table: Don't rely on xcalloc (0, x) returning nonnull.
I believe that glibc and gnulib ensure this, but I would rather not rely
on that.
Ben Pfaff [Fri, 1 Jan 2021 06:09:44 +0000 (22:09 -0800)]
pivot-output: Fix typo in comment.
Ben Pfaff [Fri, 1 Jan 2021 06:00:50 +0000 (22:00 -0800)]
render: Simplify 'pages' array in struct render_pager.
Ben Pfaff [Fri, 1 Jan 2021 07:18:34 +0000 (23:18 -0800)]
output: Drop TAB_FIX and the idea of a configurable fixed-width font.
Maybe it would be a good idea to make the fixed-width font configurable,
but it makes compatibility harder.
Ben Pfaff [Tue, 29 Dec 2020 17:54:50 +0000 (09:54 -0800)]
text-item: Use struct font_style instead of individual fields.
The foreground and background colors can't be represented in SPV files,
but it seems like an improvement nonetheless.
This also eliminates the last use of TAB_FIX in the tree. An upcoming
commit will remove TAB_FIX entirely.
Ben Pfaff [Tue, 29 Dec 2020 07:50:50 +0000 (23:50 -0800)]
table-item: Make caption into table_cell too.
Ben Pfaff [Mon, 28 Dec 2020 18:50:53 +0000 (10:50 -0800)]
table-item: Change title from table_item_text to table_cell.
Ben Pfaff [Tue, 29 Dec 2020 07:35:45 +0000 (23:35 -0800)]
table-item: Remove barely used parameters from table_item_create().
The 'title' and 'caption' parameters were always NULL in practice, and
only one caller supplied nonnull 'notes'.
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 [Tue, 29 Dec 2020 01:47:31 +0000 (17:47 -0800)]
html: Step toward better handling of text_items.
There's more work to do to get the fonts, especially, correct.
Ben Pfaff [Fri, 1 Jan 2021 18:54:33 +0000 (10:54 -0800)]
pivot-table: Fix memory leak in pivot_table_destroy()
John Darrington [Fri, 1 Jan 2021 08:04:45 +0000 (09:04 +0100)]
PSPPIRE: Add user hints dialog on startup
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 [Fri, 1 Jan 2021 05:57:30 +0000 (21:57 -0800)]
output: Improve comments.
Ben Pfaff [Fri, 1 Jan 2021 05:04:12 +0000 (21:04 -0800)]
pivot-table: Update comments to drop mention of omit_empty.
Commit
0200682d517f ("pivot-table: Change the default format to omit
empty rows and columns.") eliminated the need for this.
Ben Pfaff [Fri, 1 Jan 2021 04:46:56 +0000 (20:46 -0800)]
pspp-output: New feature for retrieving the default look.
Ben Pfaff [Fri, 1 Jan 2021 02:27:50 +0000 (18:27 -0800)]
pivot-table: Don't allow data cells for nonexistent categories.
Ben Pfaff [Fri, 1 Jan 2021 01:43:04 +0000 (17:43 -0800)]
spv-file-format: Footnotes can't refer to footnotes.
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 20:23:03 +0000 (12:23 -0800)]
pivot-output: Fix drawing lines between dimensions within a heading.
Ben Pfaff [Thu, 31 Dec 2020 19:07:31 +0000 (11:07 -0800)]
pivot-output: Replicate dimension headings when divided by vertical rules.
This introduces a comment into compose_headings() that explains the
problem that it fixes.
John Darrington [Thu, 31 Dec 2020 17:21:42 +0000 (18:21 +0100)]
perl-module/README: update version references
Ben Pfaff [Thu, 31 Dec 2020 03:45:07 +0000 (19:45 -0800)]
pivot-output: Really fix formatting of the corner cell.
Commit
981e88e2f5b4 ("pivot-output: Fill corner cell even without
corner text.") purported to do this, but it missed the most
important issue.
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 [Thu, 31 Dec 2020 01:26:04 +0000 (17:26 -0800)]
pivot-output: Implement superscript.
Ben Pfaff [Wed, 30 Dec 2020 22:54:30 +0000 (14:54 -0800)]
spv-file-format: Document "show-title" option.
Ben Pfaff [Thu, 31 Dec 2020 00:06:01 +0000 (16:06 -0800)]
ascii: Support dashed lines in output.
Unicode has thick lines too, so that's another opportunity for future
expansion.
Ben Pfaff [Wed, 30 Dec 2020 23:39:30 +0000 (15:39 -0800)]
ascii: Refactor definition of box characters.
Ben Pfaff [Wed, 30 Dec 2020 23:11:28 +0000 (15:11 -0800)]
cairo-fsm: Implement dashed lines.
Ben Pfaff [Wed, 30 Dec 2020 20:28:56 +0000 (12:28 -0800)]
pivot-table: Fix incorrect allocation count in pivot_table_dump().
Ben Pfaff [Wed, 30 Dec 2020 18:15:37 +0000 (10:15 -0800)]
tests: Be consistent about adding to $(check_PROGRAMS).
Some tests were added at the top of the file, some just above the
definition of their sources, and some in both places (!).
Ben Pfaff [Tue, 29 Dec 2020 18:48:43 +0000 (10:48 -0800)]
table: Add comment.
Ben Pfaff [Tue, 29 Dec 2020 18:48:31 +0000 (10:48 -0800)]
spv-file-format: Document CSS in more detail.
Ben Pfaff [Tue, 29 Dec 2020 18:48:07 +0000 (10:48 -0800)]
spv-css-parser: Parse text color also.
Ben Pfaff [Tue, 29 Dec 2020 18:46:16 +0000 (10:46 -0800)]
spv-css-parser: The font-size is really "px" even though it says "pt".
Ben Pfaff [Tue, 29 Dec 2020 18:45:21 +0000 (10:45 -0800)]
output: Eliminate duplicated color parsing code.
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.
Ben Pfaff [Mon, 28 Dec 2020 22:12:34 +0000 (14:12 -0800)]
html: Implement rotated cells.