Crash when adding fermata on barline in part for staff >1 when score has spanning barlines

• Jun 2, 2017 - 08:29
Reported version
S2 - Critical

MuseScore 2.1 and 2.2-dev 5d3129b

* Create a score for two flutes
* Double click a barline and extend it on the full system
* Add a double barline somewhere in the score
* Create part for the second flute
* Select the double barline in the part
* Double click the fermata from the articulations palette

-> Crash

MuseScore tries to add the fermata on the barline in the score. The barline is not available in the score, it's removed because of the span (?), and MuseScore crashes...

Not sure what would be the expected behavior?


2.0.3 crashes too, so we don't have a regression.

Additional issue: when applying the fermata to the 1st part, it doesn't crash, but it doesn't show up, only in the score, and when applied to only the score ot doesn't show in the part

Expected behavior: The fermata would be placed over the double barline, just like when applied in the score. The fermata should show up in this same place across all parts and in the score.

The root cause is that the barline in the second part is not really linked with the score nor the first part one... We will have the same kind of problems when changing the barline in the second part to dotted barline for example. Maybe the three barlines should be linked... or we should add code to discover all barlines.
It will not be 100% fail proof but we could
* If adding in the score, go through all parts to find staves linked with all the spanned staves
* If adding in the part, find in the score the barline that span the linked staff, and then go through all parts to find staves linked with all spanned staves...

Since we would need to do that when changing type and when adding articulations, I really wonder if wouldn't make sense to link them on part creation or when extending barlines and parts are already created...

The above would be too much for 2.2 and master (3.0) is already very different regarding spanning barlines. I will just fix the crash for 2.2 and see if we can implement the expected behavior in 3.0.