fix, todolist, sorting colums broken when not the first

This commit is contained in:
Basile Burg 2015-11-02 05:04:05 +01:00
parent 20cfc043eb
commit 2c2fd1347c
1 changed files with 3 additions and 1 deletions

View File

@ -551,6 +551,7 @@ var
begin begin
if lstItems.Selected = nil then if lstItems.Selected = nil then
exit; exit;
lstItems.BeginUpdate;
curr := lstItems.Selected; curr := lstItems.Selected;
// //
if lstItems.SortDirection = sdAscending then if lstItems.SortDirection = sdAscending then
@ -560,7 +561,7 @@ begin
lstItems.SortColumn := Column.Index; lstItems.SortColumn := Column.Index;
lstItems.Selected := nil; lstItems.Selected := nil;
lstItems.Selected := curr; lstItems.Selected := curr;
lstItems.Update; lstItems.EndUpdate;
end; end;
procedure TCETodoListWidget.lstItemsCompare(Sender: TObject; item1, item2: TListItem; Data: Integer; var Compare: Integer); procedure TCETodoListWidget.lstItemsCompare(Sender: TObject; item1, item2: TListItem; Data: Integer; var Compare: Integer);
@ -577,6 +578,7 @@ begin
end end
else else
begin begin
col -= 1;
if col < item1.SubItems.Count then if col < item1.SubItems.Count then
txt1 := item1.SubItems.Strings[col]; txt1 := item1.SubItems.Strings[col];
if col < item2.SubItems.Count then if col < item2.SubItems.Count then