Skip to content

Commit

Permalink
fix #164571: UNDO does not remove instrument from mixer
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmcclinch committed May 28, 2019
1 parent 2a63693 commit 7c2eb81
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libmscore/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2413,15 +2413,20 @@ void Score::cmdRemovePart(Part* part)

void Score::insertPart(Part* part, int idx)
{
bool inserted = false;
int staff = 0;
for (QList<Part*>::iterator i = _parts.begin(); i != _parts.end(); ++i) {
if (staff >= idx) {
_parts.insert(i, part);
return;
inserted = true;
break;
}
staff += (*i)->nstaves();
}
_parts.push_back(part);
if (!inserted)
_parts.push_back(part);
masterScore()->rebuildMidiMapping();
setInstrumentsChanged(true);
}

//---------------------------------------------------------
Expand All @@ -2431,6 +2436,8 @@ void Score::insertPart(Part* part, int idx)
void Score::removePart(Part* part)
{
_parts.removeAt(_parts.indexOf(part));
masterScore()->rebuildMidiMapping();
setInstrumentsChanged(true);
}

//---------------------------------------------------------
Expand Down

0 comments on commit 7c2eb81

Please sign in to comment.