diff --git a/locales/ar-SA/opencadstudio.ftl b/locales/ar-SA/opencadstudio.ftl index 086103a53..cadbbe11d 100644 --- a/locales/ar-SA/opencadstudio.ftl +++ b/locales/ar-SA/opencadstudio.ftl @@ -3513,7 +3513,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/bg-BG/opencadstudio.ftl b/locales/bg-BG/opencadstudio.ftl index 6f45a9cad..cedb34c04 100644 --- a/locales/bg-BG/opencadstudio.ftl +++ b/locales/bg-BG/opencadstudio.ftl @@ -3500,7 +3500,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/cs-CZ/opencadstudio.ftl b/locales/cs-CZ/opencadstudio.ftl index 0d402d071..cd454c24d 100644 --- a/locales/cs-CZ/opencadstudio.ftl +++ b/locales/cs-CZ/opencadstudio.ftl @@ -3498,7 +3498,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/de-DE/opencadstudio.ftl b/locales/de-DE/opencadstudio.ftl index ea5dc63bd..59b292a4e 100644 --- a/locales/de-DE/opencadstudio.ftl +++ b/locales/de-DE/opencadstudio.ftl @@ -3501,7 +3501,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/el-GR/opencadstudio.ftl b/locales/el-GR/opencadstudio.ftl index b25dca8b1..6c3de1640 100644 --- a/locales/el-GR/opencadstudio.ftl +++ b/locales/el-GR/opencadstudio.ftl @@ -3501,7 +3501,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/en-US/opencadstudio.ftl b/locales/en-US/opencadstudio.ftl index 3386f5680..e94c1ed7a 100644 --- a/locales/en-US/opencadstudio.ftl +++ b/locales/en-US/opencadstudio.ftl @@ -3502,7 +3502,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/es-ES/opencadstudio.ftl b/locales/es-ES/opencadstudio.ftl index bc6b1303a..844d251ef 100644 --- a/locales/es-ES/opencadstudio.ftl +++ b/locales/es-ES/opencadstudio.ftl @@ -3501,7 +3501,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/fi-FI/opencadstudio.ftl b/locales/fi-FI/opencadstudio.ftl index deaae6f0b..f509bd21a 100644 --- a/locales/fi-FI/opencadstudio.ftl +++ b/locales/fi-FI/opencadstudio.ftl @@ -3500,7 +3500,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/fr-FR/opencadstudio.ftl b/locales/fr-FR/opencadstudio.ftl index 6cb410200..2c9308c48 100644 --- a/locales/fr-FR/opencadstudio.ftl +++ b/locales/fr-FR/opencadstudio.ftl @@ -3501,7 +3501,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/hi-IN/opencadstudio.ftl b/locales/hi-IN/opencadstudio.ftl index 000a4022b..b6c73882a 100644 --- a/locales/hi-IN/opencadstudio.ftl +++ b/locales/hi-IN/opencadstudio.ftl @@ -3489,7 +3489,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/hu-HU/opencadstudio.ftl b/locales/hu-HU/opencadstudio.ftl index 5a6e20e44..fe848f2b9 100644 --- a/locales/hu-HU/opencadstudio.ftl +++ b/locales/hu-HU/opencadstudio.ftl @@ -3500,7 +3500,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/it-IT/opencadstudio.ftl b/locales/it-IT/opencadstudio.ftl index 950f61cb1..10aafa0c6 100644 --- a/locales/it-IT/opencadstudio.ftl +++ b/locales/it-IT/opencadstudio.ftl @@ -3500,7 +3500,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/ja-JP/opencadstudio.ftl b/locales/ja-JP/opencadstudio.ftl index 9dc6be515..7c5fc024d 100644 --- a/locales/ja-JP/opencadstudio.ftl +++ b/locales/ja-JP/opencadstudio.ftl @@ -3491,7 +3491,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/ko-KR/opencadstudio.ftl b/locales/ko-KR/opencadstudio.ftl index 0a82d0cb1..fa67e6afb 100644 --- a/locales/ko-KR/opencadstudio.ftl +++ b/locales/ko-KR/opencadstudio.ftl @@ -3500,7 +3500,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/nl-NL/opencadstudio.ftl b/locales/nl-NL/opencadstudio.ftl index 85d9392a6..51160a44c 100644 --- a/locales/nl-NL/opencadstudio.ftl +++ b/locales/nl-NL/opencadstudio.ftl @@ -3499,7 +3499,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/pl-PL/opencadstudio.ftl b/locales/pl-PL/opencadstudio.ftl index 4c08862e9..6bf699cdf 100644 --- a/locales/pl-PL/opencadstudio.ftl +++ b/locales/pl-PL/opencadstudio.ftl @@ -3500,7 +3500,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/pt-BR/opencadstudio.ftl b/locales/pt-BR/opencadstudio.ftl index ada0c1cab..f07f8a290 100644 --- a/locales/pt-BR/opencadstudio.ftl +++ b/locales/pt-BR/opencadstudio.ftl @@ -3501,7 +3501,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/ru-RU/opencadstudio.ftl b/locales/ru-RU/opencadstudio.ftl index e121d8e19..79b40d786 100644 --- a/locales/ru-RU/opencadstudio.ftl +++ b/locales/ru-RU/opencadstudio.ftl @@ -3502,7 +3502,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/tr-TR/opencadstudio.ftl b/locales/tr-TR/opencadstudio.ftl index e3ed5e4af..0469280c5 100644 --- a/locales/tr-TR/opencadstudio.ftl +++ b/locales/tr-TR/opencadstudio.ftl @@ -3475,7 +3475,6 @@ insert = .xref-attach-dialog-title = Harici Referans Ekle .xref-attach-browse = Gözat... .xref-attach-reference-type = Referans Türü - .xref-attach-specify-on-screen = Ekranda belirt .xref-attach-uniform-scale = Eşit ölçek .xref-attach-insertion-point = Ekleme noktası .xref-attach-angle = Açı: diff --git a/locales/zh-CN/opencadstudio.ftl b/locales/zh-CN/opencadstudio.ftl index 70c893578..4021c3982 100644 --- a/locales/zh-CN/opencadstudio.ftl +++ b/locales/zh-CN/opencadstudio.ftl @@ -3488,7 +3488,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/locales/zh-TW/opencadstudio.ftl b/locales/zh-TW/opencadstudio.ftl index 82a6f9fc1..0e231fa6f 100644 --- a/locales/zh-TW/opencadstudio.ftl +++ b/locales/zh-TW/opencadstudio.ftl @@ -3500,7 +3500,6 @@ insert = .xref-attach-dialog-title = Attach External Reference .xref-attach-browse = Browse... .xref-attach-reference-type = Reference Type - .xref-attach-specify-on-screen = Specify On-screen .xref-attach-uniform-scale = Uniform Scale .xref-attach-insertion-point = Insertion point .xref-attach-angle = Angle: diff --git a/src/app/command_driver.rs b/src/app/command_driver.rs index f9f057a90..38affcb23 100644 --- a/src/app/command_driver.rs +++ b/src/app/command_driver.rs @@ -711,8 +711,12 @@ impl OpenCADStudio { let toks: Vec = tokens.iter().map(|s| s.to_string()).collect(); return self.finish_active_command(&toks, finish); } + // Bare XREF opens the External References palette, so probing the + // verb alone would open it (and refresh every entry) before the + // argument form `XREF Reload A` runs. if tokens[0].eq_ignore_ascii_case("BACKGROUND") || tokens[0].eq_ignore_ascii_case("COLORSCHEME") + || tokens[0].eq_ignore_ascii_case("XREF") { return self.dispatch_command(cmd); } diff --git a/src/app/commands/blocks.rs b/src/app/commands/blocks.rs index 6e4deae53..0015f45c7 100644 --- a/src/app/commands/blocks.rs +++ b/src/app/commands/blocks.rs @@ -1598,11 +1598,11 @@ mod tests { #[test] fn xref_dash_alias_lists_like_xref() { - // `-XREF` is accepted as an alias for industry muscle memory; bare - // `XREF` keeps the legacy list output for compatibility. + // `-XREF` asks on the command line: `?` then Enter prints the + // reference table; `XREF ?` keeps the legacy list output for scripts. let mut app = fresh_app(); let out = run_capture(&mut app, "-XREF ?"); - assert!(out.contains("No external references") || out.contains("External references")); + assert!(out.contains("Total Xref(s): 0"), "got: {out:?}"); } #[test] @@ -2015,9 +2015,15 @@ mod tests { #[test] fn xref_attach_with_file_starts_placement() { // F10: `XREF Attach ` threads the file into the XATTACH - // placement command (same flow as the picker result). + // placement command (same flow as the picker result). A missing file + // is rejected up front, so the reference has to exist. + let dir = std::env::temp_dir().join(format!("ocs_xref_attach_{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let file = dir.join("plan.dwg"); + std::fs::write(&file, b"fake").unwrap(); let mut app = fresh_app(); - let out = run_capture(&mut app, "XREF Attach C:/refs/plan.dwg"); + let out = run_capture(&mut app, &format!("XREF Attach {}", file.to_string_lossy())); + std::fs::remove_dir_all(&dir).ok(); assert!( !out.contains("ships with reference operations"), "dead-end text must be gone, got: {out:?}" diff --git a/src/app/commands/xref_attach.rs b/src/app/commands/xref_attach.rs index e21ee4458..e80e59773 100644 --- a/src/app/commands/xref_attach.rs +++ b/src/app/commands/xref_attach.rs @@ -175,6 +175,7 @@ impl OpenCADStudio { path: &str, ) -> (Vec, i16) { // ponytail: a huge reference skips the ghost; cap by entity count. + #[cfg(not(target_arch = "wasm32"))] const MAX_PREVIEW_ENTITIES: usize = 20_000; let scene = &self.tabs[i].scene; if let Some(name) = existing { @@ -264,6 +265,7 @@ impl OpenCADStudio { /// Fills the dialog from the chosen file: name, preview, block unit and /// the paths shown under Details. fn load_xref_attach_file(&self, state: &mut XrefAttachState, path: &str) { + #[cfg(not(target_arch = "wasm32"))] let i = self.active_tab; state.path = path.to_string(); state.name = path_to_block_name(path); diff --git a/src/io/xref.rs b/src/io/xref.rs index 9c3c20ed6..f114a572e 100644 --- a/src/io/xref.rs +++ b/src/io/xref.rs @@ -1857,13 +1857,6 @@ fn same_file(a: &Path, b: &Path) -> bool { } } -/// Remove one xref's `name|*` dependent symbols (case-insensitive): layers, -/// linetypes, text styles, dim styles, and nested block records — plus every -/// entity and draw-order table owned by those dependent blocks. -/// -/// Shared by Detach (which then also erases the BlockRecord itself) and BIND -/// (which drops the previous merge before re-merging under `$N$` names). The -/// xref BlockRecord itself, its INSERTs, and non-prefixed symbols stay. /// Make the named references' paths relative to `host` (their drawing's /// first save); a reference that cannot be relative keeps its full path. pub fn make_relative( @@ -1922,6 +1915,13 @@ fn linetype_styles(doc: &CadDocument) -> HashSet { .collect() } +/// Remove one xref's `name|*` dependent symbols (case-insensitive): layers, +/// linetypes, text styles, dim styles, and nested block records — plus every +/// entity and draw-order table owned by those dependent blocks. +/// +/// Shared by Detach (which then also erases the BlockRecord itself) and BIND +/// (which drops the previous merge before re-merging under `$N$` names). The +/// xref BlockRecord itself, its INSERTs, and non-prefixed symbols stay. fn remove_pipe_symbols(doc: &mut CadDocument, name: &str) { remove_dependent_symbols(doc, name, true); } diff --git a/src/locale_catalog.rs b/src/locale_catalog.rs index ebc8a4938..9b7388e1c 100644 --- a/src/locale_catalog.rs +++ b/src/locale_catalog.rs @@ -268,7 +268,6 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static "Attach External Reference" => Some(("insert", "xref-attach-dialog-title")), "Browse..." => Some(("insert", "xref-attach-browse")), "Reference Type" => Some(("insert", "xref-attach-reference-type")), - "Specify On-screen" => Some(("insert", "xref-attach-specify-on-screen")), "Uniform Scale" => Some(("insert", "xref-attach-uniform-scale")), "Insertion point" => Some(("insert", "xref-attach-insertion-point")), "Angle:" => Some(("insert", "xref-attach-angle")), diff --git a/src/scene/parametric_constraints.rs b/src/scene/parametric_constraints.rs index 96aa14da8..5073640fb 100644 --- a/src/scene/parametric_constraints.rs +++ b/src/scene/parametric_constraints.rs @@ -2507,7 +2507,9 @@ impl super::Scene { } /// The document as written to a file: a dynamic dimension's screen-size - /// overrides are a display matter and stay out of the file. + /// overrides are a display matter and stay out of the file, and so does + /// what resolving an external reference merged in (its geometry, nested + /// blocks and styles), which the file never stores. pub(crate) fn document_for_save(&self) -> acadrust::CadDocument { use crate::entities::dim_override as ov; let mut document = self.document.clone();