Crash when inserting staff or system text after a staff or system text over more lines
Steps:
- Create a new score and insert two notes.
- Select the first note, Ctrl + T (or Ctrl + Shift + T) and insert "
a (return) a
", where (return) means return key (to make the text span over two lines). - Click outside to exit text edit mode.
- Select the second note, Ctrl + T (or Ctrl + Shift + T) and insert any character. -> crash
Windows 8, Nightly build 9491c2a (the number of Windows Nightly build looks strange, the commit is 14769730 )
Note: no crash if the same steps are performed for lyrics (Ctrl + L).
Comments
The crash happens at instruction
deleteSelectedText();
at line 557 of libmscore\simpletext.cpp.It seems that the
_cursor.selectLine
and_cursor.selectColumn
are not reset to 0 in a new text command and they keep the values from the previous text command. In particular since selectLine and/or selectColumn are different from line or column (which are correctly set to 0), the text is treated as if it had a selection. When this (not existent) selection is being deleted, it causes the crash.Indeed, if the cursor is placed at the beginning of the first text (i.e. selectLine, selectColumn, line and column are set to 0) before step 3 above, step 4 does not crash.
Fixed in e13d3b12ef
Automatically closed -- issue fixed for 2 weeks with no activity.