IDE, safer way to delete persistent fields in fieldseditor, the previous one caused some kind of feeback on windows and always leave one field in list if one wanted to delete all fields

git-svn-id: trunk@28043 -
This commit is contained in:
jesus 2010-11-02 20:56:20 +00:00
parent dacd49687f
commit 86dbfa4186

View File

@ -199,15 +199,9 @@ var i: integer;
begin
PreActive := LinkDataSet.Active;
LinkDataSet.Active := False;
if FieldsListBox.SelCount = 0 then exit;
for i := FieldsListBox.Items.Count - 1 downto 0 do
if FieldsListBox.Selected[i] then begin
fld := TField(FieldsListBox.Items.Objects[i]);
FieldsListBox.Items.Delete(i);
FDesigner.PropertyEditorHook.PersistentDeleting(fld);
fld.Free;
end;
FDesigner.Modified;
if FieldsListBox.SelCount = 0 then
exit;
FDesigner.DeleteSelection;
SelectionChanged;
if PreActive then
LinkDataSet.Active := True;