Multiline slur cannot be fully deleted if it spans for more than one measure in its first system

• Oct 25, 2018 - 09:38
Reported version
3.0
Type
Functional
Severity
S2 - Critical
Status
closed
Project

Steps to reproduce:
1. Open this score: multiline_slur.mscz.
2. Select the slur in it.
3. Press Delete.
Expected results: slur is fully removed.
Actual results: slur segment in the second staff is still present. You cannot remove it but it disappears on file save.


Comments

Severity S4 - Minor S2 - Critical

This happens with several different types of spanner (but not Ottavas). The reason is that the case for ElementType::OTTAVA in Score::removeElement() includes these lines:

foreach(SpannerSegment* ss, o->spannerSegments()) {
      if (ss->system())
            ss->system()->remove(ss);
      }

whereas the corresponding code in the handling of other spanners is commented out. I do not know why it was commented out in the one place and left enabled in the other, but I do know that the orphan spanner segments disappear upon relayout of the systems to which they belong. One way to fix this issue is to replace the loop that removes spanner segments from their systems with the line

setLayout(spanner->tick2());

Come to think of it, this is needed anyway for Autoplace to do its job.

I am increasing the priority to critical because, not surprisingly, this issue can lead to a crash.
1. Create a spanner (not an Ottava) that spans multiple measures in one system and extends to the next system.
2. Undo.
3. Select the remaining spanner segment, and press Delete.
This will cause the program will crash.

Status (old) patch (code needs review) fixed
Status fixed

Fixed in branch master, commit 5d126adda7

fix #277436: Multiline slur cannot be fully deleted if it spans for more than one measure in its first system

Fixed in branch master, commit edba9900a3

Merge pull request #4061 from mattmcclinch/277436-remove-spanner

fix #277436: Multiline slur cannot be fully deleted if it spans for more than one measure in its first system