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
@@ -2160,14 +2160,7 @@ impl<'a> HostSession<'a> {
|
||||
}
|
||||
self.push_undo("Rename style");
|
||||
self.app.rename_style_storage(kind_of(kind), &from, &to);
|
||||
if kind == TableStyleKind::Text {
|
||||
// A dimension style names its text style; follow the rename.
|
||||
for dim in self.document_mut().dim_styles.iter_mut() {
|
||||
if dim.dimtxsty.eq_ignore_ascii_case(&from) {
|
||||
dim.dimtxsty = to.clone();
|
||||
}
|
||||
}
|
||||
}
|
||||
// dimtxsty follow lives in rename_style_storage (#42).
|
||||
self.finish_style_change(kind_of(kind));
|
||||
Ok(handle)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user