Skip to content

Commit

Permalink
Merge pull request #473 from mgavioli/Staff_type_when_adding_a_new_in…
Browse files Browse the repository at this point in the history
…str_to_an_existing_score

Staff types when adding a new instrument to an existing score
  • Loading branch information
mgavioli committed Sep 14, 2013
2 parents 6d72a89 + 09a7b8e commit ea2401f
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions mscore/instrdialog.cpp
Expand Up @@ -222,12 +222,8 @@ void StaffListItem::staffTypeChanged(int idx)
//
// The list is sorted by staff group: Standard, Percussion, Tab.
//
// Indices of items in the list are:
// < 0 : -1 * index of staff type in score
// >= 0 : index of presets in preset list
//
// Currently, the staff type list is used by the New Instrument page of the New Score Wizard
// anf by the "Add | Instruments" dlg box.
// and by the "Add | Instruments" dlg box.
//---------------------------------------------------------

std::vector<StaffListItem::STAFF_LIST_STAFF_TYPE> StaffListItem::staffTypeList;
Expand All @@ -245,15 +241,15 @@ void StaffListItem::populateStaffTypes(Score *score)
for (int group=0; group < STAFF_GROUP_MAX; group++) {
// if there is a score and it has some staff types, list them
if (score && score->staffTypes().count() > 0) {
idx = -1;
idx = 0;
foreach(StaffType** staffType, score->staffTypes() ) {
if ( (*staffType)->group() == group && !(*staffType)->builtin() ) {
staffTypeData.idx = idx;
staffTypeData.displayName = (*staffType)->name();
staffTypeData.staffType = *staffType;
staffTypeList.push_back(staffTypeData);
}
idx--;
idx++;
}
}
else {
Expand Down Expand Up @@ -494,7 +490,7 @@ void InstrumentsDialog::genPartList()
}
sli->setLinked(bLinked);
int staffTypeIdx = cs->staffTypeIdx(s->staffType());
sli->setStaffType(staffTypeIdx != -1 ? -staffTypeIdx - 1 : -1);
sli->setStaffType(staffTypeIdx);
}
partiturList->setItemExpanded(pli, true);
}
Expand Down

0 comments on commit ea2401f

Please sign in to comment.