diff --git a/gui/FillterForm.pas b/gui/FillterForm.pas index e221bb4..a3a1d7b 100644 --- a/gui/FillterForm.pas +++ b/gui/FillterForm.pas @@ -477,7 +477,6 @@ hc : TColor; err : Cardinal; passTarget : TRequestFilter; - nameExists : Boolean; newName : WideString; begin f := Nil; @@ -534,21 +533,14 @@ FilterValueComboBox.Text + '-' + FilterActionComboBox.Text; - nameExists := False; - For f In FFilterList Do - begin - nameExists := f.Name = newName; - If nameExists Then - Break; - end; - - f := Nil; - If nameExists Then + f := TRequestFilter.GetByName(newName, FFilterList); + If Assigned(f) Then begin ErrorMessage('The filter is already present in the list'); Exit; end; + f := Nil; f := TRequestFilter.NewInstance(rt); If Not Assigned(f) Then Exit;