mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-09 18:56:25 +00:00
text/forms/expand.rs was a drifted copy of ungroup.rs. It is gone: text preparation now opens each placement with crate::ungroup, so Ungroup and preparation share one implementation. What the copy added is now in ungroup.rs: a Refusal that says whether the form itself or only this placement is the reason (intrinsic) and whether a rename alone was the problem (renaming), the shows_text result, merges_without_renaming, refusals for unreadable /Resources and /Group entries and arrays with a non-number, a cap on resource counts and q nesting, a total size for pattern copies, and ending an unfinished path with the form. Ungroup's newer behaviour stays: names are read from the operand the renderer uses, so a surplus operand is renamed correctly rather than refused; default colour spaces are compared with the page's; and a group blending in DeviceRGB on a page that names no blending space is drawn inline, as Ungroup does, rather than refused as the copy did. What a form draws is now read within one decode allowance shared with the form itself, so a crafted group can no longer make one Ungroup decode 64 MiB for each of 1024 nested forms. A group whose content can't be checked is refused; for a form without a group, blend modes inside don't matter, and content that can't be checked only means preparation can't tell whether it has text (shows_text is None), which it reports.