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 begin
PreActive := LinkDataSet.Active; PreActive := LinkDataSet.Active;
LinkDataSet.Active := False; LinkDataSet.Active := False;
if FieldsListBox.SelCount = 0 then exit; if FieldsListBox.SelCount = 0 then
for i := FieldsListBox.Items.Count - 1 downto 0 do exit;
if FieldsListBox.Selected[i] then begin FDesigner.DeleteSelection;
fld := TField(FieldsListBox.Items.Objects[i]);
FieldsListBox.Items.Delete(i);
FDesigner.PropertyEditorHook.PersistentDeleting(fld);
fld.Free;
end;
FDesigner.Modified;
SelectionChanged; SelectionChanged;
if PreActive then if PreActive then
LinkDataSet.Active := True; LinkDataSet.Active := True;