Changeset 128 for trunk/Forms/UFormContacts.pas
- Timestamp:
- Apr 8, 2022, 9:43:55 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContacts.pas
r127 r128 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 Menus, ActnList, UContact, UListViewSort, fgl, LazUTF8, Clipbrd; 7 Menus, ActnList, UContact, UListViewSort, LazUTF8, Clipbrd, 8 Generics.Collections; 8 9 9 10 type … … 76 77 FContacts: TContacts; 77 78 FUpdateCount: Integer; 78 procedure FilterList(List: T FPGObjectList<TObject>);79 procedure FilterList(List: TObjectList<TObject>); 79 80 procedure SetContacts(AValue: TContacts); 80 81 function GetPreviousContact(Contact: TContact): TContact; … … 188 189 end; 189 190 190 procedure TFormContacts.FilterList(List: T FPGObjectList<TObject>);191 procedure TFormContacts.FilterList(List: TObjectList<TObject>); 191 192 var 192 193 I: Integer; … … 194 195 K: Integer; 195 196 FoundCount: Integer; 197 Item: TContact; 196 198 begin 197 199 for I := List.Count - 1 downto 0 do begin 198 200 if List.Items[I] is TContact then begin 199 with TContact(List.Items[I]) do begin 201 Item := TContact(List.Items[I]); 202 with Item do begin 200 203 FoundCount := 0; 201 204 for J := 0 to FilterItems.Count - 1 do 202 205 if FilterItems[J].FieldIndex = cfNone then begin 203 for K := 0 to TContact(List.Items[I]).GetFields.Count - 1 do begin206 for K := 0 to Item.GetFields.Count - 1 do begin 204 207 if Pos(UTF8LowerCase(FilterItems[J].Value), 205 UTF8LowerCase( TContact(List.Items[I]).Fields[TContact.GetFields[K].Index])) > 0 then begin208 UTF8LowerCase(Item.Fields[TContact.GetFields[K].Index])) > 0 then begin 206 209 Inc(FoundCount); 207 210 Break; … … 210 213 end else begin 211 214 if Pos(UTF8LowerCase(FilterItems[J].Value), 212 UTF8LowerCase( TContact(List.Items[I]).Fields[FilterItems[J].FieldIndex])) > 0 then215 UTF8LowerCase(Item.Fields[FilterItems[J].FieldIndex])) > 0 then 213 216 Inc(FoundCount); 214 217 end;
Note:
See TracChangeset
for help on using the changeset viewer.