Skip to content

Commit

Permalink
fix #277952 selecting master palette leads to crash
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Nov 9, 2018
1 parent 1edd676 commit adf7727
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion libmscore/mcursor.cpp
Expand Up @@ -160,7 +160,7 @@ void MCursor::addPart(const QString& instrument)
qFatal("Did not find instrument <%s>", qPrintable(instrument));
}
part->initFromInstrTemplate(it);
// staff->init(it, 0, 0);
staff->init(it, 0, 0);
_score->appendPart(part);
_score->insertStaff(staff, 0);
}
Expand Down
10 changes: 5 additions & 5 deletions libmscore/staff.cpp
Expand Up @@ -998,6 +998,11 @@ StaffType* Staff::setStaffType(int tick, const StaffType& nst)
void Staff::init(const InstrumentTemplate* t, const StaffType* staffType, int cidx)
{
// set staff-type-independent parameters
const StaffType* pst = staffType ? staffType : t->staffTypePreset;
if (!pst)
pst = StaffType::getDefaultPreset(t->staffGroup);

setStaffType(0, *pst);
if (cidx >= MAX_STAVES) {
setSmall(0, false);
}
Expand All @@ -1007,11 +1012,6 @@ void Staff::init(const InstrumentTemplate* t, const StaffType* staffType, int ci
setBracketSpan(0, t->bracketSpan[cidx]);
setBarLineSpan(t->barlineSpan[cidx]);
}
const StaffType* pst = staffType ? staffType : t->staffTypePreset;
if (!pst)
pst = StaffType::getDefaultPreset(t->staffGroup);

setStaffType(0, *pst);
setDefaultClefType(t->clefType(cidx));
}

Expand Down

0 comments on commit adf7727

Please sign in to comment.