forked from 1b-agent/opencadstudio-upstream
fix(styles): follow text rename into dimstyle dimtxsty
rename_style_storage and rename_symbol rewrote entities and table rows but left dimtxsty stale, so the next Apply resolved a NULL handle. The follow now lives in both shared functions; the plugin workaround is removed as redundant. Tests: text_rename_follows_dimtxsty drives the manager path (RED first); pre-existing plugin rename test stays green via the shared path. Full suite: 2015 passed / 0 failed / 25 ignored.
This commit is contained in:
1 parent
713930de82
commit
a3742e5668
3 files changed
+43
-8
No files matched your search
@@ -3572,6 +3572,13 @@ fn rename_symbol(doc: &mut codec::CadDocument, ty: &str, old: &str, new: &str) -
|
||||
if doc.header.current_text_style_name.eq_ignore_ascii_case(old) {
|
||||
doc.header.current_text_style_name = new.to_string();
|
||||
}
|
||||
// Dimension styles name their text style; follow the rename (same
|
||||
// as rename_style_storage — see #42).
|
||||
for ds in doc.dim_styles.iter_mut() {
|
||||
if ds.dimtxsty.eq_ignore_ascii_case(old) {
|
||||
ds.dimtxsty = new.to_string();
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
"DIMSTYLE" => {
|
||||
|
||||
Reference in new issue
Block a user