Closed AntonBogun closed 5 months ago
Produce the crash like this: Write some text in two cells (unsure if necessary but regardless), Select them Move over to a different cell and enter text edit Paste (you should be selecting cells at this stage except treesheets didn't realize you're not in text edit anymore) Finally, press ctrl+right (or any arrow I think)
Hi @AntonBogun
Thanks for your reply. I could reproduce the issue. Thank you very much for pointing out to this issue and for your attention to detail!
While I definitively see your valid idea in your PR, I have two major concerns with this PR:
textedit
boolean at the proposed place. Rather than letting the wrong state of Selection::textedit
get into the function void Selection::Dir(Document*, bool, bool, wxDC&, int, int, int, int, int, bool, bool, bool)
and correct with the help of an extra condition check (GetCell()
), it should be fixed at the origin of the bug. According to my investigation the bug roots in the miss of the textedit
not being switched off when a grid gets merged into its parent grid (void Grid::MergeWithParent(Grid*, Selection&)
), so I created another proposal in a PR.GetCell()
at every call of void Selection::Dir(Document*, bool, bool, wxDC&, int, int, int, int, int, bool, bool, bool)
. As said in 1, we should come "clean" to the function.Another minor concern is that there is a proper method in the Selection
class to leave textedit
mode with the function void Selection::ExitEdit(Document*)
that also resets the cursor.
I hope that you can agree with my points here. @aardappel Which way do you prefer? My alternative approach lies in PR https://github.com/aardappel/treesheets/pull/604
Best regards, Tobias
Hi @AntonBogun Could you describe with an example how you produce the crash? Thanks in advance! I tried to reproduce with the help of the title of the Pull Request, but I could not produce a crash or move cells at all while
Selection
is intextedit
mode. Best regards, Tobias