Fix clef change and courtesy clef display.

Clef changes and courtesy clef on/off display have several issues: changed clef is not always shown, courtesy clefs on/off is unreliable and so on.

In this fix:

- A clef change at measure boundary is always placed at the end of the previous measure (unless for the very first measure).
- This measure-final clef is never destroyed or re-created (the clef at the beginning of the next staff is managed by Score::layoutSystemRow() as before): this ensures a consistent context.
- Showing / hiding of a courtesy clef is managed by Clef::layout() rather than by Score::layoutSystemRow() as before.
- The clef change on measure boundary (always at the end of the previous measure and always present) is shown if:
-- there is not another clef at the beginning of the next measure (not a courtesy clef at all);
-- the score is set to show courtesy clefs
-- the previous measure is not the last of a repeat or of a section
-- the individual clef is set to show courtesy clef.
- In all other cases, the clef is hidden (i.e. laid out to a element without any symbol).
- The Clef Inspector is changed so that, if there is a pair of matching courtesy and main clef, their Show Courtesy flags are kept in sync (modifying either modifies both)
Default style, base style, saving and reading score file styles.

Background: the MScore objects has two reference styles:
- _baseStyle, which is inited to the built-in default style (common to all MuseScore copies)
- _defaultStyle which is inited to the user-defined default style
They are equal in a default installation but become different as soon as the user chooses a custom default style in the Preferences.

Issues:
- score style are saved as delta from the user-default style for texts and for articulations and as delta from the built-in default for the rest
- when the score is read back from file, it is inited to the user-default style and styles are read as a delta from it.

This makes:
- different parts of the saved style inconsistent among themselves
- styles saved in the score non-portable across different MuseScore copies (with potentially different user-default styles)

Fix:
- all style parts are saved as delta from the built-in default (to be portable)
- score is inited to built-in default style before being read from file.

Note: it is expected that users with custom default styles notice style differences when reading scores saved with previous 2.0 commits, as they were saved as delta from their respective user default styles.
Add test.
Merge pull request #601 from mgavioli/Fix_clef_change_and_courtesy_clef

Fix clef change and courtesy clef display.
Fix #6107 : bar lines and brackets disappearing when some of the staff they span is hidden

Fixed by analyzing brackets and bar line spans rather than only relying on start and stop staff Y offset (which is not set if the staff is not shown).

Note: there are still issues with measure numbers, but these belong more to system items than to bar lining.
Add test
Merge pull request #604 from mgavioli/Fix_6107_Barlines_with_hidden_staves

Fix #6107 : bar lines and brackets with hidden staves
Merge pull request #602 from mgavioli/basestyle_and_defaultstyle

Default style, base style, saving and reading score file styles.
When re-writing measures, do not set bar lines as generated.

When measures are re-written, for instance after adding or changing a time signature, the bar liens of the re-written measures are unconditionally marked as generated.

Fix: the bar line status of the bar line of the first measure being re-written is replicated in the newly re-written measures.
Fix tests.

The time sig change test now no longer turns bar lines into generated: aligned the ref score.
Added test.

This PR is implicitly tested by tst_timesig and in fact:
- this PR required adjusting the timesig test
- this test uses a copy of the same score 01 of tst_timesig and does on it exactly the same operations.

However, a specific test has been added to test for specific bar line parameters and to issue more specific messages.
Merge pull request #597 from mgavioli/rewritten_measure_no_generated_barlines

When re-writing measures, do not set bar lines as generated.
Make start-repeat bar lines to follow all staff span data.

Start-repeat bar lines only follow the staff span value, but not the spanFrom and spanTo values.
If the span data of a staff indicate a multiple span and a bar line is custom-shortened to span less staves, the 'uncovered' staves lack their bar line(s)
fix #24041: Pitches incorrect after inserting measures before key signature/clef change
comment non passing test
Added test.
Merge pull request #598 from mgavioli/startrepeat_barline_to_follow_staff_span_data

Make start-repeat bar lines to follow all staff span data.
Segment elements in voices other 1 no longer shown.

A typo in a recent commit prevented elements in voices other than 1 to be displayed.

Fixed.
fix oversized noteheads in bagpipe palette