musescore/MuseScore — pull request #1247 by MarcSabatella (2014-08-30 19:50:34+00:00)
Title: fix #31571: initial key when adding a transposing instrument to a score ...

...in C

This PR fixes the problem by forcing staves with an initial key signature of C to have an explicit key signature in their key signature maps. Currently, this does not happen - the key signature segment is present in the score, but the staff key signature map is empty (or at least, contains only subsequent key changes). This seems like a good fix, as there may well be other bad effects from not having the initial key signature in the map.

However, if it turns out that somewhere else in the code we *rely* on the fact that staves in C have nothing in their key signature map at that tick, we could instead fix MuseScore::editInstrList() in instrdialog.cpp to detect this condition in the staff from which it is copying the key signatures, and add the missing key signature to the new staff.