File: fix-frame-breaks-2.diff

package info (click to toggle)
musescore3 3.2.3%2Bdfsg2-19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 218,192 kB
  • sloc: cpp: 291,369; xml: 200,226; sh: 3,779; ansic: 1,447; python: 393; makefile: 249; perl: 82; pascal: 79
file content (47 lines) | stat: -rw-r--r-- 2,526 bytes parent folder | download | duplicates (2)
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
38
39
40
41
42
43
44
45
46
47
Origin: upstream, commit:5edf0d5260a718a3dec56be7ab80046e48b55eb9
Author: Marc Sabatella <marc@outsideshore.com>
Description: fix #317747: measure number appears after section break
 Resolves: https://musescore.org/en/node/317747#comment-1063687
 .
 In implementing a bunch of related fixes for the behavior of
 section breaks followed by frames or breaks *on* frames*
 in https://github.com/musescore/MuseScore/pull/7026/,
 I introduced a new function designed to find relevant section breaks.
 However, I missed one opportunity to use this function
 (even though I left a TODO for this),
 and in one place where I did call the function,
 I neglected to actually use its return value.
 As a result, in one situation where it previously worked
 to place the section break on a frame
 but failed when placing the frame after the section break,
 my change merely reversed these two cases.
 .
 This commit fixes those two oversights.
 In these two places where the code previously assumed
 we had a MeasureBase that made sense to check for section breaks,
 we now call findPotentialSectionBreak() to look backwards.
 This ensures we don't miss breaks on or before frames
 in these two places in the code.

--- a/libmscore/layout.cpp
+++ b/libmscore/layout.cpp
@@ -3451,8 +3451,8 @@ System* Score::collectSystem(LayoutConte
                               if (!s->enabled())
                                     s->setEnabled(true);
                               }
-                        // TODO: use findPotentialSectionBreak here to handle breaks on frames correctly?
-                        bool firstSystem = lc.prevMeasure->sectionBreak() && _layoutMode != LayoutMode::FLOAT;
+                        const MeasureBase* pbmb = lc.prevMeasure->findPotentialSectionBreak();
+                        bool firstSystem = pbmb->sectionBreak() && _layoutMode != LayoutMode::FLOAT;
                         if (curHeader)
                               m->addSystemHeader(firstSystem);
                         else
@@ -4462,7 +4462,7 @@ void Score::doLayoutRange(const Fraction
             else {
                   const MeasureBase* mb = lc.nextMeasure->prev();
                   if (mb)
-                        mb->findPotentialSectionBreak();
+                        mb = mb->findPotentialSectionBreak();
                   LayoutBreak* sectionBreak = mb->sectionBreakElement();
                   // TODO: also use mb in else clause here?
                   // probably not, only actual measures have meaningful numbers