musescore/MuseScore — pull request #1248 by MarcSabatella (2014-08-30 20:01:29+00:00)
Title: fix #31576: get right clef & key when inserting measures

This PR is tested to work when inserting a measure in front of a clef change or key change, as well as at the beginning of a score. At various times we've had some but not all of these cases working. I have added comments to explain what the code is doing.