From 451f75e3ce0bdf48365aa0405496dd68af44ec3a Mon Sep 17 00:00:00 2001 From: wp_xyz Date: Wed, 13 Apr 2022 14:45:03 +0200 Subject: [PATCH] LCL/ListView: Disable editing of virtual list items when multiple items are selected to avoid transferring the edited caption to the wrong node. --- lcl/include/customlistview.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lcl/include/customlistview.inc b/lcl/include/customlistview.inc index e1ae285f69..d09bdca49d 100644 --- a/lcl/include/customlistview.inc +++ b/lcl/include/customlistview.inc @@ -333,7 +333,7 @@ begin DoItemChecked(Item); // end editing - if FEditor.Visible then + if IsEditing then HideEditor; // focus @@ -1222,8 +1222,8 @@ end; function TCustomListView.CanEdit(Item: TListItem): Boolean; begin - Result := True; - if Assigned(FOnEditing) then + Result := not (OwnerData and MultiSelect and (SelCount > 1)); + if Result and Assigned(FOnEditing) then FOnEditing(Self, Item, Result); end;