Percent sign cannot be entered into text

• Nov 12, 2019 - 14:55
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.


Comments

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.

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.

Fix version
3.3.2