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);
// 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;