Fix rendering bug.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 6 Apr 2025 16:42:54 +0000 (09:42 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 6 Apr 2025 16:43:10 +0000 (09:43 -0700)
rust/pspp/src/output/pivot/output.rs

index 3679e6be6145b1757619678968c7a5706477514d..0f8d7584796bbb3a74d7200c394edd1d99f47e90 100644 (file)
@@ -460,14 +460,16 @@ fn compose_headings(
                 .map(|c| (x..x + 1, c))
             });
 
-            // Merge adjacent identical categories.
-            let categories = categories.coalesce(|(a_r, a), (b_r, b)| {
-                if a.ptr_eq(&b) {
-                    Ok((a_r.start..b_r.end, a))
-                } else {
-                    Err(((a_r, a), (b_r, b)))
-                }
-            });
+            // Merge adjacent identical categories (but don't merge across a vertical rule).
+            let categories = categories
+                .coalesce(|(a_r, a), (b_r, b)| {
+                    if !vrules[b_r.start] && a.ptr_eq(&b) {
+                        Ok((a_r.start..b_r.end, a))
+                    } else {
+                        Err(((a_r, a), (b_r, b)))
+                    }
+                })
+                .collect::<Vec<_>>();
 
             for (Range { start: x1, end: x2 }, c) in categories {
                 let y1 = top_row + row_ofs;