Package: musescore2 / 2.3.2+dfsg4-16

upstream/5507.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Origin: backport, commit:431961b43657eb8463f358f53bdfdd802a8bde4d
Author: Howard-C <howardc@pku.edu.cn>
Description: fix #292648: make courtesy accidentals stay if notes are
 changed using Ctrl+Up/Down

--- a/libmscore/cmd.cpp
+++ b/libmscore/cmd.cpp
@@ -1354,16 +1354,21 @@ void Score::upDown(bool up, UpDownMode m
 
             if ((oNote->pitch() != newPitch) || (oNote->tpc1() != newTpc1) || oNote->tpc2() != newTpc2) {
                   // remove accidental if present to make sure
-                  // user added accidentals are removed here.
-                  if (oNote->links()) {
-                        for (ScoreElement* e : *oNote->links()) {
-                              Note* ln = static_cast<Note*>(e);
-                              if (ln->accidental())
-                                    undoRemoveElement(ln->accidental());
+                  // user added accidentals are removed here
+                  // unless it's an octave change
+                  // in this case courtesy accidentals are preserved
+                  // because they're now harder to be re-entered due to the revised note-input workflow
+                  if (mode != UpDownMode::OCTAVE) {
+                        if (oNote->links()) {
+                              for (ScoreElement* e : *oNote->links()) {
+                                    Note* ln = static_cast<Note*>(e);
+                                    if (ln->accidental())
+                                          undoRemoveElement(ln->accidental());
+                                    }
                               }
+                        else if (oNote->accidental())
+                              undoRemoveElement(oNote->accidental());
                         }
-                  else if (oNote->accidental())
-                        undoRemoveElement(oNote->accidental());
                   undoChangePitch(oNote, newPitch, newTpc1, newTpc2);
                   }