avoid needless errors when redoing an operation involving adding notes that were not added because of overlap exclusion preferences

git-svn-id: svn://localhost/ardour2/branches/3.0@7264 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-06-16 16:58:50 +00:00
parent bb34b15944
commit a668964d5c

View File

@ -232,7 +232,12 @@ MidiModel::DiffCommand::operator()()
MidiModel::WriteLock lock(_model->edit_lock());
for (NoteList::iterator i = _added_notes.begin(); i != _added_notes.end(); ++i) {
_model->add_note_unlocked(*i);
if (!_model->add_note_unlocked(*i)) {
/* failed to add it, so don't leave it in the removed list, to
avoid apparent errors on undo.
*/
_removed_notes.remove (*i);
}
}
for (NoteList::iterator i = _removed_notes.begin(); i != _removed_notes.end(); ++i) {