pspp
3 years agolexer: New function lex_force_int_range().
Ben Pfaff [Mon, 22 Mar 2021 19:50:23 +0000 (12:50 -0700)]
lexer: New function lex_force_int_range().

This simplifies parsing code that needs an integer in a particular range.

3 years agoFix bug where attempting to rendering an empty bar chart would crash
John Darrington [Sun, 21 Mar 2021 21:19:25 +0000 (22:19 +0100)]
Fix bug where attempting to rendering an empty bar chart would crash

3 years agodoc: Update documentation for SET command to match recent code changes.
Ben Pfaff [Sun, 21 Mar 2021 19:48:01 +0000 (12:48 -0700)]
doc: Update documentation for SET command to match recent code changes.

3 years agoq2c: Remove, since it is no longer used.
Ben Pfaff [Sun, 21 Mar 2021 19:03:52 +0000 (12:03 -0700)]
q2c: Remove, since it is no longer used.

This was the only tool that needed the build system's C compiler, so also
remove the parts of the build system that supported that.

3 years agoSET: Reimplement parser without q2c.
Ben Pfaff [Sun, 21 Mar 2021 18:59:30 +0000 (11:59 -0700)]
SET: Reimplement parser without q2c.

3 years agoCROSSTABS: Reimplement parser without q2c.
Ben Pfaff [Wed, 17 Mar 2021 17:50:28 +0000 (10:50 -0700)]
CROSSTABS: Reimplement parser without q2c.

3 years agoAvoid useless warnings on stderr.
John Darrington [Sun, 14 Mar 2021 18:39:30 +0000 (19:39 +0100)]
Avoid useless warnings on stderr.

src/libpspp/i18n.c (create_iconv): New argument 'warn'

3 years agosrc/ui/gui/main.c: Add a startup tip for Windows
John Darrington [Sun, 14 Mar 2021 15:33:31 +0000 (16:33 +0100)]
src/ui/gui/main.c: Add a startup tip for Windows

3 years agopsppire-import-spreadsheet.c: Fix typo
John Darrington [Sun, 14 Mar 2021 21:42:47 +0000 (22:42 +0100)]
psppire-import-spreadsheet.c: Fix typo

3 years agosrc/output/spv/automake.mk: Add some explicit dependencies to help cross building
John Darrington [Sun, 14 Mar 2021 13:24:01 +0000 (14:24 +0100)]
src/output/spv/automake.mk: Add some explicit dependencies to help cross building

3 years agosrc/language/expressions/automake.mk: Fix build issues when cross building
John Darrington [Sun, 14 Mar 2021 12:45:39 +0000 (13:45 +0100)]
src/language/expressions/automake.mk: Fix build issues when cross building

3 years agogui: Include line number in error messages generated from syntax windows.
Ben Pfaff [Thu, 11 Mar 2021 03:53:39 +0000 (19:53 -0800)]
gui: Include line number in error messages generated from syntax windows.

3 years agogui: Label unnamed syntax windows as "Untitled" in error messages.
Ben Pfaff [Thu, 11 Mar 2021 03:53:21 +0000 (19:53 -0800)]
gui: Label unnamed syntax windows as "Untitled" in error messages.

Seems a little more user-friendly than just omitted a filename entirely.

3 years agoAdd syntax mode radio button to syntax editor window.
Ben Pfaff [Thu, 11 Mar 2021 03:42:27 +0000 (19:42 -0800)]
Add syntax mode radio button to syntax editor window.

A number of users have reported problems with the syntax mode.  I am not
sure why.  This should allow them to select the syntax mode they actually
need to use, just in case.  The default should be unchanged (it is still
Auto).

3 years agopivot-table: Reduce size of struct pivot_value from 80 bytes to 40.
Ben Pfaff [Tue, 9 Mar 2021 02:18:48 +0000 (18:18 -0800)]
pivot-table: Reduce size of struct pivot_value from 80 bytes to 40.

3 years agopivot-table: Reduce size of struct pivot_value from 96 bytes to 80.
Ben Pfaff [Mon, 8 Mar 2021 06:52:43 +0000 (22:52 -0800)]
pivot-table: Reduce size of struct pivot_value from 96 bytes to 80.

3 years agoformat: Reduce size of struct fmt_spec from 6 bytes to 4.
Ben Pfaff [Mon, 8 Mar 2021 05:55:01 +0000 (21:55 -0800)]
format: Reduce size of struct fmt_spec from 6 bytes to 4.

3 years agoformat: Reduce size of struct fmt_spec from 12 bytes to 6.
Ben Pfaff [Mon, 8 Mar 2021 05:39:19 +0000 (21:39 -0800)]
format: Reduce size of struct fmt_spec from 12 bytes to 6.

3 years agoDELETE VARIABLES: Fix crash when deleting and adding vars at same time.
Ben Pfaff [Sun, 7 Mar 2021 23:42:56 +0000 (15:42 -0800)]
DELETE VARIABLES: Fix crash when deleting and adding vars at same time.

Thanks to Ricardo Mejias for reporting the problem:
https://lists.gnu.org/archive/html/pspp-users/2021-03/msg00025.html

3 years agoImprove error message for creating a new string var with COMPUTE or IF.
Ben Pfaff [Sun, 7 Mar 2021 19:33:00 +0000 (11:33 -0800)]
Improve error message for creating a new string var with COMPUTE or IF.

3 years agotests: Ignore .pspprc in a different way, to fix running TeX on Fedora.
Ben Pfaff [Sun, 7 Mar 2021 00:39:20 +0000 (16:39 -0800)]
tests: Ignore .pspprc in a different way, to fix running TeX on Fedora.

On Fedora, the 'tex' program generates per-user formats in the user's
home directory.  With the way that atlocal previously set $HOME to
/nonexistent, this failed, because formats can't be found or created in
/nonexistent.  This fixes the problem by using a different way to avoid
making pspp look for .pspprc.

3 years agoascii: Always include <sys/ioctl.h> if we're calling ioctl.
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().

Bug #60069.
Reported by Jeremy Lavergne.

3 years agopsppire-output-view: Remove more dead code.
Ben Pfaff [Mon, 15 Feb 2021 06:42:33 +0000 (22:42 -0800)]
psppire-output-view: Remove more dead code.

3 years agopsppire-output-view: Fix display of groups.
Ben Pfaff [Mon, 15 Feb 2021 05:55:20 +0000 (21:55 -0800)]
psppire-output-view: Fix display of groups.

Bug introduced in commit 507ebaea3673 ("output: Make groups contain
their subitems, and get rid of spv_item.").

Reported by John Darrington.

3 years agopsppire-output-view: Remove dead code.
Ben Pfaff [Mon, 15 Feb 2021 05:13:09 +0000 (21:13 -0800)]
psppire-output-view: Remove dead code.

3 years ago/ui/gui/psppire-var-info.c (__set_property): Remove redundant test.
John Darrington [Sun, 7 Feb 2021 09:03:54 +0000 (10:03 +0100)]
/ui/gui/psppire-var-info.c (__set_property): Remove redundant test.

Found by cppcheck.

3 years agosrc/libpspp/zip-reader.c (probe_magic): Fix inappropriate return value.
John Darrington [Sun, 7 Feb 2021 09:01:14 +0000 (10:01 +0100)]
src/libpspp/zip-reader.c (probe_magic): Fix inappropriate return value.

Found by cppcheck.

3 years agosrc/language/stats/autorecode.c (cmd_autorecode): Remove redundant test.
John Darrington [Sun, 7 Feb 2021 09:00:06 +0000 (10:00 +0100)]
src/language/stats/autorecode.c (cmd_autorecode): Remove redundant test.

Found by cppcheck.

3 years agosrc/data/sys-file-reader.c: (read_header): Remove redundant test.
John Darrington [Sun, 7 Feb 2021 08:58:01 +0000 (09:58 +0100)]
src/data/sys-file-reader.c: (read_header): Remove redundant test.

Found by cppcheck.

3 years agosrc/math/wilcoxon-sig.c (count_sums_to_W): Avoid use of unsigned value.
John Darrington [Sun, 7 Feb 2021 08:54:49 +0000 (09:54 +0100)]
src/math/wilcoxon-sig.c (count_sums_to_W): Avoid use of unsigned value.

Use signed long int, not unsigned long int.

Found by cppcheck.

3 years agospv-light-decoder: Use unsigned int, not int, for %x with sscanf().
Ben Pfaff [Sun, 7 Feb 2021 04:13:50 +0000 (20:13 -0800)]
spv-light-decoder: Use unsigned int, not int, for %x with sscanf().

Found by cppcheck.
Reported by John Darrington.

3 years agospv-writer: Avoid obsolete function asctime().
Ben Pfaff [Sun, 7 Feb 2021 04:13:19 +0000 (20:13 -0800)]
spv-writer: Avoid obsolete function asctime().

Found by cppcheck.
Reported by John Darrington.

3 years agospvbin-helpers: Properly handle parsing strings with no destination.
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.

Found by cppcheck.
Reported by John Darrington.

3 years agospv-light-decoder: Fix check for valid decimal point characters.
Ben Pfaff [Sun, 7 Feb 2021 03:45:58 +0000 (19:45 -0800)]
spv-light-decoder: Fix check for valid decimal point characters.

Found by cppcheck.
Reported by John Darrington.

3 years agospv: Add support for page breaks.
Ben Pfaff [Mon, 25 Jan 2021 05:23:52 +0000 (21:23 -0800)]
spv: Add support for page breaks.

3 years agospv: Remove code that was just #if 0'd out before.
Ben Pfaff [Mon, 25 Jan 2021 05:17:03 +0000 (21:17 -0800)]
spv: Remove code that was just #if 0'd out before.

Commit 507ebaea3673 ("output: Make groups contain their subitems, and get rid of
spv_item.") should have removed this code, but it was overlooked.

3 years agooutput: Replace OUTPUT_ITEM_PAGE_SETUP by a new driver function.
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.

3 years agooutput: Make groups contain their subitems, and get rid of spv_item.
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.

3 years agooutput-item: Add basic support for visibility.
Ben Pfaff [Sat, 16 Jan 2021 05:52:14 +0000 (21:52 -0800)]
output-item: Add basic support for visibility.

3 years agozip-reader: Make the zip_reader reference counted.
Ben Pfaff [Sat, 23 Jan 2021 23:25:29 +0000 (15:25 -0800)]
zip-reader: Make the zip_reader reference counted.

This will be useful in an upcoming commit.

3 years agozip-reader: Switch to a more usual error reporting mechanism.
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.

3 years agozip-reader: Fix file descriptor leak in zip_reader_create().
Ben Pfaff [Sat, 23 Jan 2021 22:37:27 +0000 (14:37 -0800)]
zip-reader: Fix file descriptor leak in zip_reader_create().

3 years agozip-reader: Use endian conversion functions from integer-format.h.
Ben Pfaff [Sat, 23 Jan 2021 19:59:36 +0000 (11:59 -0800)]
zip-reader: Use endian conversion functions from integer-format.h.

3 years agoDEBUG EVALUATE: Use output_log() instead of printf().
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.

3 years agospv-legacy-decoder: Make 'data' parameter to decode_spvdx_table() const.
Ben Pfaff [Thu, 14 Jan 2021 05:10:04 +0000 (21:10 -0800)]
spv-legacy-decoder: Make 'data' parameter to decode_spvdx_table() const.

3 years agooutput: New function output_log().
Ben Pfaff [Sun, 24 Jan 2021 22:53:41 +0000 (14:53 -0800)]
output: New function output_log().

3 years agollx: Introduce new iteration macros and some users.
Ben Pfaff [Sun, 24 Jan 2021 19:35:26 +0000 (11:35 -0800)]
llx: Introduce new iteration macros and some users.

3 years agostr: Avoid passing null pointer to memcpy() in ds_put_substring().
Ben Pfaff [Mon, 25 Jan 2021 00:30:42 +0000 (16:30 -0800)]
str: Avoid passing null pointer to memcpy() in ds_put_substring().

3 years agopspp-output: Fix typo in user message.
Ben Pfaff [Sun, 24 Jan 2021 21:52:24 +0000 (13:52 -0800)]
pspp-output: Fix typo in user message.

3 years agooutput-item: Allocate correct size in message_item_create().
Ben Pfaff [Sun, 24 Jan 2021 05:01:55 +0000 (21:01 -0800)]
output-item: Allocate correct size in message_item_create().

3 years agoconfigure: Require @clicksequence to be present.
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.

3 years agooutput: Add missing chart.h.
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.")
3 years agooutput-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.

3 years agooutput-item: Make command name part of every output_item.
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.

3 years agocairo-fsm: Remove dead code in xr_fsm_create().
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.

3 years agooutput: Change command names from uppercase to title case.
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.

3 years agostr: Add function xstrdup_if_nonnull() and introduce many users.
Ben Pfaff [Mon, 11 Jan 2021 01:29:38 +0000 (17:29 -0800)]
str: Add function xstrdup_if_nonnull() and introduce many users.

3 years agospv-file-format: Update understanding of commandName attribute.
Ben Pfaff [Mon, 11 Jan 2021 00:49:37 +0000 (16:49 -0800)]
spv-file-format: Update understanding of commandName attribute.

3 years agotext-item: Simplify text_item further to just hold a pivot_value.
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.

3 years agooutput: Rename page-eject-item to page-break-item.
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.

3 years agospv-file-format: More detailed requirements for structure members.
Ben Pfaff [Sun, 10 Jan 2021 19:39:08 +0000 (11:39 -0800)]
spv-file-format: More detailed requirements for structure members.

3 years agotext-item: Fix reference leak in text_item_to_table_item().
Ben Pfaff [Sun, 10 Jan 2021 21:14:55 +0000 (13:14 -0800)]
text-item: Fix reference leak in text_item_to_table_item().

3 years agospv-file-format: Update heading, label elements in structure XML.
Ben Pfaff [Sun, 10 Jan 2021 07:19:26 +0000 (23:19 -0800)]
spv-file-format: Update heading, label elements in structure XML.

3 years agotable-item: Don't unshare a pivot_table upon adding to table_item.
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.

3 years agospv-writer: Consistently use label from output_item.
Ben Pfaff [Sun, 10 Jan 2021 06:20:26 +0000 (22:20 -0800)]
spv-writer: Consistently use label from output_item.

3 years agooutput: Make spv-writer code understand output_item.
Ben Pfaff [Sun, 10 Jan 2021 05:28:37 +0000 (21:28 -0800)]
output: Make spv-writer code understand output_item.

3 years agopivot-table: Test round-tripping to an .spv file.
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.

3 years agopivot-table: Fix handling of current-layer in spv files, and update display.
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.

3 years agospv-light-decoder: Support special format 40 in decode_spvlb_value().
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'.")

3 years agospv-light-decoder: Drop special case for dim 0 in decode_data_index().
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().

3 years agopivot-table: Implement hiding footnotes.
Ben Pfaff [Sun, 10 Jan 2021 02:27:36 +0000 (18:27 -0800)]
pivot-table: Implement hiding footnotes.

3 years agopivot-table: Add test for footnotes.
Ben Pfaff [Sun, 10 Jan 2021 02:01:52 +0000 (18:01 -0800)]
pivot-table: Add test for footnotes.

3 years agopivot-table: Always put footnote markers in sorted order.
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.

3 years agoascii: Include footnote markers in output.
Ben Pfaff [Sun, 10 Jan 2021 02:01:03 +0000 (18:01 -0800)]
ascii: Include footnote markers in output.

3 years agopivot-table: Allow footnote marker style to change after creation.
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.

3 years agocairo-fsm: Honor displaying footnote markers as subscripts.
Ben Pfaff [Sun, 10 Jan 2021 01:57:16 +0000 (17:57 -0800)]
cairo-fsm: Honor displaying footnote markers as subscripts.

3 years agospv-light-decoder: Add back character set encoding support.
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.

3 years agopspp-output: New "strings" developer command.
Ben Pfaff [Sat, 9 Jan 2021 19:26:37 +0000 (11:26 -0800)]
pspp-output: New "strings" developer command.

3 years agostring-array: New function string_array_uniq().
Ben Pfaff [Sat, 9 Jan 2021 19:24:22 +0000 (11:24 -0800)]
string-array: New function string_array_uniq().

3 years agopspp-output: Minor coding style, comment fixes.
Ben Pfaff [Sat, 9 Jan 2021 06:20:42 +0000 (22:20 -0800)]
pspp-output: Minor coding style, comment fixes.

3 years agopspp-output: Don't write binary data to a terminal for dump-legacy-data.
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.

3 years agopspp-output: Add --help-developer option.
Ben Pfaff [Sat, 9 Jan 2021 06:20:07 +0000 (22:20 -0800)]
pspp-output: Add --help-developer option.

3 years agopivot-table: Minor coding style improvements.
Ben Pfaff [Sat, 9 Jan 2021 06:18:35 +0000 (22:18 -0800)]
pivot-table: Minor coding style improvements.

3 years agopivot-table: Tolerate nulls in pivot_value_clone().
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.

3 years agospv-legacy-decoder: Initialize all members for SPV_VALUE_TEXT.
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.

3 years agospv-legacy-decoder: Set data_index and presentation_index in leaves.
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.

3 years agospv-select: Allow structure_member and png_member to be selected also.
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.

3 years agopivot-table: Fix cut and paste error in pivot_value_clone().
Ben Pfaff [Sat, 9 Jan 2021 05:24:13 +0000 (21:24 -0800)]
pivot-table: Fix cut and paste error in pivot_value_clone().

3 years agoMake the Cairo and Pango libraries required rather than optional.
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.

3 years agoAdd support for PNG images in .spv files.
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.

3 years agozip-writer: Add functions for writing a member over multiple calls.
Ben Pfaff [Fri, 8 Jan 2021 04:51:15 +0000 (20:51 -0800)]
zip-writer: Add functions for writing a member over multiple calls.

3 years agocairo-fsm: Tolerate negative "space" argument to xr_fsm_draw_slice().
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.

3 years agospv-file-format: Revise .spv light member documentation.
Ben Pfaff [Fri, 8 Jan 2021 00:38:53 +0000 (16:38 -0800)]
spv-file-format: Revise .spv light member documentation.

3 years agospv: Encode and decode AHEX format in light binary members.
Ben Pfaff [Fri, 8 Jan 2021 00:48:27 +0000 (16:48 -0800)]
spv: Encode and decode AHEX format in light binary members.

3 years agospv-light-decoder: Text strings are all UTF-8 encoded.
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.

3 years agoperl-module: Fix to build with recent changes.
Ben Pfaff [Thu, 7 Jan 2021 06:16:46 +0000 (22:16 -0800)]
perl-module: Fix to build with recent changes.

3 years agospv-file-format: Describe format 40 and the meaning of 'small'.
Ben Pfaff [Thu, 7 Jan 2021 04:39:40 +0000 (20:39 -0800)]
spv-file-format: Describe format 40 and the meaning of 'small'.

3 years agopivot-table: Implement SET SMALL.
Ben Pfaff [Thu, 7 Jan 2021 04:27:54 +0000 (20:27 -0800)]
pivot-table: Implement SET SMALL.

3 years agopivot-table: Incorporate format settings.
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.

3 years agoMake data input and output take a fmt_settings structure.
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.