Ignore:
Timestamp:
Jun 6, 2023, 5:05:18 PM (18 months ago)
Author:
chronos
Message:
  • Added: VCardProcessor class for processing contacts available from VCard package.
  • Added: Normalize menu action for normalization of contact property values.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/VCard/VCard.pas

    r151 r152  
    12981298var
    12991299  I: Integer;
     1300  ContactProperty: TContactProperty;
    13001301begin
    13011302  inherited Sort(TComparer<TContact>.Construct(CompareContactFullName));
    1302   for I := 0 to Count - 1 do
     1303  for I := 0 to Count - 1 do begin
    13031304    Items[I].Properties.Sort(TComparer<TContactProperty>.Construct(ComparePropertyName));
     1305
     1306    // Make sure VERSION is first property
     1307    ContactProperty := Items[I].Properties.GetByName('VERSION');
     1308    if Assigned(ContactProperty) then begin
     1309      Items[I].Properties.Move(Items[I].Properties.IndexOf(ContactProperty), 0);
     1310    end;
     1311  end;
    13041312end;
    13051313
     
    17911799  LinePrefix: string;
    17921800  CutLength: Integer;
     1801  Cut: Boolean;
    17931802begin
    17941803  with Output do begin
     
    18141823        LineIndex := 0;
    18151824        LinePrefix := '';
     1825        Cut := False;
    18161826        while True do begin
    18171827          if UTF8Length(OutText) > ParentVCard.MaxLineLength then begin
     1828            Cut := True;
    18181829            CutLength := ParentVCard.MaxLineLength;
    18191830            if Encoding = veQuotedPrintable then begin
     
    18371848          end else begin
    18381849            Add(LinePrefix + OutText);
     1850            if Cut then Add('');
    18391851            Break;
    18401852          end;
Note: See TracChangeset for help on using the changeset viewer.