Skip to content

Commit

Permalink
Merge pull request #18742 from mike-spa/fixCrashOnDeleteAllInstrument…
Browse files Browse the repository at this point in the history
…sAndUndo

Fix #18733: Crash on delete all instruments and undo
  • Loading branch information
RomanPudashkin committed Jul 21, 2023
2 parents 4ec2d5a + bc10408 commit dfdbbec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/engraving/layout/v0/chordlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2292,10 +2292,11 @@ void ChordLayout::layoutChords3(const MStyle& style, const std::vector<Chord*>&
int prevSubtype = 0;
int prevLine = std::numeric_limits<int>::min();

bool isTab = staff->isTabStaff(tick);
for (int i = nNotes - 1; i >= 0; --i) {
Note* note = notes[i];
Accidental* ac = note->accidental();
if (ac && ac->subtype() == prevSubtype && note->line() == prevLine) {
if (ac && (isTab || (ac->subtype() == prevSubtype && note->line() == prevLine))) { // TODO: probably this function shouldn't be called at all for tab staves
// we shouldn't have two of the same accidental on the same line.
// if we find one that is identical to the one before it, don't lay it out
ac->setbbox(RectF());
Expand Down
15 changes: 0 additions & 15 deletions src/engraving/layout/v0/measurelayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1694,21 +1694,6 @@ void MeasureLayout::removeSystemHeader(Measure* m)
seg->setEnabled(false);
}
m->setHeader(false);

// remove all "generated" key signatures
Segment* kSeg = m->findFirstR(SegmentType::KeySig, Fraction(0, 1));
if (!kSeg) {
return;
}
for (EngravingItem* e : kSeg->elist()) {
if (e && e->generated()) {
kSeg->elist().at(e->track()) = 0;
}
}
kSeg->checkEmpty();
if (kSeg->empty()) {
m->remove(kSeg);
}
}

void MeasureLayout::addSystemTrailer(Measure* m, Measure* nm, LayoutContext& ctx)
Expand Down

0 comments on commit dfdbbec

Please sign in to comment.