Skip to main content

write_geometry_fill_line_effects

Function write_geometry_fill_line_effects 

Source
pub fn write_geometry_fill_line_effects<W>(
    writer: &mut Writer<W>,
    properties: &ShapeProperties,
    default_preset: &str,
) -> Result<(), Error>
where W: Write,
Expand description

Writes EG_Geometry/EG_FillProperties/<a:ln>/<a:effectLst>, in that schema order — like write_shape_properties, minus <a:xfrm>, and with one difference that matters in practice: when properties.geometry is unset, this writes a fixed <a:prstGeom prst="{default_preset}"><a:avLst/></a:prstGeom> fallback instead of omitting the geometry element entirely.

Shared by word-ooxml, excel-ooxml, and powerpoint-ooxml’s own picture/autoshape/connector write sites, since real Office silently refuses to render a shape whose spPr has a fill/line but no geometry element at all, so write_shape_properties alone (which only ever writes a geometry element when the caller explicitly set one) isn’t safe to use for a picture or shape that must always render. A single shared implementation also avoids each host crate needing to remember every field independently — in particular effects, which is correctly read back into memory by the already-unified crate::read_shape_properties and must be written back out the same way. Callers write their own <a:xfrm> before calling this (deliberately excluded — see this function’s own callers for why: Excel’s picture position is anchor-driven and always writes a zero-valued placeholder a:xfrm; Word derives its a:xfrm from the image’s own width_emu/height_emu, never from properties.transform; PowerPoint uses properties.transform directly).