musescore/MuseScore — pull request #949 by mgavioli (2014-06-04 08:09:56+00:00)
Title: Fix #25811 #25867 - Incomplete layout when adding linked staff

Fix #25811 #25867 - Incomplete layout when adding linked staff.

If a linked staff of a different type/group is added to the score, the new staff is not completely laid out.

Fixes:

- Default clef of new staff is copied from default clef of original staff, rather than from its actual clef.
- When score instruments are updated, notes are updated before laying out chords, as chords need to have notes in correct position to compute correct stems, ledger lines, etc.
- Notes are updated via `Score::cmdUpdateNotes()` rather `Score::updateNotes()`, as the latter does not deals with the specifics of staff groups.
- `cloneStaff()` only clones clefs which are compatible with the staff group AND do not already exist.
- `cloneStaff()` also updates the staff clef map when cloning a clef.

Note: `Chord::updateNotes()` is much simpler than `Chord:cmdUpdateNotes()` and does not deal with a number of specific cases (https://github.com/musescore/MuseScore/blob/master/libmscore/chord.cpp#L1588 and following). Is this on purpose?