fix #26516: crash on repitch

This commit is contained in:
Marc Sabatella 2014-06-19 09:27:38 -06:00
parent 2c43586a66
commit 6c003995d4
3 changed files with 4 additions and 3 deletions

View file

@ -398,8 +398,9 @@ Note* Score::addPitch(int pitch, bool addFlag)
if (_is.repitchMode() && _is.cr()->type() == ElementType::CHORD) {
Chord* chord = static_cast<Chord*>(_is.cr());
note = new Note(this);
note->setNval(nval);
note->setParent(chord);
note->setTrack(chord->track());
note->setNval(nval);
if (!addFlag) {
while (!chord->notes().isEmpty())
undoRemoveElement(chord->notes().first());

View file

@ -837,8 +837,9 @@ void Score::repitchNote(const Position& p, bool replace)
chord = static_cast<Chord*>(_is.cr());
}
Note* note = new Note(this);
note->setNval(nval);
note->setParent(chord);
note->setTrack(chord->track());
note->setNval(nval);
if (replace) {
while (!chord->notes().isEmpty())

View file

@ -4787,7 +4787,6 @@ void ScoreView::cmdAddPitch(int note, bool addFlag)
}
}
if (is.repitchMode())
score()->repitchNote(pos, !addFlag);
else