Changeset 60 for trunk/UContact.pas
- Timestamp:
- Dec 9, 2021, 12:07:42 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UContact.pas
r59 r60 280 280 begin 281 281 Result := Copy(Text, Length(Text) - Length(What) + 1, MaxInt) = What; 282 if Result then begin283 Result := Result;284 end;285 282 end; 286 283 … … 288 285 var 289 286 I: Integer; 287 O: Integer; 290 288 begin 291 289 Result := ''; 292 290 I := 1; 291 O := 1; 292 SetLength(Result, Length(Text)); // Preallocate string 293 293 while I <= Length(Text) do begin 294 if Text[I] in [',', '\', ';'] then Result := Result + '\' + Text[I] 295 else Result := Result + Text[I]; 294 if Text[I] in [',', '\', ';'] then begin 295 Result[O] := '\'; 296 Inc(O); 297 Result[O] := Text[I]; 298 SetLength(Result, Length(Result) + 1); 299 Inc(O); 300 end else begin 301 Result[O] := Text[I]; 302 Inc(O); 303 end; 296 304 Inc(I); 297 305 end; 306 SetLength(Result, O - 1); 298 307 end; 299 308 … … 301 310 var 302 311 I: Integer; 312 O: Integer; 303 313 Escaped: Boolean; 304 314 begin 305 315 Result := ''; 306 316 I := 1; 317 O := 1; 307 318 Escaped := False; 319 SetLength(Result, Length(Text)); // Preallocate string 308 320 while I <= Length(Text) do begin 309 321 if Escaped then begin 310 Result := Result + Text[I]; 322 Result[O] := Text[I]; 323 Inc(O); 311 324 Escaped := False; 312 325 end else begin 313 326 if Text[I] = '\' then begin 314 327 Escaped := True; 315 end else Result := Result + Text[I]; 328 end else begin 329 Result[O] := Text[I]; 330 Inc(O); 331 end; 316 332 end; 317 333 Inc(I); 318 334 end; 335 SetLength(Result, O - 1); 319 336 end; 320 337 … … 901 918 NewProperty.Attributes.Delete(0); 902 919 end; 903 NewProperty.Value := DecodeEscaped(Value);920 NewProperty.Value := Value; 904 921 NewProperty.EvaluateAttributes; 905 922 end else begin
Note:
See TracChangeset
for help on using the changeset viewer.