Merge pull request #4358 from dmitrio95/selection-copy-fixup

fix #279662: fixup for aeb4919e77
This commit is contained in:
anatoly-os 2018-12-09 19:21:21 +02:00 committed by GitHub
commit 29165bbab5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -1254,7 +1254,7 @@ void Score::cmdAddTie(bool addToChord)
void Score::cmdAddOttava(OttavaType type)
{
const Selection& sel = selection();
const Selection sel = selection(); // copy selection state before the operation.
// add on each staff if possible
if (sel.isRange() && sel.staffStart() != sel.staffEnd() - 1) {
for (int staffIdx = sel.staffStart() ; staffIdx < sel.staffEnd(); ++staffIdx) {

View file

@ -456,7 +456,7 @@ void Palette::applyPaletteElement(PaletteCell* cell, Qt::KeyboardModifiers modif
Score* score = mscore->currentScore();
if (score == 0)
return;
const Selection& sel = score->selection(); // make a copy of the list
const Selection sel = score->selection(); // make a copy of selection state before applying the operation.
if (sel.isNone())
return;

View file

@ -3332,8 +3332,7 @@ void ScoreView::cmdAddNoteLine()
void ScoreView::cmdChangeEnharmonic(bool both)
{
_score->startCmd();
Selection& selection = _score->selection();
QList<Note*> notes = selection.uniqueNotes();
QList<Note*> notes = _score->selection().uniqueNotes();
for (Note* n : notes) {
Staff* staff = n->staff();
if (staff->part()->instrument()->useDrumset())
@ -3394,6 +3393,7 @@ void ScoreView::cmdChangeEnharmonic(bool both)
}
}
Selection& selection = _score->selection();
selection.clear();
for (Note* n : notes)
selection.add(n);