Ben Pfaff [Sat, 28 Jan 2023 18:16:25 +0000 (10:16 -0800)]
ascii: Improve look of dashed line ends.
Until now, partial ends of horizontal dashed lines were rendered as
U+2574 BOX DRAWINGS LIGHT LEFT and U+2576 BOX DRAWINGS LIGHT RIGHT,
which are solid lines. This looks funny at the end of a dashed line,
especially in some fonts. This commit changes these ends to
U+254C BOX DRAWINGS LIGHT DOUBLE DASH HORIZONTAL, which does extend all the
way across the character cell but looks much better.
Ben Pfaff [Sun, 22 Jan 2023 18:41:03 +0000 (10:41 -0800)]
table: Make debug code unconditional.
The debugging code in table_vline() and table_hline() was in practice
always enabled, but because of the way it was written each of the tests
was being re-tested in an assertion. It seems better to just enable it
all the time and avoid duplication.
Ben Pfaff [Fri, 27 Jan 2023 19:43:00 +0000 (11:43 -0800)]
pivot-table: Fix buffer overflow in corner case in pivot_table_dump().
Dumping a table with a layer dimension that has no leaves read from an
invalid pointer. This fixes the problem. This functionality isn't used
in PSPP, only by "pspp-output dump".
Ben Pfaff [Fri, 27 Jan 2023 02:35:38 +0000 (18:35 -0800)]
pivot-table: Fix buffer overflow in pivot_table_dump() in corner case.
This occurred when categories were more deeply nested into groups than
there were leaf categories. This functionality isn't used in PSPP, only
by "pspp-output dump".
Ben Pfaff [Sun, 15 Jan 2023 18:05:03 +0000 (10:05 -0800)]
output: Combine color and stroke into table_border_style.
Rules in tables have a line style (stroke) and a color. Until now, these
have been mostly maintained separately. This commit combines them in most
places.
Ben Pfaff [Sun, 15 Jan 2023 17:28:08 +0000 (09:28 -0800)]
render: Get rid of RENDER_LINE_* in favor of similar TABLE_STROKE_*.
These had the same values. They were separated for abstraction reasons
that don't seem to be needed, and eliminating one of them eliminates some
conversions.
Ben Pfaff [Fri, 23 Dec 2022 20:48:50 +0000 (12:48 -0800)]
table: Remove table_box().
It was only used from table_put() to erase any rules within a joined cell,
but the client code didn't ever put rules in a joined cell, so it was only
used as a no-op.
Ben Pfaff [Sun, 27 Nov 2022 18:05:35 +0000 (10:05 -0800)]
Move all command implementations into a single 'commands' directory.
The original division of commands into subdirectories was fairly arbitrary,
and over time it got more confusing, even to me (who made the divisions
to begin with). I don't see a problem with having them in a single
directory, and it will confuse me less. This commit moves them all into
one place.
Ben Pfaff [Thu, 24 Nov 2022 00:39:35 +0000 (16:39 -0800)]
CTABLES: Make EMPTY independent of other settings on CATEGORIES.
Frans Houweling reported that the following two commands behave
differently:
CTABLES /TABLE=class > datum BY size
/CATEGORIES VARIABLES=ALL EMPTY=EXCLUDE
/CATEGORIES VARIABLES=size TOTAL=YES.
CTABLES /TABLE=class > datum BY size
/CATEGORIES VARIABLES=size TOTAL=YES
/CATEGORIES VARIABLES=ALL EMPTY=EXCLUDE.
There was a good reason for this, which is that CATEGORIES always changes
all the category attributes of whatever variables are named. That is,
CATEGORIES VARIABLES=ALL overrides TOTAL even if EMPTY is the only
subcommand given. I don't know what SPSS does here, but this behavior is
surprising enough that I wanted to change it. This commit does that;
afterward, both of the above commands behave the same way, which
combines effects of TOTAL=YES and EMPTY=EXCLUDE for size and just
EMPTY=EXCLUDE for the class and datum.
Ben Pfaff [Sun, 20 Nov 2022 17:02:00 +0000 (09:02 -0800)]
Disentangle the interaction parser from the variable parser.
Both GLM and LOGISTIC REGRESSION used the interaction parser, but only GLM
used it to parse interactions in the full sense. LOGISTIC REGRESSION was
just parsing a list of variables and then creating interactions from them.
This commit moves the interaction parser from variable-parser into GLM and
adds new code to LOGISTIC REGRESSION that satisfies its needs.