Skip to content

Commit 91d796b

Browse files
committed
Fixes issue #1324: OnEditCancelled event is not called
1 parent da649be commit 91d796b

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

Source/VirtualTrees.BaseTree.pas

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9505,17 +9505,20 @@ function TBaseVirtualTree.DoEndEdit(pCancel: Boolean = False): Boolean;
95059505
DoStateChange([], [tsEditPending]);
95069506
if not (tsEditing in FStates) then
95079507
Exit(True);
9508+
DoStateChange([], [tsEditing]);
95089509
if pCancel then
9509-
Result := FEditLink.CancelEdit
9510+
begin
9511+
Result := FEditLink.CancelEdit();
9512+
if Result and Assigned(FOnEditCancelled) then
9513+
FOnEditCancelled(Self, FEditColumn);
9514+
end
95109515
else
9511-
Result := FEditLink.EndEdit;
9512-
if Result then
95139516
begin
9514-
DoStateChange([], [tsEditing]);
9515-
FEditLink := nil;
9516-
if Assigned(FOnEdited) then
9517+
Result := FEditLink.EndEdit;
9518+
if Result and Assigned(FOnEdited) then
95179519
FOnEdited(Self, FFocusedNode, FEditColumn);
95189520
end;
9521+
FEditLink := nil;
95199522
TrySetFocus();
95209523
end;
95219524

0 commit comments

Comments
 (0)