Percent sign cannot be entered into text
Reported version
3.3
Priority
P0 - Critical
Type
Functional
Frequency
Few
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project
1) default score
2) edit title to read "Title%"
Result: as soon as you leave edit mode, the percent sign disappears
I tried looking into this and am mystified - I don't see any "smoking gun" in the logs for textedit.cpp or textbase.cpp, and trying to debug the issue hasn't helped - near as I can tell, the percentage is added to the text and shows in the Object Debugger, as an escape sequence "%". Another clue: if while still editing the text (so the % still appears), you select it and paste, you get the escape sequence. So I'm assuming the problem is in that conversion. Which would make me wonder if somehow Qt is involved, but the error is reproducible on Linux and macOS as well, and Qt didn't change except on Windows.
Fix version
3.3.2
Comments
in https://musescore.org/en/node/296909 2 users claim to be affected, for staff text like "wheel to 50%" or "Phrasing by portato at 85%"
Indeed they show as html encoded %
In reply to in https://musescore.org/en… by Jojo-Schmitz
A good joke here is that now I use ‰, per mille, speaking to the articulations and cutbacks in their own language.
@Marc Sabatella found the smoking gun at 32854624
@Marc Sabatella, did you try this? Strictly speaking, the two lines added to
TextBase::createLayout()
solve this problem on their own. The other changes are just included for completeness.Just PR it ;-)
I tried almost exactly that (I think I also replaced #37 with percnt). It worked until I tried to save and load a score, then it gave me bad format. Maybe going back to #37 would have worked better. But anyhow, I got cold feet. Compared to 3.2.3 and earlier, 3.3 now writes the escaped form to the file, which seems weird, and we would also want to check the compatibility on read of old files that have literal percents, etc. Plus I have no confidence there aren't also problems with percent entered into dialogs etc, again possibly with save/restore. Lots of cases to test, this is just the first we know of that broke.
In reply to I tried almost exactly that … by Marc Sabatella
Oh, this is terrible. So it looks like we have to live with it for a while. If I thought that looking into it myself would help any, I would, but you and others are familiar with the relevant code and I am not.
It's not a hard problem, almost certainly just a few lines to fix. It just requires time to consider all the ramifications. I see no reason it can't be dealt with by tomorrow though
I don't know what you mean about bad format, but from what I have observed, these changes do not affect the way that scores are saved and loaded. You say you tried almost exactly what I did. Perhaps there is something about the difference between what I tried and what you tried that led to failure on your end.
Could be, indeed. I tried a few things, and the one that was closest to that also used percnt instead of #37. By "bad format", I mean, that's the error message in the dialog when I tried to load a file saved with this change.
I recognize that these changes don't affect what it is written, but my point is, maybe they should. Prior to 3.3, I assume we wrote the percent literal. Maybe it would be better to return to that? Or not, as long as it works.
See https://github.com/musescore/MuseScore/pull/5470
In reply to See https://github.com… by Jojo-Schmitz
stag, huh, Als wie der Hirsch....?
"Als wie" Brrr, ugly...
Fixed in branch master, commit 33ff46708d
_fix #296960: Percent sign cannot be entered into text.
Resolves: https://musescore.org/en/node/296960._
Fixed in branch master, commit 4a323e79ae
_Merge pull request #5470 from mattmcclinch/296960-percent-sign
fix #296960: Percent sign cannot be entered into text._
Fixed in branch 3.3.2, commit 492d7efab4
_Merge pull request #5470 from mattmcclinch/296960-percent-sign
fix #296960: Percent sign cannot be entered into text._
Automatically closed -- issue fixed for 2 weeks with no activity.