multiple footers

This commit is contained in:
PgBiel 2025-03-03 19:59:41 -03:00
parent 74b1b10986
commit cce5fe739a

View File

@ -678,8 +678,8 @@ pub struct CellGrid<'a> {
pub hlines: Vec<Vec<Line>>, pub hlines: Vec<Vec<Line>>,
/// The repeatable headers of this grid. /// The repeatable headers of this grid.
pub headers: Vec<Repeatable<Header>>, pub headers: Vec<Repeatable<Header>>,
/// The repeatable footer of this grid. /// The repeatable footers of this grid.
pub footer: Option<Repeatable<Footer>>, pub footers: Vec<Repeatable<Footer>>,
/// Whether this grid has gutters. /// Whether this grid has gutters.
pub has_gutter: bool, pub has_gutter: bool,
} }
@ -756,7 +756,7 @@ impl<'a> CellGrid<'a> {
vlines, vlines,
hlines, hlines,
headers, headers,
footer, footers: footer.into_iter().collect(),
has_gutter, has_gutter,
} }
} }
@ -895,6 +895,11 @@ impl<'a> CellGrid<'a> {
pub fn has_repeated_headers(&self) -> bool { pub fn has_repeated_headers(&self) -> bool {
self.headers.iter().any(|h| h.repeated) self.headers.iter().any(|h| h.repeated)
} }
#[inline]
pub fn has_repeated_footers(&self) -> bool {
self.footers.iter().any(|f| f.repeated)
}
} }
/// Resolves and positions all cells in the grid before creating it. /// Resolves and positions all cells in the grid before creating it.