Skip to content

Commit

Permalink
fix #24519
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Feb 25, 2014
1 parent e510aab commit 0ba686c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions libmscore/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ Rest* Score::addRest(Segment* s, int track, TDuration d, Tuplet* tuplet)
rest->setTrack(track);
rest->setParent(s);
rest->setTuplet(tuplet);
undoAddElement(rest);
// undoAddElement(rest);
undoAddCR(rest, tick2measure(s->tick()), s->tick());
return rest;
}

Expand Down Expand Up @@ -1562,13 +1563,13 @@ void Score::cmdFullMeasureRest()
Segment* s2 = selection().endSegment();
int stick1 = selection().tickStart();
int stick2 = selection().tickEnd();

Segment* ss1 = s1;
if (ss1->segmentType() != Segment::SegChordRest)
ss1 = ss1->next1(Segment::SegChordRest);
bool fullMeasure = ss1 && (ss1->measure()->first(Segment::SegChordRest) == ss1)
&& (s2 == 0 || (s2->segmentType() == Segment::SegEndBarLine)
|| (s2->segmentType() == Segment::SegTimeSigAnnounce)
&& (s2 == 0 || (s2->segmentType() == Segment::SegEndBarLine)
|| (s2->segmentType() == Segment::SegTimeSigAnnounce)
|| (s2->segmentType() == Segment::SegKeySigAnnounce));

if (!fullMeasure) {
Expand All @@ -1585,7 +1586,7 @@ void Score::cmdFullMeasureRest()
if (s->segmentType() != Segment::SegChordRest || !s->element(track))
continue;
ChordRest* cr = static_cast<ChordRest*>(s->element(track));

if (tick == -1) {
// first ChordRest found:
tick = s->measure()->tick();
Expand Down
3 changes: 2 additions & 1 deletion libmscore/undo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ void Score::undoAddCR(ChordRest* cr, Measure* measure, int tick)
Segment::SegmentType segmentType = Segment::SegChordRest;

Tuplet* t = cr->tuplet();
foreach(Staff* staff, staffList) {
foreach (Staff* staff, staffList) {
Score* score = staff->score();
Measure* m = (score == this) ? measure : score->tick2measure(tick);
Segment* seg = m->undoGetSegment(segmentType, tick);
Expand Down Expand Up @@ -2155,6 +2155,7 @@ void ChangeInstrumentLong::flip()
ChangeChordRestLen::ChangeChordRestLen(ChordRest* c, const TDuration& _d)
: cr(c), d(_d)
{
Q_ASSERT(c);
}

void ChangeChordRestLen::flip()
Expand Down

0 comments on commit 0ba686c

Please sign in to comment.