[ver 1.0] Accidental offset in small staves corrupted by saving and reloading

• May 7, 2011 - 00:39
Type
Functional
Severity
S2 - Critical
Status
closed
Project

Context: ver. 1.0 rev. 4262 (but applies to release version too)

Steps:

1) Create a score containing a small stave and one or more accidentals in that stave
2) Nudge the accidental(s) in the small stave of any amount
3) Save, close and reload repeatedly the score

Result:: the offset of the nudged accidental increases at each iteration of step 3), displacing the accidental more and more. Some small sample scores are attached showing the effect of the first 4 iterations.

Notes:
1) This happens because the accidental, when read (function Accidental::read() in file accidental.cpp), does not know the stave it belongs to and then it cannot scale the offset accordingly to the stave size.

2) The attached patch solves the issue by setting the _track member of the note the accidental belongs to (in function Chord::read(), file chord.cpp) and of the accidental itself (function Note::read(), file note.cpp), before the accidental is read from the file.

3) The same approach ( e->setTrack(track()) ) is already used systematically for instance when reading elements of a measure (see function Measure::read() in file measure.cpp).

4) Priority set to critical as the issue leads to data corruption.


Comments

Status (old) patch (ready to commit) fixed

Sorry. I missed the step of saving everytime. Got it now.
Patch commited in the branch at r4464.
Bug fixed.