RichMemo - Avoid Overwriting Selection (IntSaveStream) (GTK2)
Original Reporter info from Mantis: daz
-
Reporter name: Matthew Shaffer
Original Reporter info from Mantis: daz
- Reporter name: Matthew Shaffer
Description:
Under GTK2, in the function IntSaveStream, RichMemo.SelStart and RichMemo.SelLength are overwitten, causing the last text saved to the stream by this function to be selected on the user's form.
Attached is a patch and an example project.
Short video showing before patch and after patch: https://youtu.be/806sAxEma70
(This is my first patch, so let me know if I've done something wrong. I also don't know if this is the best solution to the bug, but this should at least point you in the right direction to make a better solution if needed)
Steps to reproduce:
In the provided demo project, highlight something, e.g. "Line 2" press the button. Notice that just by reading the RichMemo Rtf property, the selection in the RichMemo has been changed (due to it using streams in the background to write to the Rtf property).
After applying the patch, highlight e.g. "Line 2" and press the button. Your selection should remain the same now.
Mantis conversion info:
- Mantis ID: 34791
- OS: Linux
- Platform: Linux x86_64 GTK2
- Monitored by: » pomalo (pomalo)