Changeset 68 for trunk/Forms/UFormFindDuplicity.pas
- Timestamp:
- Dec 10, 2021, 11:15:41 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormFindDuplicity.pas
r29 r68 49 49 public 50 50 FoundItems: TFoundItems; 51 ContactField : TContactFieldIndex;51 ContactFieldIndex: TContactFieldIndex; 52 52 procedure Find; 53 53 procedure ReloadList; … … 107 107 108 108 procedure TFormFindDuplicity.SetContacts(AValue: TContacts); 109 var 110 ContactField: TContactField; 109 111 begin 110 112 if FContacts = AValue then Exit; … … 112 114 if Assigned(FContacts) then begin 113 115 Contacts.ContactsFile.Fields.LoadToStrings(ComboBoxField.Items); 114 ComboBoxField.ItemIndex := Integer(ContactField); 116 ContactField := Contacts.ContactsFile.Fields.GetByIndex(ContactFieldIndex); 117 ComboBoxField.ItemIndex := ComboBoxField.Items.IndexOfObject(ContactField); 115 118 if (ComboBoxField.Items.Count > 0) and (ComboBoxField.ItemIndex = -1) then 116 119 ComboBoxField.ItemIndex := 0; … … 133 136 FoundItems.Clear; 134 137 for I := 0 to Contacts.Count - 1 do begin 135 FieldName := TContact(Contacts[I]).Fields[ContactField];138 FieldName := Contacts[I].Fields[ContactFieldIndex]; 136 139 if FieldName <> '' then begin 137 140 Item := FoundItems.SearchByField(FieldName); … … 153 156 Core.Translator.TranslateComponentRecursive(Self); 154 157 Core.ThemeManager1.UseTheme(Self); 155 ContactField := cfTelCell;158 ContactFieldIndex := cfTelCell; 156 159 end; 157 160 158 161 procedure TFormFindDuplicity.ComboBoxFieldChange(Sender: TObject); 159 162 begin 160 ContactField := TContactFieldIndex(ComboBoxField.ItemIndex); 163 if ComboBoxField.ItemIndex <> -1 then 164 ContactFieldIndex := TContactField(ComboBoxField.Items.Objects[ComboBoxField.ItemIndex]).Index 165 else ContactFieldIndex := cfTelCell; 161 166 Find; 162 167 end;
Note:
See TracChangeset
for help on using the changeset viewer.