apply to 2.3.2
authormirabilos <tg@debian.org>
Sun, 31 Jan 2021 18:38:57 +0000 (19:38 +0100)
committermirabilos <mirabilos@evolvis.org>
Sun, 31 Jan 2021 18:38:57 +0000 (19:38 +0100)
debian/patches/upstream/5507.patch

index da9cfa2..9f27831 100644 (file)
@@ -5,27 +5,33 @@ Description: fix #292648: make courtesy accidentals stay if notes are
 
 --- a/libmscore/cmd.cpp
 +++ b/libmscore/cmd.cpp
-@@ -1564,12 +1564,17 @@ void Score::upDown(bool up, UpDownMode mode)
+@@ -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.
--                  auto l = oNote->linkList();
--                  for (ScoreElement* e : l) {
--                        Note* ln = toNote(e);
--                        if (ln->accidental())
--                              undo(new RemoveElement(ln->accidental()));
+-                  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) {
-+                        auto l = oNote->linkList();
-+                        for (ScoreElement* e : l) {
-+                              Note* ln = toNote(e);
-+                              if (ln->accidental())
-+                                    undo(new RemoveElement(ln->accidental()));
-+                              }
++                        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);
                    }