Corruption when deleting tuplets filled with one single chord

• Oct 13, 2016 - 16:52
Reported version
2.1
Type
Functional
Severity
S2 - Critical
Status
closed
Project

See https://musescore.org/en/node/137001
Steps:
- New score or My_first_score
- Select one measure and enter note edit mode
- Press 5 0
- Select the first quarter rest
- Ctrl + 3 to make a triplet
- Press 5 . C to enter a dotted quarter C in the tuplet
- Save the file <- this is important
- Close and re-open the file <- this is important
- Select the triplet number and hit canc
Result:
The triplet is deleted and apparently not replaced by anything.
It appears that in cmdDeleteTuplet at setRest instruction the tick of the tuplet is -1. This is determining the problem.
It becomes -1 during reading of the score: it is a sane value when the tuplet is read, but it becomes -1 during reading of the chord belonging to the tuplet.
I still could not find the exact point when this corruption happens.

Verified under 2.0.3 and commit ac629b716

Moreover:
In Nightly, because of f7cb227ad also the duration of a tuplet when the fraction reduces to 1 is imported wrong during reading of the score (e.g. tuplet with baselength 1/8, actual notes 4, normal notes 4, as in the cited thread).


Comments

From what I understand, when a duration element is read its tick is -1 and when it is added to the tuplet here also the tick of the tuplet is set to -1. Then the tick of the chord is read back, but the tuplet tick is not updated.
Tuplet tick is updated when further elements are added to the tuplet, since that same line is responsible for making the tick of the tuplet the correct one (each time an element is added, the tick of the front element is set as the tick of the tuplet).