From a36e4e77d3b8ace9d723a016011cc37cbbe53205 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Wed, 14 Oct 2026 23:55:48 +0300 Subject: [PATCH] xref: leave the host's layer 0 and Defpoints unflagged on load Since layer 0 and Defpoints map to the host's own layers, the loop that marks dependent layers flagged the host's layer 0 as xref-dependent and owned by the reference. Skip the layers that keep their name. Co-Authored-By: Claude Opus 5.5 --- src/io/xref.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/io/xref.rs b/src/io/xref.rs index 1b9a4b52c..541362102 100644 --- a/src/io/xref.rs +++ b/src/io/xref.rs @@ -1244,7 +1244,11 @@ fn merge_xref_into_block( // Dependent layers and linetypes carry the xref flag and their owning // reference, the way the file stores them; without it the host writes // plain records with a "|" in the name, which other readers reject. - for name in maps.layers.values() { + // Layer 0 and Defpoints map to the host's own layers, which stay plain. + for (source, name) in &maps.layers { + if name.eq_ignore_ascii_case(source) { + continue; + } if let Some(layer) = doc.layers.get_mut(name) { layer.flags.xref_dependent = true; layer.xref_block_record_handle = br_handle;