Revert "work"
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 1 Dec 2025 16:57:18 +0000 (08:57 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 1 Dec 2025 16:57:18 +0000 (08:57 -0800)
This reverts commit 8c619b5d09368c47c7560a7f63fac15c1d08e6ad.

rust/pspp/src/output/render.rs

index 25e40a56db6eaea3189046b99b1d1729f2238429..9b4d71cc5799e65751f12e955298a083baa717dc 100644 (file)
@@ -686,7 +686,6 @@ impl Page {
         pixel0: usize,
         pixel1: usize,
     ) -> Arc<Self> {
-        dbg!((a, &extent, pixel0, pixel1));
         let b = !a;
         let z0 = extent.start;
         let z1 = extent.end;
@@ -757,10 +756,8 @@ impl Page {
             p0: pixel0,
             p1: pixel1,
         };
-
         // Add overflows along the left side...
         if self.h[a] == 0 || z0 > self.h[a] || pixel0 > 0 {
-            dbg!();
             let mut z = 0;
             while z < self.n[b] {
                 let d = Coord2::for_axis((a, z0), z);
@@ -1177,7 +1174,6 @@ impl Break {
         let mut size = self
             .page
             .axis_width(self.axis, 0..rule_ofs(self.page.h[self.axis]));
-        dbg!(size);
 
         // If we have a pixel offset and there is no header, then we omit
         // the leftmost rule of the body.  Otherwise the rendering is deceptive
@@ -1189,28 +1185,24 @@ impl Break {
         // assume that the width of a merged rule is the larger of the widths of
         // either rule individually.
         if self.pixel == 0 || self.page.h[self.axis] > 0 {
-            size += dbg!(max(
+            size += max(
                 self.page.rule_width(self.axis, self.page.h[self.axis]),
                 self.page.rule_width(self.axis, self.z),
-            ));
+            );
         }
 
         // Width of body, minus any pixel offset in the leftmost cell.
-        dbg!(self.z..cell);
-        dbg!(&self.page.cp[self.axis]);
-        size += dbg!(
-            self.page
-                .joined_width(self.axis, self.z..cell)
-                .strict_sub(self.pixel)
-        );
+        size += self
+            .page
+            .joined_width(self.axis, self.z..cell)
+            .checked_sub(self.pixel)
+            .unwrap();
 
         // Width of rightmost rule in body merged with leftmost rule in headers.
-        size += dbg!(max(
+        size += max(
             self.page.rule_width_r(self.axis, 0),
             self.page.rule_width(self.axis, cell),
-        ));
-
-        dbg!((cell, size));
+        );
 
         size
     }
@@ -1225,10 +1217,7 @@ impl Break {
             return None;
         }
 
-        dbg!(&self.page);
-        dbg!(&self.page.cp[self.axis]);
-        dbg!((self.axis, self.z, size));
-        dbg!(self.find_breakpoint(device, size)).map(|(z, pixel)| {
+        self.find_breakpoint(device, size).map(|(z, pixel)| {
             let page = match pixel {
                 0 => self.page.select(self.axis, self.z..z, self.pixel, 0),
                 pixel => self.page.select(
@@ -1246,7 +1235,6 @@ impl Break {
 
     fn break_cell(&self, device: &dyn Device, z: usize, overflow: usize) -> usize {
         if self.cell_is_breakable(device, z) {
-            dbg!(z);
             // If there is no right header and we render a partial cell
             // on the right side of the body, then we omit the rightmost
             // rule of the body.  Otherwise the rendering is deceptive
@@ -1345,10 +1333,6 @@ impl Break {
     /// This is just a heuristic.  Breaking cells across page boundaries can
     /// save space, but it looks ugly.
     fn cell_is_breakable(&self, device: &dyn Device, cell: usize) -> bool {
-        dbg!((
-            self.page.cell_width(self.axis, cell),
-            device.params().min_break[self.axis]
-        ));
         self.page.cell_width(self.axis, cell) >= device.params().min_break[self.axis]
     }
 }