monolithic rendering fixes
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 22 Jan 2023 20:34:08 +0000 (12:34 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 27 Jan 2023 19:50:31 +0000 (11:50 -0800)
src/output/pivot-output.c

index e50c273faf1421ebde2b4556244a5909f16abbcf..55d3d5d33bced37e8d5ec60311b73802b6836ec5 100644 (file)
@@ -137,9 +137,10 @@ fill_cell_spanned (struct table *t, int x1, int y1, int x2, int y2,
 
 static void
 fill_cell_owned (struct table *t, int x1, int y1, int x2, int y2,
-                 int style_idx, struct string *s, bool rotate_label)
+                 int style_idx, struct string *s, bool rotate_label,
+                 int options)
 {
-  int options = style_idx << TABLE_CELL_STYLE_SHIFT;
+  options |= style_idx << TABLE_CELL_STYLE_SHIFT;
   if (rotate_label)
     options |= TABLE_CELL_ROTATE;
 
@@ -343,7 +344,7 @@ compose_headings (struct table *t,
       if (d->root->show_label_in_corner && h_ofs > area[h][0])
         {
           int bb[TABLE_N_AXES][2];
-          bb[h][0] = 0;
+          bb[h][0] = area[h][0];
           bb[h][1] = h_ofs - 1;
           bb[v][0] = top_row;
           bb[v][1] = top_row + d->label_depth - 1;
@@ -487,7 +488,8 @@ put_layers (struct table *t, const struct pivot_table *pt,
       struct string s = DS_EMPTY_INITIALIZER;
       pivot_value_format (d->data_leaves[layer_indexes[i]]->name, pt, &s);
       int y = y2 - i;
-      fill_cell_owned (t, x1, y, x2, y, PIVOT_AREA_LAYERS, &s, false);
+      fill_cell_owned (t, x1, y, x2, y, PIVOT_AREA_LAYERS, &s, false,
+                       TABLE_CELL_FULL_WIDTH);
     }
 }
 
@@ -526,7 +528,8 @@ put_footnotes (struct table *t, const struct pivot_table *pt,
       ds_put_cstr (&s, ". ");
       pivot_value_format (f[i]->content, pt, &s);
       int y = y1 + i;
-      fill_cell_owned (t, x1, y, x2, y, PIVOT_AREA_FOOTER, &s, false);
+      fill_cell_owned (t, x1, y, x2, y, PIVOT_AREA_FOOTER, &s, false,
+                       TABLE_CELL_FULL_WIDTH);
     }
 }
 
@@ -841,8 +844,7 @@ pivot_output_monolithic (const struct pivot_table *pt,
       && stub[H] && stub[V])
     fill_cell_spanned (t, body[H][0], body[V][0],
                        body[H][0] + stub[H] - 1, body[V][0] + stub[V] - 1,
-                       PIVOT_AREA_CORNER, pt->corner_text, false,
-                       TABLE_CELL_FULL_WIDTH);
+                       PIVOT_AREA_CORNER, pt->corner_text, false, 0);
 
   if (body[H][1] >= body[H][0] && body[V][1] >= body[V][0])
     {