Hierarchical sheet creation logic does not apply to filename field editing
Description
Look at the videos and steps to reproduce.
Steps to reproduce
- Open standalone eeschema, create root sheet, save it;
- Create 1st subsheet, add contents to it "sheet 1 cont", do not save nothing;
- Make a duplicate of 1st subsheet;
- Rename the new 2nd subsheet by editing filename field the sheet (BUG 1 here);
- Browse both sheets;
At this point, it is expected to have three different sheets in the memory:
a) Root sheet;
b) Initial 1st subsheet with content of "sheet 1 cont";
c) 2nd subsheet, with different filename, but with contents, copied from "sheet 1 cont". Have three sheets with non linked contents between them;
I reality, only root sheet and initial subsheet coexists in the memory, there is no 3rd sheet (2nd subsheet).
- Look at filesystem. Only root kicad_sch exists in the filesystem (probably this is ok);
- Click save. Look at filesystem now;
- Only 1st subsheet is created (visible only root and 1st subsheet in filesystem).
It is expected to have three sheets, as described in step c). One can browse non existing 2nd subsheet, having different filename and title (BUG 1a here), which is definitely a bug.
It is expected for "edit hierarchical filename field" action to act as "Save this hierarchical sheet as new sheet", silently, in the background.
Workaround
- Close eeschema, relaunch;
- Error about 2nd subsheet not found is thrown;
- Navigate into 2nd subsheet (empty document is shown);
- Click save;
- Only now 2nd subsheet is created on the filesystem.
KiCad Version
Application: KiCad Schematic Editor (64-bit)
Version: (5.99.0-11043-g1a35d8ba5d), release build
Libraries:
wxWidgets 3.1.5
libcurl/7.74.0-DEV Schannel zlib/1.2.11
Platform: Windows 10 (build 19042), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Date: Jun 15 2021 21:01:02
wxWidgets: 3.1.5 (wchar_t,STL containers)
Boost: 1.75.0
OCC: 7.5.0
Curl: 7.74.0-DEV
ngspice: 34
Compiler: Visual C++ 1928 without C++ ABI
Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON