Changeset 206


Ignore:
Timestamp:
Jun 19, 2019, 5:31:24 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Allow to have acronym and its meaning on different lines in acronyms summary.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormCheck.pas

    r204 r206  
    318318  Acronym: string;
    319319  Meaning: string;
     320  Index: Integer;
    320321begin
    321322  AcronymDbSummary.Acronyms.Clear;
     
    325326    AcronymSectionEnd := SearchLine(MemoDocument.Lines, EditSummaryEnd.Text, AcronymSectionStart + 1);
    326327    if AcronymSectionEnd <> -1 then begin
     328      Acronym := '';
    327329      for I := AcronymSectionStart + 1 to AcronymSectionEnd - 1 do begin
    328330        Line := Trim(MemoDocument.Lines[I]);
    329331        Line := StringReplace(Line, #9, ' ', [rfReplaceAll]);
    330332        if Line <> '' then begin
    331           if Pos(' ', Line) > 0 then begin
    332             Acronym := Copy(Line, 1, Pos(' ', Line) - 1);
    333             if IsUppercaseAlpha(Acronym) then begin
    334               Meaning := Trim(Copy(Line, Pos(' ', Line) + 1, Length(Line)));
    335               if Assigned(AcronymDbSummary.SearchAcronym(Acronym, Meaning)) then
    336                 ReportItems.AddNew(Format(SDuplicateAcronymSummary, [Acronym, Meaning]), Point(0, I), rtWarning)
    337                 else AcronymDbSummary.AddAcronym(Acronym, Meaning);
     333          if (Acronym <> '') and IsUppercaseAlpha(Acronym) then begin
     334            Meaning := Line;
     335          end else begin
     336            Index := Pos(' ', Line);
     337            if Index > 0 then begin
     338              Acronym := Copy(Line, 1, Index - 1);
     339              Meaning := Trim(Copy(Line, Index + 1, Length(Line)));
     340            end else begin
     341              if Acronym = '' then Acronym := Line
     342                else Meaning := Line;
    338343            end;
     344          end;
     345          if (Acronym <> '') and IsUppercaseAlpha(Acronym) and (Meaning <> '') then begin
     346            if Assigned(AcronymDbSummary.SearchAcronym(Acronym, Meaning)) then
     347              ReportItems.AddNew(Format(SDuplicateAcronymSummary, [Acronym, Meaning]), Point(0, I), rtWarning)
     348              else AcronymDbSummary.AddAcronym(Acronym, Meaning);
     349            Acronym := '';
     350            Meaning := '';
    339351          end;
    340352        end;
Note: See TracChangeset for help on using the changeset viewer.