musescore/MuseScore — pull request #339 by mgavioli (2013-05-08 09:39:06+00:00)
Title: Fix #20703 - Key sig changes lack naturals (3rd solution)

Fix #20703 - Key sig changes lack naturals (3rd solution)

When a key sig changes, no natural is ever displayed, regardless of the "Hide naturals" property of the key sig.

Corrected by:
- adding methods to KeySig to locate the prev and next key sigs and update naturals accordingly when a key sig is added or removed
- in Score::addElement(), Score::removeElement() and undo's ChangeElement::flip(), by calling the relevant KeySig method

Notes:
1) Covers updating naturals in following key sigs, if a previous key changes.
2) Fully integrated in undo
3) The fix is already predisposed to cope with a score style setting for natural display style: none, before, after accidentals. Until this style is implemented, the relevant code is commented out.