-
Notifications
You must be signed in to change notification settings - Fork 273
Closed
Labels
BugPull Requests InvitedThere are no current plans to address the issue, but we would be happy if someone supplies a PR.There are no current plans to address the issue, but we would be happy if someone supplies a PR.
Description
There is an exception raised, when using VirtualStringTree as a tree only (no additional columns) and pressing return-key after editing a tree-item @ the following line (VirtualTrees.pas::32867):
Column := Tree.Header.Columns[Tree.FocusedColumn];
this is, because Tree.FocusedColumn is -1 at that moment!
You can fix this by changing lines 32867 to 32877:
Column := Tree.Header.Columns[Tree.FocusedColumn]; <-EXCEPTION
if Column.EditOptions <> toDefaultEdit then
EditOptions := Column.EditOptions
else
EditOptions := Tree.TreeOptions.EditOptions;
// next column candidate for toVerticalEdit and toHorizontalEdit
if Column.EditNextColumn <> -1 then
ColumnCandidate := Column.EditNextColumn
else
ColumnCandidate := -1;with the following block:
EditOptions := Tree.TreeOptions.EditOptions; // default
ColumnCandidate := -1;
if Tree.Header.Columns.Count > 0 then // are there any columns?
begin
Column := Tree.Header.Columns[Tree.FocusedColumn];
if Column.EditOptions <> toDefaultEdit then
EditOptions := Column.EditOptions;
// next column candidate for toVerticalEdit and toHorizontalEdit
if Column.EditNextColumn <> -1 then
ColumnCandidate := Column.EditNextColumn;
end;Metadata
Metadata
Assignees
Labels
BugPull Requests InvitedThere are no current plans to address the issue, but we would be happy if someone supplies a PR.There are no current plans to address the issue, but we would be happy if someone supplies a PR.