Skip to content

Commit

Permalink
fix handling of barline type default
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Jul 23, 2018
1 parent d5b6ca6 commit 4c423ab
Show file tree
Hide file tree
Showing 98 changed files with 135 additions and 8 deletions.
7 changes: 5 additions & 2 deletions libmscore/barline.cpp
Expand Up @@ -509,6 +509,7 @@ void BarLine::drawEditMode(QPainter* p, EditData& ed)
void BarLine::write(XmlWriter& xml) const
{
xml.stag("BarLine");

writeProperty(xml, Pid::BARLINE_TYPE);
writeProperty(xml, Pid::BARLINE_SPAN);
writeProperty(xml, Pid::BARLINE_SPAN_FROM);
Expand Down Expand Up @@ -1178,8 +1179,10 @@ QVariant BarLine::propertyDefault(Pid propertyId) const
{
switch (propertyId) {
case Pid::BARLINE_TYPE:
if (segment() && segment()->measure() && !segment()->measure()->nextMeasure())
return QVariant::fromValue(BarLineType::END);
// dynamic default values are a bad idea: writing to xml the value maybe ommited resulting in
// wrong values on read (as the default may be different on read)
// if (segment() && segment()->measure() && !segment()->measure()->nextMeasure())
// return QVariant::fromValue(BarLineType::END);
return QVariant::fromValue(BarLineType::NORMAL);

case Pid::BARLINE_SPAN:
Expand Down
3 changes: 3 additions & 0 deletions mtest/guitarpro/tuplets2.gpx-ref.mscx
Expand Up @@ -685,6 +685,7 @@ solo concert</text>
<durationType>quarter</durationType>
</Rest>
<BarLine>
<subtype>end</subtype>
<lid>82</lid>
</BarLine>
<move>0/1</move>
Expand Down Expand Up @@ -1423,6 +1424,7 @@ solo concert</text>
<durationType>quarter</durationType>
</Rest>
<BarLine>
<subtype>end</subtype>
<lid>82</lid>
</BarLine>
<move>0/1</move>
Expand Down Expand Up @@ -1993,6 +1995,7 @@ solo concert</text>
<durationType>quarter</durationType>
</Rest>
<BarLine>
<subtype>end</subtype>
<lid>82</lid>
</BarLine>
<move>0/1</move>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/accidentals-ref.mscx
Expand Up @@ -722,6 +722,7 @@
<durationType>half</durationType>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/articulations-ref.mscx
Expand Up @@ -514,6 +514,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/chord_symbol-ref.mscx
Expand Up @@ -185,6 +185,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/clef_missing_first-ref.mscx
Expand Up @@ -158,6 +158,7 @@
</Note>
</Chord>
<BarLine>
<subtype>end</subtype>
<span>1</span>
</BarLine>
</Measure>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/clefs-ref.mscx
Expand Up @@ -369,6 +369,7 @@
</Note>
</Chord>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/drumset-ref.mscx
Expand Up @@ -516,6 +516,7 @@
<durationType>half</durationType>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/hairpin-ref.mscx
Expand Up @@ -354,6 +354,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
<span>1</span>
</BarLine>
</Measure>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/hor_frame_and_mmrest-ref.mscx
Expand Up @@ -158,6 +158,7 @@
</Note>
</Chord>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/keysig-ref.mscx
Expand Up @@ -399,6 +399,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/markers-ref.mscx
Expand Up @@ -241,6 +241,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/noteheads-ref.mscx
Expand Up @@ -621,6 +621,7 @@
<durationType>half</durationType>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/notes-ref.mscx
Expand Up @@ -549,6 +549,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/slurs-ref.mscx
Expand Up @@ -637,6 +637,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
<span>1</span>
</BarLine>
</Measure>
Expand Down
2 changes: 2 additions & 0 deletions mtest/libmscore/compat114/style-ref.mscx
Expand Up @@ -164,6 +164,7 @@
<duration>128/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
<Measure number="2">
Expand Down Expand Up @@ -352,6 +353,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/text_scaling-ref.mscx
Expand Up @@ -155,6 +155,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/textstyles-ref.mscx
Expand Up @@ -1891,6 +1891,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/title-ref.mscx
Expand Up @@ -311,6 +311,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
<span>1</span>
</BarLine>
</Measure>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/tremolo2notes-ref.mscx
Expand Up @@ -156,6 +156,7 @@
</Note>
</Chord>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/tuplets_1-ref.mscx
Expand Up @@ -504,6 +504,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat114/tuplets_2-ref.mscx
Expand Up @@ -222,6 +222,7 @@
<durationType>half</durationType>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat206/accidentals-ref.mscx
Expand Up @@ -636,6 +636,7 @@
</Note>
</Chord>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat206/ambitus-ref.mscx
Expand Up @@ -158,6 +158,7 @@
<durationType>half</durationType>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat206/articulations-ref.mscx
Expand Up @@ -1856,6 +1856,7 @@
<durationType>quarter</durationType>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
8 changes: 8 additions & 0 deletions mtest/libmscore/compat206/barlines-ref.mscx
Expand Up @@ -495,6 +495,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down Expand Up @@ -553,6 +554,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down Expand Up @@ -611,6 +613,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down Expand Up @@ -668,6 +671,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down Expand Up @@ -724,6 +728,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down Expand Up @@ -779,6 +784,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down Expand Up @@ -832,6 +838,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down Expand Up @@ -884,6 +891,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat206/breath-ref.mscx
Expand Up @@ -121,6 +121,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat206/clefs-ref.mscx
Expand Up @@ -353,6 +353,7 @@
</Note>
</Chord>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
4 changes: 4 additions & 0 deletions mtest/libmscore/compat206/drumset-ref.mscx
Expand Up @@ -987,6 +987,7 @@
<durationType>half</durationType>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down Expand Up @@ -1143,6 +1144,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down Expand Up @@ -1365,6 +1367,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down Expand Up @@ -1491,6 +1494,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
3 changes: 3 additions & 0 deletions mtest/libmscore/compat206/hairpin-ref.mscx
Expand Up @@ -518,6 +518,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
<lid>30</lid>
</BarLine>
</Measure>
Expand Down Expand Up @@ -861,6 +862,7 @@
<duration>104/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
<Measure number="8">
Expand Down Expand Up @@ -1038,6 +1040,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
<lid>30</lid>
</BarLine>
</Measure>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat206/markers-ref.mscx
Expand Up @@ -242,6 +242,7 @@
<duration>4/4</duration>
</RepeatMeasure>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat206/noteheads-ref.mscx
Expand Up @@ -625,6 +625,7 @@
<durationType>half</durationType>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
</Measure>
</Staff>
Expand Down
1 change: 1 addition & 0 deletions mtest/libmscore/compat206/textstyles-ref.mscx
Expand Up @@ -485,6 +485,7 @@
<duration>4/4</duration>
</Rest>
<BarLine>
<subtype>end</subtype>
</BarLine>
<endSpanner id="5"/>
</Measure>
Expand Down

0 comments on commit 4c423ab

Please sign in to comment.