Skip to content

Commit

Permalink
Merge pull request #4340 from MarcSabatella/279062-empty-instrument
Browse files Browse the repository at this point in the history
fix #279062: re-implement instrument option for hide when empty
  • Loading branch information
anatoly-os committed Dec 10, 2018
2 parents 4661bf4 + 30dbe42 commit fb3a49c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libmscore/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1255,10 +1255,14 @@ void Score::hideEmptyStaves(System* system, bool isFirstSystem)
for (int i = 0; i < part->nstaves(); ++i) {
int st = idx + i;

foreach (MeasureBase* mb, system->measures()) {
for (MeasureBase* mb : system->measures()) {
if (!mb->isMeasure())
continue;
Measure* m = toMeasure(mb);
if (staff->hideWhenEmpty() == Staff::HideMode::INSTRUMENT && !m->isMeasureRest(st)) {
hideStaff = false;
break;
}
for (Segment* s = m->first(SegmentType::ChordRest); s; s = s->next(SegmentType::ChordRest)) {
for (int voice = 0; voice < VOICES; ++voice) {
ChordRest* cr = s->cr(st * VOICES + voice);
Expand Down

0 comments on commit fb3a49c

Please sign in to comment.