LCL/ListView: Disable editing of virtual list items when multiple items are selected to avoid transferring the edited caption to the wrong node.

This commit is contained in:
wp_xyz 2022-04-13 14:45:03 +02:00
parent c0aa681113
commit 451f75e3ce

View File

@ -333,7 +333,7 @@ begin
DoItemChecked(Item); DoItemChecked(Item);
// end editing // end editing
if FEditor.Visible then if IsEditing then
HideEditor; HideEditor;
// focus // focus
@ -1222,8 +1222,8 @@ end;
function TCustomListView.CanEdit(Item: TListItem): Boolean; function TCustomListView.CanEdit(Item: TListItem): Boolean;
begin begin
Result := True; Result := not (OwnerData and MultiSelect and (SelCount > 1));
if Assigned(FOnEditing) then if Result and Assigned(FOnEditing) then
FOnEditing(Self, Item, Result); FOnEditing(Self, Item, Result);
end; end;