Skip to content

Commit b48a8fa

Browse files
Jojo-SchmitzAsh-86cbjeukendrup
committed
Code review changes
Co-Authored-By: Ashraf El Droubi <[email protected]> Co-Authored-By: Casper Jeukendrup <[email protected]>
1 parent 8440ff3 commit b48a8fa

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/engraving/dom/cmd.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3291,11 +3291,11 @@ void Score::cmdMirrorNoteHead()
32913291

32923292
void Score::cmdIncDecDuration(int nSteps, bool stepDotted)
32933293
{
3294-
if (selection().isRange()) {
3295-
if (!selection().canCopy()) {
3294+
if (m_selection.isRange()) {
3295+
if (!m_selection.canCopy()) {
32963296
return;
32973297
}
3298-
ChordRest* firstCR = selection().firstChordRest();
3298+
ChordRest* firstCR = m_selection.firstChordRest();
32993299
if (firstCR->isGrace()) {
33003300
firstCR = toChordRest(firstCR->parent());
33013301
}
@@ -3313,18 +3313,22 @@ void Score::cmdIncDecDuration(int nSteps, bool stepDotted)
33133313
return;
33143314
}
33153315
}
3316-
const muse::ByteArray mimeData(selection().mimeData());
3316+
const muse::ByteArray mimeData(m_selection.mimeData());
33173317
XmlReader e(mimeData);
3318-
deleteRange(selection().startSegment(), selection().endSegment(), staff2track(selection().staffStart()),
3319-
staff2track(selection().staffEnd()), selectionFilter());
3320-
pasteStaff(e, selection().startSegment(), selection().staffStart(), scale);
3321-
} else if (selection().isList()) {
3318+
deleteRange(m_selection.startSegment(), m_selection.endSegment(), staff2track(m_selection.staffStart()),
3319+
staff2track(m_selection.staffEnd()), selectionFilter(), m_selection.rangeContainsMultiNoteChords());
3320+
pasteStaff(e, m_selection.startSegment(), m_selection.staffStart(), scale);
3321+
} else if (m_selection.isList()) {
33223322
std::set<ChordRest*> crs = getSelectedChordRests();
33233323
for (ChordRest* cr : crs) {
33243324
TDuration newDuration(stepDotted
33253325
? cr->durationType().fraction() * Fraction(3, 3 + nSteps)
33263326
: cr->durationType().fraction()* Fraction(3 - nSteps, 3 + nSteps), true);
3327-
changeCRlen(cr, newDuration);
3327+
if (cr->isChord() && (toChord(cr)->noteType() != NoteType::NORMAL)) {
3328+
undoChangeChordRestLen(cr, newDuration);
3329+
} else {
3330+
changeCRlen(cr, newDuration);
3331+
}
33283332
}
33293333
// 2nd loop needed to reselect what was selected before 1st loop
33303334
// as `changeCRlen()` changes the selection to `SelectType::SINGLE`

0 commit comments

Comments
 (0)