Regression: Select all similar elements for ties is broken

• Nov 23, 2017 - 18:49
Reported version
3.0
Type
Functional
Severity
S3 - Major
Status
closed
Project

GIT commit de22ecd / Windows10

1) "Untitled" score
2) Enter a few tied notes
File: ties.mscz
3) Right-click on a tie -> Select -> All similar elements

Result: nothing happens, the ties are not highlighted/selected


Comments

Title Select all similar elements for ties is broken Regression: Select all similar elements for ties is broken

As I am not so sure in correctness of my solution so I'll post one question here.

So the problem is that scanElements function which applies any given function on every element really scans elements but some elements can be scanned more than once. The "select all similar" feature is implemented by selecting all relevant elements via scanElements. That would be OK but Score::selectAdd function that is used to add elements to the selection can somehow decide to deselect an element if it was already selected! The problem with ties is apparently only in being scanned even number of times.

So here is my question. That deselection feature has one obvious application for deselecting elements on being clicked one more time. However this is already successfully handled in ScoreView, and this really seems to be an appropriate place for that. Are there any other cases when we need to deselect selected element in such a way or this deselection code can be removed from Score::selectAdd? If it can be removed that would solve this issue.

Status (old) active patch (code needs review)
Status active  

So I checked those placed in the code that call Score::select with SelectType::ADD argument and neither of them seems to rely on elements deselection in selectAdd which is logical. So I propose not to deselect elements there since it is not what we really expect from this function. See https://github.com/musescore/MuseScore/pull/4063