-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 #181811 validate instrument text name after editing #3078
Conversation
libmscore/iname.cpp
Outdated
@@ -73,6 +73,11 @@ void InstrumentName::endEdit() | |||
|
|||
QString s = plainText(); | |||
|
|||
if (!validateText(s)) { | |||
qWarning("The instrument name is invalid."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe qWarning("Invalid instrument name: <%s>", s.toUtf8().data());
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure...let me repush.
I've sucessfully saved as mscz after inserting the '&' and I've verified that I can open the file again and I see the & displayed as instrument text. |
133aa5b
to
9343b8e
Compare
should go to master and 2.1 |
@Jojo-Schmitz I just saw your message on IRC: does it fix flat ? But I didn't test that yet...I have already switched my code base back to master...I will have to swap back in an hour or so to test what you suggested... |
It should fix that too, along with bold, italic etc. |
Yeah, I would expect validateText would do all sorts of such fixups. |
Clicking on an instrument name causes a crash for me in master. So I don't manage to test this PR. I guess it can't harm... |
@lasconic yes. as you might recall there were a few different crashes I discovered with clicking on instrument names, which is a seperate issue I have no idea how to fix. But this PR is still needed and will do no harm. |
I've tested this and verified that the validateText(s) I inserted here properly changes an '&' into an 'amp;'