cloneMeasure breaks tuples

• Jan 11, 2019 - 23:50
Reported version
3.0
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

measure.cpp cloneMeasure (row 2819 onwards) reads
if (nt == 0) {
nt = new Tuplet(ot);
nt->clear();
nt->setTrack(track);
nt->setScore(sc);
tupletMap.add(ot, nt);
}
its *definitely
missing
nt->setParent(m)
.
I discovered this while working on a feature on my own fork that it broke so I am not sure what else it may break, but best to fix it before they are found by users.


Comments

It is certainly a good idea to do this. Also, we had better add this line to the same block of code:

nt->setTick(m->tick() + ot->rtick());

But here is the thing. As it stands, Measure::cloneMeasure() is only called by Score::appendScore(), and Score::appendScore() is not called anywhere at all. Score::appendScore() is not to be confused with MuseScore::appendScore(), by the way. So I would not worry about this being found by users. We can fix this now, or margus.niitsoo, you can fix this when you implement your new feature.