Clef changes do not appear in parts generated from voices >1

• Jul 23, 2020 - 17:45
Reported version
3.4
Priority
P1 - High
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project

MuseScore 3.5 fixes a number of bugs involving parts generated from voices, but one case seems to be missed even though a fix was applied to what should have been the right area of code. I am referring to #285855: Creating part from voice 2 does not respect key changes. The fix for that issue worked for key signatures and time signatures but caused a regression ([#307883]) that is fixed by a pending PR, https://github.com/musescore/MuseScore/pull/6345. However, this same piece of code is supposed to (according to the comments, and some common sense) apply to clefs, but in fact there is no check for clefs here, so clefs are not in fact handled.

The good news is, this means the recent regression doesn't happen for clefs, only key signatures (and time signatures if there are any "generated" ones, which normally there are not, maybe courtesy time signatures, although I can't make anything actually go wrong).

The bad news is, it means the original bug with generating parts from voices happens for clefs to, because this whole section of code just wasn't being applied at all.

Fix, I think, it to add "|| oef->isClef()" to the test along with isTimeSig() and isKeySig(). A quick check suggests it works.

Since it's not a regression, I don't know that it's worth fixing for 3.5, although since we're hopefully merging the PR that changes this exact line of code, I certainly wouldn't object either). Since it is the same line of code, though, I don't know that it makes sense to submit a PR for this until that one is merged, if we don't amend that PR to fix this too.