add another patch from upstream
[alioth/musescore.git] / debian / patches / upstream / 5507.patch
1 Origin: backport, commit:431961b43657eb8463f358f53bdfdd802a8bde4d
2 Author: Howard-C <howardc@pku.edu.cn>
3 Description: fix #292648: make courtesy accidentals stay if notes are
4  changed using Ctrl+Up/Down
5
6 --- a/libmscore/cmd.cpp
7 +++ b/libmscore/cmd.cpp
8 @@ -1564,12 +1564,17 @@ void Score::upDown(bool up, UpDownMode mode)
9  
10              if ((oNote->pitch() != newPitch) || (oNote->tpc1() != newTpc1) || oNote->tpc2() != newTpc2) {
11                    // remove accidental if present to make sure
12 -                  // user added accidentals are removed here.
13 -                  auto l = oNote->linkList();
14 -                  for (ScoreElement* e : l) {
15 -                        Note* ln = toNote(e);
16 -                        if (ln->accidental())
17 -                              undo(new RemoveElement(ln->accidental()));
18 +                  // user added accidentals are removed here
19 +                  // unless it's an octave change
20 +                  // in this case courtesy accidentals are preserved
21 +                  // because they're now harder to be re-entered due to the revised note-input workflow
22 +                  if (mode != UpDownMode::OCTAVE) {
23 +                        auto l = oNote->linkList();
24 +                        for (ScoreElement* e : l) {
25 +                              Note* ln = toNote(e);
26 +                              if (ln->accidental())
27 +                                    undo(new RemoveElement(ln->accidental()));
28 +                              }
29                          }
30                    undoChangePitch(oNote, newPitch, newTpc1, newTpc2);
31                    }