Skip to content

purge: keep text styles used by multileader and table styles - #2129

Merged
HakanSeven12 merged 1 commit into
HakanSeven12:mainfrom
insanedps:pr/purge-mleader-styles
Oct 25, 2026
Merged

HakanSeven12 merged 1 commit into
HakanSeven12:mainfrom
insanedps:pr/purge-mleader-styles

Conversation

@insanedps

Copy link
Copy Markdown
Contributor

Problem

Follow-up to #2123. PURGE All deletes a text style that is used only by a multileader, a multileader style or a table style. These name their text style by handle (a table style also by name), and the purge scan did not look at them. After the purge they point at nothing.

Recipe: a drawing with text style T1 used only by a multileader style (and a multileader in that style). PURGE All, save. In AutoCAD T1 is gone, and both the multileader style and the multileader (and its MTEXT) report a null text style.

Fix

styleprops.rs: the purge's text-style usage scan now also counts the text styles referenced by multileaders, multileader styles and table styles.

Test

purge_keeps_text_styles_used_only_by_leader_and_table_styles fails without the fix. Full cargo test --lib: 3154 passed, 0 failed.

Checked in AutoCAD with a release build and the recipe above: T1 is kept, the multileader style, the multileader and its MTEXT still use it, AUDIT 0.

A multileader, its style and a table style name their text style by
handle (a table style also by name), so PURGE deleted a style only they
used and left them pointing at nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HakanSeven12
HakanSeven12 merged commit 2ed7850 into HakanSeven12:main Oct 25, 2026
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants