Changeset 46 for trunk/UContact.pas
- Timestamp:
- Dec 3, 2021, 11:47:11 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UContact.pas
r45 r46 691 691 NameText: string; 692 692 Value2: string; 693 Text: string; 694 LineIndex: Integer; 695 OutText: string; 696 LinePrefix: string; 697 const 698 MaxLineLength = 73; 693 699 begin 694 700 inherited; … … 705 711 if Encoding <> '' then begin 706 712 Value2 := GetEncodedValue; 707 NameText := NameText + '; ' + Encoding;713 NameText := NameText + ';ENCODING=' + Encoding; 708 714 end else Value2 := Value; 709 715 if Pos(LineEnding, Value2) > 0 then begin … … 715 721 Add(''); 716 722 end else begin 717 Add(NameText + ':' + Value2); 723 OutText := NameText + ':' + Value2; 724 LineIndex := 0; 725 LinePrefix := ''; 726 while True do begin 727 if Length(OutText) > MaxLineLength then begin 728 if (LineIndex > 0) and (LinePrefix = '') then LinePrefix := ' '; 729 Add(LinePrefix + Copy(OutText, 1, MaxLineLength)); 730 System.Delete(OutText, 1, MaxLineLength); 731 Inc(LineIndex); 732 Continue; 733 end else begin 734 Add(LinePrefix + OutText); 735 Break; 736 end; 737 end; 738 if LinePrefix <> '' then Add(''); 718 739 end; 719 740 end;
Note:
See TracChangeset
for help on using the changeset viewer.