Fix problem with category borders. pivot-titles-5
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 30 Jan 2023 17:54:09 +0000 (09:54 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 30 Jan 2023 17:54:09 +0000 (09:54 -0800)
src/output/pivot-output.c

index 464b5d950a61bd40d265290b98d120e924460c2d..ca01968e8c985b4b1ef4508fcdd9f927602ac1e1 100644 (file)
@@ -306,7 +306,7 @@ compose_headings (struct table *t,
                      +-----+-----+-----+-----+-----+-----+-----+-----+-----+
                   */
                   enum pivot_border style
-                    = (y1 == v_size - 1 ? cat_col_vert : dim_col_vert);
+                    = (y1 == area[v][0] + v_size - 1 ? cat_col_vert : dim_col_vert);
                   if (!vrules[x2])
                     {
                       draw_line (t, style, v, x2 + h_ofs, y1, v_max);
@@ -826,14 +826,8 @@ pivot_output_monolithic (const struct pivot_table *pt,
   t->n_borders = PIVOT_N_BORDERS;
   t->borders = pool_nmalloc (t->container, PIVOT_N_BORDERS, sizeof *t->borders);
   for (size_t i = 0; i < PIVOT_N_BORDERS; i++)
-    {
-      const struct table_border_style *src = &pt->look->borders[i];
-      struct table_border_style *dst = &t->borders[i];
-      *dst = (!printing && pt->show_grid_lines && src->stroke == TABLE_STROKE_NONE
-              ? (struct table_border_style) { .stroke = TABLE_STROKE_DASHED,
-                                              .color = CELL_COLOR_BLACK }
-              : *src);
-    }
+    t->borders[i] = resolve_border_style (pt->look, i,
+                                          printing && pt->show_grid_lines);
 
   int body[TABLE_N_AXES][2] = {
     [H] = { 0, n[H] - 1 },