View Issue Details

IDProjectCategoryView StatusLast Update
0037166LazarusLCLpublic2020-08-03 03:07
ReporterJoeny Ang Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.1 (SVN) 
Summary0037166: [Patch] GTK2: TGtk2MemoStrings last line delete bug
DescriptionCalling TGtk2MemoStrings.Delete() on the last line when the 2nd to the last line is empty, will delete both lines. This also happens when assigning a string to the last line via index (eg. fStrings[fStrings.Count - 1] := 'something').
TagsNo tags attached.
Fixed in Revisionr63277
LazTarget-
WidgetsetGTK 2
Attached Files

Activities

Joeny Ang

2020-06-02 08:51

reporter  

gtk2-memostrings-last-line-delete-bug.patch (505 bytes)   
--- lcl/interfaces/gtk2/gtk2memostrings.inc
+++ lcl/interfaces/gtk2/gtk2memostrings.inc
@@ -202,10 +202,8 @@
 EndIter: TGtkTextIter;
 begin
   gtk_text_buffer_get_iter_at_line(FGtkBuf, @StartIter, Index);
-  if Index = Count-1 then begin
-    gtk_text_iter_backward_char(@StartIter);
+  if Index = Count-1 then
     gtk_text_buffer_get_end_iter(FGtkBuf, @EndIter)
-  end
   else
     gtk_text_buffer_get_iter_at_line(FGtkBuf, @EndIter, Index+1);
   gtk_text_buffer_delete(FGtkBuf, @StartIter, @EndIter);

Joeny Ang

2020-06-02 08:52

reporter   ~0123180

Juha Manninen

2020-06-02 09:16

developer   ~0123185

Yes I can confirm the bug and the fix.
Applied, thanks.

Issue History

Date Modified Username Field Change
2020-06-02 08:51 Joeny Ang New Issue
2020-06-02 08:51 Joeny Ang File Added: gtk2-memostrings-last-line-delete-bug.patch
2020-06-02 08:52 Joeny Ang Note Added: 0123180
2020-06-02 08:52 Joeny Ang File Added: gtk2-memostrings-test-01.zip
2020-06-02 09:14 Juha Manninen Assigned To => Juha Manninen
2020-06-02 09:14 Juha Manninen Status new => assigned
2020-06-02 09:16 Juha Manninen Status assigned => resolved
2020-06-02 09:16 Juha Manninen Resolution open => fixed
2020-06-02 09:16 Juha Manninen Fixed in Revision => r63277
2020-06-02 09:16 Juha Manninen LazTarget => -
2020-06-02 09:16 Juha Manninen Widgetset GTK 2 => GTK 2
2020-06-02 09:16 Juha Manninen Note Added: 0123185
2020-08-03 03:07 Joeny Ang Status resolved => closed