Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeat last chord after inputting a rest #714

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#include "libmscore/score.h"
#include "libmscore/segment.h"
#include "libmscore/shadownote.h"
#include "libmscore/shape.h"
#include "libmscore/slur.h"
#include "libmscore/spanner.h"
#include "libmscore/staff.h"
Expand All @@ -75,14 +76,13 @@
#include "libmscore/systemtext.h"
#include "libmscore/textframe.h"
#include "libmscore/text.h"
#include "libmscore/textline.h"
#include "libmscore/timesig.h"
#include "libmscore/tuplet.h"
#include "libmscore/undo.h"
#include "libmscore/utils.h"
#include "libmscore/volta.h"
#include "libmscore/xml.h"
#include "libmscore/textline.h"
#include "libmscore/shape.h"

#ifdef AVSOMR
#include "avsomr/avsomr.h"
Expand Down Expand Up @@ -4963,18 +4963,18 @@ void ScoreView::cmdRepeatSelection()

if (noteEntryMode() && selection.isSingle()) {
Element* el = _score->selection().element();
if (el && el->type() == ElementType::NOTE) {
if (!_score->inputState().endOfScore()) {
_score->startCmd();
bool addTo = false;
Chord* c = static_cast<Note*>(el)->chord();
for (Note* note : c->notes()) {
NoteVal nval = note->noteVal();
_score->addPitch(nval, addTo);
addTo = true;
}
_score->endCmd();
while (el && el->type() != ElementType::NOTE)
el = el->prevSegmentElement();
if (el && el->type() == ElementType::NOTE && !_score->inputState().endOfScore()) {
_score->startCmd();
bool addTo = false;
Chord* c = toNote(el)->chord();
for (Note* note : c->notes()) {
NoteVal nval = note->noteVal();
_score->addPitch(nval, addTo);
addTo = true;
}
_score->endCmd();
}
return;
}
Expand All @@ -4996,7 +4996,7 @@ void ScoreView::cmdRepeatSelection()
QMimeData* mimeData = new QMimeData;
mimeData->setData(mimeType, selection.mimeData());
if (MScore::debugMode)
qDebug("cmdRepeatSelection: <%s>", mimeData->data(mimeType).data());
qDebug("cmdRepeatSelection: <%s>", mimeData->data(mimeType).constData());
QApplication::clipboard()->setMimeData(mimeData);

QByteArray d(mimeData->data(mimeType));
Expand Down Expand Up @@ -5536,7 +5536,7 @@ static const Element* visibleElementInScore(const Element* orig, const Score* s)
if (orig->score() == s && orig->bbox().isValid())
return orig;

for (const ScoreElement* se : orig->linkList()) {
for (ScoreElement*& se : orig->linkList()) {
const Element* e = toElement(se);
if (e->score() == s && e->bbox().isValid()) // bbox check to ensure the element is indeed visible
return e;
Expand Down
Loading