refactor: make TableCell::kind #[parse] instead of #[synthesized]

This commit is contained in:
Tobias Schmitz 2025-07-11 14:45:45 +02:00
parent e8af101a79
commit e0074d6e39
No known key found for this signature in database
3 changed files with 4 additions and 4 deletions

View File

@ -226,7 +226,7 @@ impl ResolvableCell for Packed<TableCell> {
let breakable = cell.breakable.get(styles).unwrap_or(breakable);
let fill = cell.fill.get_cloned(styles).unwrap_or_else(|| fill.clone());
let kind = cell.kind.unwrap_or_default().or(kind);
let kind = cell.kind.get(styles).or(kind);
let cell_stroke = cell.stroke.resolve(styles);
let stroke_overridden =
@ -271,7 +271,7 @@ impl ResolvableCell for Packed<TableCell> {
}),
);
cell.breakable.set(Smart::Custom(breakable));
cell.kind = Some(kind);
cell.kind.set(kind);
Cell {
body: self.pack(),
locator,

View File

@ -688,7 +688,7 @@ pub struct TableCell {
pub stroke: Sides<Option<Option<Arc<Stroke>>>>,
#[internal]
#[synthesized]
#[parse(Some(Smart::Auto))]
pub kind: Smart<TableCellKind>,
/// Whether rows spanned by this cell can be placed in different pages.

View File

@ -60,7 +60,7 @@ impl TableCtx {
let y = cell.y.get(StyleChain::default()).unwrap_or_else(|| unreachable!());
let rowspan = cell.rowspan.get(StyleChain::default());
let colspan = cell.colspan.get(StyleChain::default());
let kind = cell.kind.expect("kind to be set after layouting");
let kind = cell.kind.get(StyleChain::default());
// Extend the table grid to fit this cell.
let required_height = y + rowspan.get();