Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #297883: multiple chord symbols not copied #5531

Merged
merged 1 commit into from
Dec 24, 2019

Conversation

MarcSabatella
Copy link
Contributor

Resolves: https://musescore.org/en/node/297883

We have code to replaced existing chord symbols in the destination
when copying and pasting.
Unfortunately, if there are multiple chord symbols to paste on a tick,
that same code causes each chord symbol to replace the one just pasted.
End result is only the last chord symbol is preserved.
This change uses a container pastedHarmony to track the chords symbols
as we paste them, so we can check and not delete them later.

I have an mtest that is not yet committed, because although my code here fixes this issue, my testing exposed another issue with copy/paste of chord symbols, https://musescore.org/en/node/298541. I would like to see a fix for that in place, and then a test put in place for both cases.

To be clear:

The expected behavior is that pasting chord symbols replaces any chord symbols already present at those ticks, but preserves any other existing chord symbols in the destination. This current PR has to do with the replacing behavior - we have for years not handled this right when there are multiple chord symbols at a tick, But the other issue is a recent regression - the chord symbols that are not being replaced are being deleted instead of being preserved.

We have code to replaced existing chord symbols in the destination
when copying and pasting.
Unfortunately, if there are multiple chord symbols to paste on a tick,
that same code causes each chord symbol to replace the one just pasted.
End result is only the last chord symbol is preserved.
This change uses a container pastedHarmony to track the chords symbols
as we paste them, so we can check and not delete them later.
@Harmoniker1
Copy link
Contributor

One of the things I like about Python is the "if in" logic, unfortunately C++ doesn't have a very simple form of it.

@anatoly-os anatoly-os added this to the MuseScore 3.4 milestone Dec 16, 2019
@dmitrio95 dmitrio95 merged commit 26fc404 into musescore:master Dec 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants