Changing a barline of a single-staff score to a start repeat barline via the Barline Inspector changes the next barline instead

• May 30, 2022 - 14:07
Reported version
3.6
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
active
Regression
Yes
Workaround
Yes
Project

Trying to change the barline at bar 17. I previously put the repeat at the begining of bar 18. After removing the barline from bar 18 I highlighted the barline at bar 17, in the edit area it shows as a normal barline I select begin repeat. The begin repeat then appears at the begining of bar 18.

Attachment Size
Contredanse De Dubrovnik No.mscz 20.66 KB

Comments

Title barline edit Changing a barline of a single-staff system to a start repeat barline via the Barline Inspector changes the next barline instead
Workaround No Yes

The score stems from MuseScore 3.3.4: update to 3.6.2 first! (see also #313298: MuseScore in Microsoft Store is outdated, still at 3.3.4; remove link on Download page)
Then use the correct method to apply barlines, esp. repeat barlines: via the Barlines palette (the method via Inspector works for non-repeat barlines, but won't for repeat barlines, at least not as far as playback is concerned), see https://musescore.org/en/handbook/3/repeats-and-jumps

Other than that: yes, on a single staff system, if you change a barline to a start repeat barline, MuseScore changes the next one instead. That much seems pretty clearly a bug, it should either change the selected barline or not allow this at all, as it does as soon as there is more than one staff, then all repeat barlines fields of the Style popup of the Barline Inspector are disabled.

Regression No Yes
Severity S3 - Major S4 - Minor
Type Performance Functional

It is a regression vs. (at least) 2.3.2 BTW (that changes the correct barline in this case).
I don't think it is a Major issue though.
Not sure wether Functional or Ergonomical (UX) is the right Type, Performance is not though.

Title Changing a barline of a single-staff system to a start repeat barline via the Barline Inspector changes the next barline instead Changing a barline of a single-staff score to a start repeat barline via the Barline Inspector changes the next barline instead

As per a comment in the code the fact that repeat barlines are disabled in the Inspector's combo box for multi-staff scores is by design.
Code from 3.x:

void InspectorBarLine::setElement()
      {
      InspectorElementBase::setElement();
      BarLine* bl = toBarLine(inspector->element());
 
      // enable / disable individual type combo items according to score and selected bar line status
      bool bMultiStaff  = bl->score()->nstaves() > 1;
      BarLineType blt   = bl->barLineType();
      bool isRepeat     = blt & (BarLineType::START_REPEAT | BarLineType::END_REPEAT | BarLineType::END_START_REPEAT);
//      bool isRepeat     = blt & (BarLineType::START_REPEAT | BarLineType::END_REPEAT);
 
      const QStandardItemModel* model = qobject_cast<const QStandardItemModel*>(b.type->model());
      int i = 0;
      for (auto& k : BarLine::barLineTable) {
            QStandardItem* item = model->item(i);
            // if combo item is repeat type, should be disabled for multi-staff scores
            if (k.type & (BarLineType::START_REPEAT | BarLineType::END_REPEAT | BarLineType::END_START_REPEAT)) {
//            if (k.type & (BarLineType::START_REPEAT | BarLineType::END_REPEAT)) {
                  // disable / enable
                  item->setFlags(bMultiStaff ?
                        item->flags() & ~(Qt::ItemIsSelectable|Qt::ItemIsEnabled) :
                        item->flags() | (Qt::ItemFlags)(Qt::ItemIsSelectable|Qt::ItemIsEnabled) );
                  }
            // if combo item is NOT repeat type, should be disabled if selected bar line is a repeat
            else {
                  item->setFlags(isRepeat ?
                        item->flags() & ~(Qt::ItemIsSelectable|Qt::ItemIsEnabled) :
                        item->flags() | (Qt::ItemFlags)(Qt::ItemIsSelectable|Qt::ItemIsEnabled) );
                  }
            ++i;
            }
#if 0
      blockSpanDataSignals(true);
      manageSpanData();
      blockSpanDataSignals(false);
#endif
      }

Not sure why that is, what this is good for?