From 3bf0f2b48c1561efe7b180674df348600dc64648 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Fri, 16 May 2025 20:55:25 -0300 Subject: [PATCH] clone footers after sorting might want to rethink this --- crates/typst-library/src/layout/grid/resolve.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/typst-library/src/layout/grid/resolve.rs b/crates/typst-library/src/layout/grid/resolve.rs index acb588e95..78f5cd42f 100644 --- a/crates/typst-library/src/layout/grid/resolve.rs +++ b/crates/typst-library/src/layout/grid/resolve.rs @@ -445,7 +445,7 @@ pub struct Header { } /// A repeatable grid footer. Stops at the last row. -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct Footer { /// The first row included in this footer. pub start: usize, @@ -470,6 +470,7 @@ impl Footer { /// It still exists even when not repeatable, but must not have additional /// considerations by grid layout, other than for consistency (such as making /// a certain group of rows unbreakable). +#[derive(Debug, Clone)] pub struct Repeatable { inner: T, @@ -763,7 +764,8 @@ impl<'a> CellGrid<'a> { vlines, hlines, headers, - footers: footer.into_iter().collect(), + footers, + sorted_footers, has_gutter, } } @@ -2406,11 +2408,9 @@ fn skip_auto_index_through_fully_merged_rows( /// at which they start repeating. When a new footer is about to be laid out, /// conflicting footers which come before it in this vector must stop /// repeating. -fn simulate_footer_repetition( - footers: &[Repeatable