Skip to content

Commit 116866d

Browse files
authored
Merge pull request #4257 from JoshuaBonn1/278230-changing-clef
Fix #278230: Looking at staff properties changes clef of instruments …
2 parents 9e77639 + 429868e commit 116866d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

libmscore/instrument.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,13 +912,20 @@ bool Instrument::operator==(const Instrument& i) const
912912
if (!(i._shortNames[k] == _shortNames[k].name()))
913913
return false;
914914
}
915+
n = _channel.size();
916+
if (i._channel.size() != n)
917+
return false;
918+
for (int k = 0; k < n; ++k) {
919+
if (!(*i._channel[k] == *_channel[k]))
920+
return false;
921+
}
922+
915923
return i._minPitchA == _minPitchA
916924
&& i._maxPitchA == _maxPitchA
917925
&& i._minPitchP == _minPitchP
918926
&& i._maxPitchP == _maxPitchP
919927
&& i._useDrumset == _useDrumset
920928
&& i._midiActions == _midiActions
921-
&& i._channel == _channel
922929
&& i._articulation == _articulation
923930
&& i._transpose.diatonic == _transpose.diatonic
924931
&& i._transpose.chromatic == _transpose.chromatic

mscore/editstaff.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ void EditStaff::apply()
335335
instrument.setLongName(ln);
336336

337337
bool inv = invisible->isChecked();
338-
ClefTypeList clefType = instrument.clefType(orgStaff->rstaff());
338+
ClefTypeList clefType = orgStaff->defaultClefType();
339339
qreal userDist = spinExtraDistance->value();
340340
bool ifEmpty = showIfEmpty->isChecked();
341341
bool hideSystemBL = hideSystemBarLine->isChecked();
@@ -353,6 +353,8 @@ void EditStaff::apply()
353353

354354
if (v1 != v2)
355355
score->transpositionChanged(part, v2, _tickStart, _tickEnd);
356+
357+
clefType = instrument.clefType(orgStaff->rstaff());
356358
}
357359
orgStaff->undoChangeProperty(Pid::MAG, mag->value() / 100.0);
358360
orgStaff->undoChangeProperty(Pid::COLOR, color->color());

0 commit comments

Comments
 (0)