Skip to content

Nested block content controls: preserve the full SDT container hierarchy #3752

Description

@caio-pizzol

#3745 reports that nested block content controls are dropped during layout conversion. The root cause is that the layout pipeline represents one content control per block, but OOXML lets block SDTs nest (CT_SdtContentBlock permits a child sdt), and each control carries its own identity and lock targeting its nearest ancestor. Flattening to the nearest control drops the inner content and loses the outer control's identity.

The fix preserves the full container ancestry, outer to inner, from the layout adapter through resolved layout and into the painter, so nested controls keep their content, metadata, grouping, and chrome. #3746 (thanks @tom-material) identified the failing path.

Plan:

  • Data model: record an ordered container chain on every emitted block; recover inner content. (fix(layout-adapter): preserve nested block content-control ancestry (#3745) #3753)
  • documentSection path: route its nested structuredContentBlock / documentPartObject children through the same traversal so they are not dropped.
  • Resolved layout: carry the key chain (including image and drawing fragments) and fold it into the block version signature so paint reuse invalidates correctly.
  • Painter: depth-aware boundaries and layered chrome for the flat body fragment list, so the outer box wraps the inner.
  • Cleanup: migrate the singular container field and the table ancestor-threading onto the chain; snapshot and dataset consume it.

Out of scope: editor lock enforcement, which reads the PM tree directly and is unchanged. Closes #3745 when the painter step lands.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions