Changeset 25 for trunk/UAcronym.pas
- Timestamp:
- May 8, 2016, 10:56:38 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UAcronym.pas
r24 r25 120 120 Id: Integer; 121 121 Name: string; 122 Block: TImportPattern; 122 123 Acronym: TImportPattern; 123 124 Meaning: TImportPattern; … … 233 234 begin 234 235 Name := Source.Name; 236 Block.StartString := Source.Block.StartString; 237 Block.EndString := Source.Block.EndString; 235 238 Acronym.StartString := Source.Acronym.StartString; 236 239 Acronym.EndString := Source.Acronym.EndString; … … 245 248 WriteInteger(Node, 'Id', Id); 246 249 WriteString(Node, 'Name', Name); 250 WriteString(Node, 'BlockStartString', Block.StartString); 251 WriteString(Node, 'BlockEndString', Block.EndString); 247 252 WriteString(Node, 'AcronymStartString', Acronym.StartString); 248 253 WriteString(Node, 'AcronymEndString', Acronym.EndString); … … 257 262 Id := ReadInteger(Node, 'Id', 0); 258 263 Name := ReadString(Node, 'Name', ''); 264 Block.StartString := ReadString(Node, 'BlockStartString', ''); 265 Block.EndString := ReadString(Node, 'BlockEndString', ''); 259 266 Acronym.StartString := ReadString(Node, 'AcronymStartString', ''); 260 267 Acronym.EndString := ReadString(Node, 'AcronymEndString', ''); … … 385 392 NewAcronym: TAcronymEntry; 386 393 P: Integer; 394 NewName: string; 387 395 begin 388 396 Stream := TMemoryStream.Create; … … 393 401 SetLength(S, Stream.Size); 394 402 Stream.Read(S[1], Length(S)); 403 if Format.Block.StartString <> '' then begin 404 P := Pos(Format.Block.StartString, S); 405 if P > 0 then 406 Delete(S, 1, P + Length(Format.Block.StartString) - 1); 407 end; 408 if Format.Block.EndString <> '' then begin 409 P := Pos(Format.Block.EndString, S); 410 if P > 0 then 411 Delete(S, P, Length(S)); 412 end; 413 395 414 repeat 396 415 P := Pos(Format.Acronym.StartString, S); … … 399 418 Delete(S, 1, P + Length(Format.Acronym.StartString) - 1); 400 419 P := Pos(Format.Acronym.EndString, S); 401 NewAcronym.Name := Trim(StripHTML(Copy(S, 1, P - 1))); 420 NewName := Trim(StripHTML(Copy(S, 1, P - 1))); 421 if NewName <> '' then NewAcronym.Name := NewName; 402 422 Delete(S, 1, P + Length(Format.Acronym.EndString) - 1); 403 423
Note:
See TracChangeset
for help on using the changeset viewer.