mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-08 21:14:14 +02:00
Recognise seqhf_1 when loading sequential numbers saved the old way
Before the <sequentialNumbers> element, an element's or conductor's sequential numbers were saved as the attributes sequ_1, sequf_1, seqt_1, seqtf_1, seqh_1 and seqhf_1. The readers check for one of them to take the old route, and all three lists had the same slip: sequf_1 twice, seqhf_1 never (Element::fromXml, Conductor::fromXml, and readSequence() in the project database). A file whose only old sequence was the hundred-folio one took the new route, found no <sequentialNumbers>, and lost it; the database built its labels from an empty sequence instead of refusing the fast path as it does for the other five attributes. Name seqhf_1 in the three lists. No file-format change: nothing is written differently, and a file with any of the other five attributes loads exactly as before. Tests: tst_legacysequentialattributes runs the binary's --resave on a fixture whose element and conductor carry only seqhf_1 (and a second pair carrying sequ_1 as a control) and reads the <sequentialNumbers> written back. The two seqhf_1 cases fail on master. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Beat Hangartner <beat@hangartners.ch>
This commit is contained in:
@@ -236,7 +236,7 @@ struct DocumentElement
|
||||
//the attributes files written before <sequentialNumbers> carry.
|
||||
bool readSequence(const QDomElement &item, autonum::sequentialNumbers *sequence)
|
||||
{
|
||||
for (const char *name : {"sequ_1", "sequf_1", "seqt_1", "seqtf_1", "seqh_1"}) {
|
||||
for (const char *name : {"sequ_1", "sequf_1", "seqt_1", "seqtf_1", "seqh_1", "seqhf_1"}) {
|
||||
if (item.hasAttribute(QLatin1String(name))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user