View Issue Details

IDProjectCategoryView StatusLast Update
0034791Lazarus CCRPatchpublic2020-01-13 15:45
ReporterMatthew ShafferAssigned ToDmitry Boyarintsev 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinux x86_64 GTK2OSLinuxOS Version
Summary0034791: RichMemo - Avoid Overwriting Selection (IntSaveStream) (GTK2)
DescriptionUnder 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 ReproduceIn 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.
TagsNo tags attached.
WidgetsetGTK 2
Attached Files

Activities

Matthew Shaffer

2019-01-01 22:49

reporter  

richmemo_selectionoverwrite.zip (66,111 bytes)

Dmitry Boyarintsev

2020-01-13 15:45

developer   ~0120403

r7280
thanks for the patch, applied

Issue History

Date Modified Username Field Change
2019-01-01 22:49 Matthew Shaffer New Issue
2019-01-01 22:49 Matthew Shaffer File Added: richmemo_selectionoverwrite.zip
2019-01-29 19:56 Dmitry Boyarintsev Status new => assigned
2019-01-29 19:56 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2020-01-13 15:45 Dmitry Boyarintsev Status assigned => resolved
2020-01-13 15:45 Dmitry Boyarintsev Resolution open => fixed
2020-01-13 15:45 Dmitry Boyarintsev Widgetset GTK 2 => GTK 2
2020-01-13 15:45 Dmitry Boyarintsev Note Added: 0120403