Changeset 151 for trunk/Packages/VCard/VCard.pas
- Timestamp:
- Jun 6, 2023, 11:15:57 AM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/VCard/VCard.pas
r148 r151 147 147 procedure AssignToList(List: TObjects); 148 148 function GetByName(Name: string): TContactProperty; 149 function GetMultipleByName(Name: string): TContactProperties; 149 150 function GetByNameGroups(Name: string; Groups: TStringArray; 150 151 NoGroups: TStringArray): TContactProperty; 151 152 function GetByNameGroupsMultiple(Name: string; Groups: TStringArray; 152 153 NoGroups: TStringArray): TContactProperties; 154 function RemoveExactDuplicates: Integer; 153 155 end; 154 156 … … 572 574 procedure TVCard.Assign(Source: TPersistent); 573 575 begin 574 inherited; 575 if Source is TVCard then Contacts.Assign((Source as TVCard).Contacts); 576 if Source is TVCard then 577 Contacts.Assign((Source as TVCard).Contacts) 578 else inherited; 576 579 end; 577 580 … … 1005 1008 end; 1006 1009 1010 function TContactProperties.GetMultipleByName(Name: string): TContactProperties; 1011 var 1012 I: Integer; 1013 begin 1014 Result := TContactProperties.Create(False); 1015 for I := 0 to Count - 1 do 1016 if (Items[I].Name = Name) or EndsWith(Items[I].Name, '.' + Name) then 1017 Result.Add(Items[I]); 1018 end; 1019 1007 1020 function TContactProperties.GetByNameGroups(Name: string; Groups: TStringArray; 1008 1021 NoGroups: TStringArray): TContactProperty; … … 1025 1038 if Items[I].MatchNameGroups(Name, Groups, NoGroups) then 1026 1039 Result.Add(Items[I]); 1040 end; 1041 1042 function TContactProperties.RemoveExactDuplicates: Integer; 1043 var 1044 I: Integer; 1045 J: Integer; 1046 begin 1047 Result := 0; 1048 for I := 0 to Count - 1 do 1049 for J := Count - 1 downto I + 1 do 1050 if Items[I].CompareTo(Items[J]) then begin 1051 Remove(Items[J]); 1052 Inc(Result); 1053 end; 1027 1054 end; 1028 1055
Note:
See TracChangeset
for help on using the changeset viewer.