pivot-output: Fix drawing lines between dimensions within a heading.
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 31 Dec 2020 20:23:03 +0000 (12:23 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 31 Dec 2020 22:36:07 +0000 (14:36 -0800)
src/output/pivot-output.c

index 6f92f87c966cfccbad2a372133f6f13f8507e972..23b47c0d54c5720963b65ff23b268a112da25ded 100644 (file)
@@ -356,7 +356,19 @@ compose_headings (struct table *t,
                      show_values, show_variables, false);
         }
 
-      if (dim_index > 1)
+      /* Draw the horizontal line between dimensions, e.g. the ===== line here:
+
+         +-----------------------------------------------------+ __
+         |                         bbbb                        |  |
+         +-----------------+-----------------+-----------------+  |dim "bbbb"
+         |      bbbb1      |      bbbb2      |      bbbb3      | _|
+         +=================+=================+=================+ __
+         |       aaaa      |       aaaa      |       aaaa      |  |
+         +-----+-----+-----+-----+-----+-----+-----+-----+-----+  |dim "aaaa"
+         |aaaa1|aaaa2|aaaa3|aaaa1|aaaa2|aaaa3|aaaa1|aaaa2|aaaa3| _|
+         +-----+-----+-----+-----+-----+-----+-----+-----+-----+
+      */
+      if (dim_index != a_axis->n_dimensions - 1)
         draw_line (t, borders, dim_col_horz, a, top_row, a_ofs,
                    t->n[a] - 1);
       top_row += d->label_depth;