Skip to content

Commit ee89e2f

Browse files
Merge pull request #33928 from mathesoncalum/main_ports
Porting 4.7.X PRs to main
2 parents 1a54b02 + c9d5fa2 commit ee89e2f

3 files changed

Lines changed: 26 additions & 4 deletions

File tree

src/engraving/dom/paste.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,17 @@ bool Score::cmdRepeatListSelection()
316316
foundChords.emplace(sourceChord);
317317
is.setSegment(sourceChord->segment());
318318
is.moveToNextInputPos();
319-
is.setDuration(sourceChord->durationType());
319+
320+
if (is.noteEntryMode()) {
321+
// In note input mode - use the duration of from the note input panel (InputState)...
322+
IF_ASSERT_FAILED(is.duration().isValid()) {
323+
LOGE() << "Invalid InputState duration";
324+
is.setDuration(sourceChord->durationType());
325+
}
326+
} else {
327+
// Otherwise set it based on the duration of the previous chord...
328+
is.setDuration(sourceChord->durationType());
329+
}
320330
}
321331

322332
NoteVal nval = n->noteVal();

src/engraving/dom/spanner.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,12 @@ void Spanner::setTick(const Fraction& v)
13951395

13961396
void Spanner::setTick2(const Fraction& f)
13971397
{
1398-
setTicks(f - m_tick);
1398+
Fraction ticks = f - m_tick;
1399+
IF_ASSERT_FAILED(f >= m_tick) {
1400+
ticks = m_tick - f;
1401+
m_tick = f;
1402+
}
1403+
setTicks(ticks);
13991404
}
14001405

14011406
//---------------------------------------------------------

src/engraving/editing/edit.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7514,7 +7514,11 @@ void Score::doUndoRemoveStaleTieJumpPoints(Tie* tie, bool undo)
75147514
void Score::doUndoResetPartialSlur(Slur* slur, bool undo)
75157515
{
75167516
const size_t undoIdx = undoStack()->currentIndex();
7517-
if (!slur->startCR()->hasPrecedingJumpItem() && slur->isIncoming()) {
7517+
7518+
const ChordRest* startCR = slur ? slur->startCR() : nullptr;
7519+
IF_ASSERT_FAILED(startCR) {
7520+
LOGE() << "Slur is corrupted";
7521+
} else if (!startCR->hasPrecedingJumpItem() && slur->isIncoming()) {
75187522
if (undo) {
75197523
startCmd(TranslatableString("engraving", "Reset incoming partial slur"));
75207524
slur->undoSetIncoming(false);
@@ -7524,7 +7528,10 @@ void Score::doUndoResetPartialSlur(Slur* slur, bool undo)
75247528
}
75257529
}
75267530

7527-
if (!slur->endCR()->hasFollowingJumpItem() && slur->isOutgoing()) {
7531+
const ChordRest* endCR = slur ? slur->endCR() : nullptr;
7532+
IF_ASSERT_FAILED(endCR) {
7533+
LOGE() << "Slur is corrupted";
7534+
} else if (!endCR->hasFollowingJumpItem() && slur->isOutgoing()) {
75287535
if (undo) {
75297536
startCmd(TranslatableString("engraving", "Reset outgoing partial slur"));
75307537
slur->undoSetOutgoing(false);

0 commit comments

Comments
 (0)