From 2c2fd1347c61d60a4bcee3a87c95e26e4298536f Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Mon, 2 Nov 2015 05:04:05 +0100 Subject: [PATCH] fix, todolist, sorting colums broken when not the first --- src/ce_todolist.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ce_todolist.pas b/src/ce_todolist.pas index 4d39eec1..54c209d6 100644 --- a/src/ce_todolist.pas +++ b/src/ce_todolist.pas @@ -551,6 +551,7 @@ var begin if lstItems.Selected = nil then exit; + lstItems.BeginUpdate; curr := lstItems.Selected; // if lstItems.SortDirection = sdAscending then @@ -560,7 +561,7 @@ begin lstItems.SortColumn := Column.Index; lstItems.Selected := nil; lstItems.Selected := curr; - lstItems.Update; + lstItems.EndUpdate; end; procedure TCETodoListWidget.lstItemsCompare(Sender: TObject; item1, item2: TListItem; Data: Integer; var Compare: Integer); @@ -577,6 +578,7 @@ begin end else begin + col -= 1; if col < item1.SubItems.Count then txt1 := item1.SubItems.Strings[col]; if col < item2.SubItems.Count then