more html work
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 1 May 2025 00:44:11 +0000 (17:44 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 1 May 2025 00:44:11 +0000 (17:44 -0700)
rust/pspp/src/output/html.rs
rust/pspp/src/output/pivot/mod.rs

index e1fda2a65444a98ce005729da5394606491e224a..6a316d22c0b5480c0d4123502228d0417dc1fcbf 100644 (file)
@@ -47,7 +47,7 @@ where
     }
 
     fn render(&mut self, pivot_table: &PivotTable) -> std::io::Result<()> {
-        for (index, layer_indexes) in pivot_table.layers(true).enumerate() {
+        for layer_indexes in pivot_table.layers(true) {
             let output = pivot_table.output(&layer_indexes, false);
             write!(&mut self.writer, "<table")?;
             if let Some(notes) = &pivot_table.notes {
@@ -99,7 +99,7 @@ where
                             alternate_row,
                             tag,
                             Some(&output.body),
-                        );
+                        )?;
                     }
                 }
                 writeln!(&mut self.writer, "</tr>")?;
@@ -108,7 +108,7 @@ where
 
             if output.caption.is_some() || output.footnotes.is_some() {
                 writeln!(&mut self.writer, "<tfoot>")?;
-                if let Some(caption) = &output.caption {}
+                todo!();
                 writeln!(&mut self.writer, "</tfoot>")?;
             }
         }
@@ -163,7 +163,8 @@ where
                 &mut style,
                 r#"font-family: "{}""#,
                 Escape::new(&cell.style.font_style.font)
-            );
+            )
+            .unwrap();
         }
 
         if cell.style.font_style.bold {
@@ -218,12 +219,12 @@ where
 
         let col_span = rect[Axis2::X].len();
         if col_span > 1 {
-            write!(&mut self.writer, r#" colspan="{col_span}"#);
+            write!(&mut self.writer, r#" colspan="{col_span}"#)?;
         }
 
         let row_span = rect[Axis2::Y].len();
         if row_span > 1 {
-            write!(&mut self.writer, r#" rowspan="{row_span}"#);
+            write!(&mut self.writer, r#" rowspan="{row_span}"#)?;
         }
 
         write!(&mut self.writer, ">")?;
index 352bc9081c9db6ca4ebe3166b1a48f3665730801..d79e01a3bd0fdee48cc03eb5010ccf942510a78a 100644 (file)
@@ -1719,7 +1719,7 @@ impl<'a> DisplayValue<'a> {
     }
 
     pub fn has_footnotes(&self) -> bool {
-        !self.footnotes().next().is_some()
+        self.footnotes().next().is_some()
     }
 
     pub fn without_suffixes(self) -> Self {