Skip to content

Commit

Permalink
when deleting a range, remove all elements, not only chord/rests
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Feb 20, 2015
1 parent 45b2695 commit 41af30e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libmscore/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1864,9 +1864,14 @@ void Score::cmdDeleteSelection()
undoRemoveElement(annotation);
}

if (s->segmentType() != Segment::Type::ChordRest || !s->element(track))
Element* e = s->element(track);
if (!e)
continue;
ChordRest* cr = static_cast<ChordRest*>(s->element(track));
if (s->segmentType() != Segment::Type::ChordRest) {
undoRemoveElement(e);
continue;
}
ChordRest* cr = static_cast<ChordRest*>(e);
if (tick == -1) {
// first ChordRest found:
int offset = cr->tick() - s->measure()->tick();
Expand Down

1 comment on commit 41af30e

@MarcSabatella
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wschweer : this has the effect of removing time signatures and key signatures when deleting a range. Is that really what was intended? Seems very wrong to me, and very different from how things have worked in the past. And it corrupts the affected staves, since we remove the time signature without rewriting the measures.

I'm guessing this was meant to delete something other chord rests, but not time or key sigantures. I think we should at least exempt time and key signatures here. But I'd love to udnerstand what the intended purposes was.

Please sign in to comment.