Changeset 219 for trunk/Acronym.pas


Ignore:
Timestamp:
Jan 17, 2025, 9:05:54 PM (4 days ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
  • Modified: Remove U prefix from unit names.
  • Modified: Use Gneeric.Collections instead of fgl.
  • Modified: Do not use global form variables.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Acronym.pas

    r218 r219  
    1 unit UAcronym;
    2 
    3 {$mode delphi}{$H+}
     1unit Acronym;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, Contnrs, XMLRead, XMLWrite, DOM, UXMLUtils,
    9   fphttpclient2, Dialogs, odbcconn, sqldb, LazUTF8, fgl;
     6  Classes, SysUtils, XMLRead, XMLWrite, DOM, XML, fphttpclient2, Dialogs,
     7  odbcconn, sqldb, LazUTF8, Generics.Collections, ListViewSort;
    108
    119type
     
    3432  { TAcronyms }
    3533
    36   TAcronyms = class(TObjectList)
     34  TAcronyms = class(TObjectList<TAcronym>)
    3735    Db: TAcronymDb;
    3836    procedure SaveToNode(Node: TDOMNode);
     
    6159  { TAcronymMeanings }
    6260
    63   TAcronymMeanings = class(TObjectList)
     61  TAcronymMeanings = class(TObjectList<TAcronymMeaning>)
    6462  public
    6563    Acronym: TAcronym;
     
    8078    ImportSources: TImportSources;
    8179    Enabled: Boolean;
     80    procedure Assign(Source: TAcronymCategory);
    8281    procedure SaveToNode(Node: TDOMNode);
    8382    procedure LoadFromNode(Node: TDOMNode);
     
    8887  { TAcronymCategories }
    8988
    90   TAcronymCategories = class(TObjectList)
     89  TAcronymCategories = class(TObjectList<TAcronymCategory>)
    9190    Db: TAcronymDb;
    9291    procedure UpdateIds;
     
    101100    procedure AssignFromStrings(Strings: TStrings);
    102101    procedure AddFromStrings(Strings: TStrings);
    103     procedure AssignToList(List: TFPGObjectList<TObject>);
     102    procedure AssignToList(List: TObjects);
     103    procedure Assign(Source: TAcronymCategories);
    104104    function GetString: string;
    105105    procedure UpdateLinkImportSources(Item: TImportSource);
     
    138138  { TImportPatterns }
    139139
    140   TImportPatterns = class(TObjectList)
     140  TImportPatterns = class(TObjectList<TImportPattern>)
    141141    procedure SaveToNode(Node: TDOMNode);
    142142    procedure LoadFromNode(Node: TDOMNode);
     
    163163  { TImportFormats }
    164164
    165   TImportFormats = class(TObjectList)
     165  TImportFormats = class(TObjectList<TImportFormat>)
    166166    procedure UpdateIds;
    167167    procedure SaveToNode(Node: TDOMNode);
     
    204204  { TImportSources }
    205205
    206   TImportSources = class(TObjectList)
     206  TImportSources = class(TObjectList<TImportSource>)
    207207    AcronymDb: TAcronymDb;
    208208    procedure UpdateIds;
     
    214214    procedure SaveToNode(Node: TDOMNode);
    215215    procedure LoadFromNode(Node: TDOMNode);
    216     procedure AssignToList(List: TFPGObjectList<TObject>);
     216    procedure AssignToList(List: TObjects);
    217217  end;
    218218
     
    230230    Modified: Boolean;
    231231    AddedCount: Integer;
    232     OnUpdate: TFPGList<TNotifyEvent>;
     232    OnUpdate: TList<TNotifyEvent>;
    233233    constructor Create;
    234234    destructor Destroy; override;
     
    243243    procedure RemoveMeaning(Meaning: TAcronymMeaning);
    244244    procedure RemoveAcronym(AcronymName, MeaningName: string);
    245     procedure AssignToList(List: TFPGObjectList<TObject>; EnabledCategoryOnly: Boolean = False);
     245    procedure AssignToList(List: TObjects; EnabledCategoryOnly: Boolean = False);
    246246    procedure BeginUpdate;
    247247    procedure EndUpdate;
     
    249249  end;
    250250
    251 function AcronymComparer(Item1, Item2: Pointer): Integer;
    252 
    253251var
    254252  ImportVariableString: array [TImportVariable] of string;
     
    256254
    257255procedure Translate;
     256
    258257
    259258implementation
     
    285284  ImportPatternFlagString[ipfSkip] := SSkip;
    286285  ImportPatternFlagString[ipfRemove] := SRemoveOnStart;
    287 end;
    288 
    289 function AcronymComparer(Item1, Item2: Pointer): Integer;
    290 begin
    291   Result := CompareStr(TAcronym(Item1).Name, TAcronym(Item2).Name);
    292286end;
    293287
     
    372366begin
    373367  for I := 0 to Count - 1 do
    374   with TImportPattern(Items[I]) do begin
     368  with Items[I] do begin
    375369    NewNode2 := Node.OwnerDocument.CreateElement('Pattern');
    376370    Node.AppendChild(NewNode2);
     
    476470    LastLength := Length(S);
    477471    for I := 0 to Format.ItemPatterns.Count - 1 do
    478     with TImportPattern(Format.ItemPatterns[I]) do
     472    with Format.ItemPatterns[I] do
    479473    if Flag = ipfRemove then begin
    480474      P := Pos(StartString, S);
     
    494488    I := 0;
    495489    while I < Format.ItemPatterns.Count do
    496     with TImportPattern(Format.ItemPatterns[I]) do begin
     490    with Format.ItemPatterns[I] do begin
    497491      if Flag <> ipfRemove then begin
    498492        if Length(StartString) > 0 then begin
     
    559553              P1 := Pos(StartString, S);
    560554              if P1 > 0 then begin
    561                 P2 := Pos(TImportPattern(Format.ItemPatterns[(I + 1) mod Format.ItemPatterns.Count]).StartString, S);
     555                P2 := Pos(TImportPattern(Format.ItemPatterns[(I + 1) mod
     556                  Format.ItemPatterns.Count]).StartString, S);
    562557                if (P2 > 0) and (P1 < P2) then Continue;
    563558              end;
     
    594589end;
    595590
    596 procedure TImportSources.AssignToList(List: TFPGObjectList<TObject>);
     591procedure TImportSources.AssignToList(List: TObjects);
    597592var
    598593  I: Integer;
     
    600595  List.Clear;
    601596  for I := 0 to Count - 1 do
    602     List.Add(TImportSource(Items[I]))
     597    List.Add(Items[I]);
    603598end;
    604599
     
    614609  LastImportTime := Now;
    615610end;
    616 
    617611
    618612{ TImportFormat }
     
    631625    ItemPatterns.Count := Source.ItemPatterns.Count;
    632626  for I := 0 to ItemPatterns.Count - 1 do begin
    633     TImportPattern(ItemPatterns[I]).Assign(TImportPattern(Source.ItemPatterns[I]));
     627    ItemPatterns[I].Assign(Source.ItemPatterns[I]);
    634628  end;
    635629end;
     
    673667destructor TImportFormat.Destroy;
    674668begin
    675   Block.Free;
    676   ItemPatterns.Free;
    677   inherited Destroy;
     669  FreeAndNil(Block);
     670  FreeAndNil(ItemPatterns);
     671  inherited;
    678672end;
    679673
     
    688682  LastId := 0;
    689683  for I := 0 to Count - 1 do begin
    690     if TImportSource(Items[I]).Id > LastId then LastId := TImportSource(Items[I]).Id;
     684    if Items[I].Id > LastId then LastId := Items[I].Id;
    691685  end;
    692686  // Add ID to new items without ID
    693687  for I := 0 to Count - 1 do begin
    694     if TImportSource(Items[I]).Id = 0 then begin
     688    if Items[I].Id = 0 then begin
    695689      Inc(LastId);
    696       TImportSource(Items[I]).Id := LastId;
     690      Items[I].Id := LastId;
    697691    end;
    698692  end;
     
    704698begin
    705699  I := 0;
    706   while (I < Count) and (TImportSource(Items[I]).Id <> Id) do Inc(I);
    707   if I < Count then Result := TImportSource(Items[I])
     700  while (I < Count) and (Items[I].Id <> Id) do Inc(I);
     701  if I < Count then Result := Items[I]
    708702    else Result := nil;
    709703end;
     
    717711    NewNode := Node.OwnerDocument.CreateElement('Ref');
    718712    Node.AppendChild(NewNode);
    719     NewNode.TextContent := WideString(IntToStr(TImportSource(Items[I]).Id));
     713    NewNode.TextContent := WideString(IntToStr(Items[I].Id));
    720714  end;
    721715end;
     
    745739  Strings.Clear;
    746740  for I := 0 to Count - 1 do
    747     Strings.AddObject(TImportSource(Items[I]).Name, Items[I]);
     741    Strings.AddObject(Items[I].Name, Items[I]);
    748742end;
    749743
     
    753747begin
    754748  I := 0;
    755   while (I < Count) and (TImportSource(Items[I]).Name <> Name) do Inc(I);
    756   if I < Count then Result := TImportSource(Items[I])
     749  while (I < Count) and (Items[I].Name <> Name) do Inc(I);
     750  if I < Count then Result := Items[I]
    757751    else Result := nil;
    758752end;
     
    765759  UpdateIds;
    766760  for I := 0 to Count - 1 do
    767   with TImportSource(Items[I]) do begin
     761  with Items[I] do begin
    768762    NewNode2 := Node.OwnerDocument.CreateElement('ImportSource');
    769763    Node.AppendChild(NewNode2);
     
    796790begin
    797791  I := 0;
    798   while (I < Count) and (TImportFormat(Items[I]).Name <> Name) do Inc(I);
    799   if I < Count then Result := TImportFormat(Items[I])
     792  while (I < Count) and (Items[I].Name <> Name) do Inc(I);
     793  if I < Count then Result := Items[I]
    800794    else Result := nil;
    801795end;
     
    809803  LastId := 0;
    810804  for I := 0 to Count - 1 do begin
    811     if TImportFormat(Items[I]).Id > LastId then LastId := TImportFormat(Items[I]).Id;
     805    if Items[I].Id > LastId then LastId := Items[I].Id;
    812806  end;
    813807  // Add ID to new items without ID
    814808  for I := 0 to Count - 1 do begin
    815     if TImportFormat(Items[I]).Id = 0 then begin
     809    if Items[I].Id = 0 then begin
    816810      Inc(LastId);
    817       TImportFormat(Items[I]).Id := LastId;
     811      Items[I].Id := LastId;
    818812    end;
    819813  end;
     
    827821  UpdateIds;
    828822  for I := 0 to Count - 1 do
    829   with TImportFormat(Items[I]) do begin
     823  with Items[I] do begin
    830824    NewNode2 := Node.OwnerDocument.CreateElement('ImportFormat');
    831825    Node.AppendChild(NewNode2);
     
    855849begin
    856850  I := 0;
    857   while (I < Count) and (TImportFormat(Items[I]).Id <> Id) do Inc(I);
    858   if I < Count then Result := TImportFormat(Items[I])
     851  while (I < Count) and (Items[I].Id <> Id) do Inc(I);
     852  if I < Count then Result := Items[I]
    859853    else Result := nil;
    860854end;
     
    869863  if DownloadHTTP(URL, ResponseStream) then begin
    870864    ResponseStream.Position := 0;
     865    S := default(string);
    871866    SetLength(S, ResponseStream.Size);
    872867    ResponseStream.Read(S[1], Length(S));
     
    942937  // Add reverse references
    943938  for I := 0 to Categories.Count - 1 do
    944     TAcronymCategory(Categories[I]).ImportSources.Add(Self);
     939    Categories[I].ImportSources.Add(Self);
    945940end;
    946941
     
    959954begin
    960955  for I := 0 to Categories.Count - 1 do
    961     TAcronymCategory(Categories[I]).ImportSources.Remove(Self);
     956    Categories[I].ImportSources.Remove(Self);
    962957  FreeAndNil(Categories);
    963958  FreeAndNil(ResponseStream);
    964   inherited Destroy;
     959  inherited;
    965960end;
    966961
     
    980975  FreeAndNil(Categories);
    981976  FreeAndNil(Sources);
    982   inherited Destroy;
     977  inherited;
    983978end;
    984979
     
    993988  LastId := 0;
    994989  for I := 0 to Count - 1 do begin
    995     if TAcronymMeaning(Items[I]).Id > LastId then LastId := TAcronymMeaning(Items[I]).Id;
     990    if Items[I].Id > LastId then LastId := Items[I].Id;
    996991  end;
    997992  // Add ID to new items without ID
    998993  for I := 0 to Count - 1 do begin
    999     if TAcronymMeaning(Items[I]).Id = 0 then begin
     994    if Items[I].Id = 0 then begin
    1000995      Inc(LastId);
    1001       TAcronymMeaning(Items[I]).Id := LastId;
     996      Items[I].Id := LastId;
    1002997    end;
    1003998  end;
     
    10111006  UpdateIds;
    10121007  for I := 0 to Count - 1 do
    1013   with TAcronymMeaning(Items[I]) do begin
     1008  with Items[I] do begin
    10141009    NewNode2 := Node.OwnerDocument.CreateElement('Meaning');
    10151010    Node.AppendChild(NewNode2);
     
    10421037  I := 0;
    10431038  if sfCaseInsensitive in Flags then begin
    1044     while (I < Count) and (LowerCase(TAcronymMeaning(Items[I]).Name) <> LowerCase(Name)) do Inc(I);
     1039    while (I < Count) and (LowerCase(Items[I].Name) <> LowerCase(Name)) do Inc(I);
    10451040  end else begin
    1046     while (I < Count) and (TAcronymMeaning(Items[I]).Name <> Name) do Inc(I);
    1047   end;
    1048   if I < Count then Result := TAcronymMeaning(Items[I])
     1041    while (I < Count) and (Items[I].Name <> Name) do Inc(I);
     1042  end;
     1043  if I < Count then Result := Items[I]
    10491044    else Result := nil;
    10501045end;
     
    10631058  Result := '';
    10641059  for I := 0 to Count - 1 do
    1065     Result := Result + ', "' + TAcronymMeaning(Items[I]).Name + '"';
     1060    Result := Result + ', "' + Items[I].Name + '"';
    10661061  System.Delete(Result, 1, 2);
    10671062end;
     
    10761071  if Categories.IndexOf(MergedCategories[I]) = -1 then begin
    10771072    Categories.Add(MergedCategories[I]);
    1078     TAcronymCategory(MergedCategories[I]).AcronymMeanings.Add(Self);
     1073    MergedCategories[I].AcronymMeanings.Add(Self);
    10791074  end;
    10801075end;
     
    11131108    // Add reverse references
    11141109    for I := 0 to Categories.Count - 1 do
    1115       TAcronymCategory(Categories[I]).AcronymMeanings.Add(Self);
     1110      Categories[I].AcronymMeanings.Add(Self);
    11161111  end;
    11171112
     
    11341129begin
    11351130  for I := 0 to Categories.Count - 1 do
    1136     TAcronymCategory(Categories[I]).AcronymMeanings.Remove(Self);
     1131    Categories[I].AcronymMeanings.Remove(Self);
    11371132  FreeAndNil(Categories);
    11381133  FreeAndNil(Sources);
    1139   inherited Destroy;
     1134  inherited;
    11401135end;
    11411136
     
    11481143begin
    11491144  for I := 0 to Count - 1 do
    1150   with TAcronym(Items[I]) do begin
     1145  with Items[I] do begin
    11511146    NewNode2 := Node.OwnerDocument.CreateElement('Acronym');
    11521147    Node.AppendChild(NewNode2);
     
    11771172  I := 0;
    11781173  if sfCaseInsensitive in Flags then begin
    1179     while (I < Count) and (LowerCase(TAcronym(Items[I]).Name) <> LowerCase(Name)) do Inc(I);
     1174    while (I < Count) and (LowerCase(Items[I].Name) <> LowerCase(Name)) do Inc(I);
    11801175  end else begin
    1181     while (I < Count) and (TAcronym(Items[I]).Name <> Name) do Inc(I);
    1182   end;
    1183   if I < Count then Result := TAcronym(Items[I])
     1176    while (I < Count) and (Items[I].Name <> Name) do Inc(I);
     1177  end;
     1178  if I < Count then Result := Items[I]
    11841179    else Result := nil;
    11851180end;
     
    12021197  LastId := 0;
    12031198  for I := 0 to Count - 1 do begin
    1204     if TAcronymCategory(Items[I]).Id > LastId then LastId := TAcronymCategory(Items[I]).Id;
     1199    if Items[I].Id > LastId then LastId := Items[I].Id;
    12051200  end;
    12061201  // Add ID to new items without ID
    12071202  for I := 0 to Count - 1 do begin
    1208     if TAcronymCategory(Items[I]).Id = 0 then begin
     1203    if Items[I].Id = 0 then begin
    12091204      Inc(LastId);
    1210       TAcronymCategory(Items[I]).Id := LastId;
     1205      Items[I].Id := LastId;
    12111206    end;
    12121207  end;
     
    12201215  UpdateIds;
    12211216  for I := 0 to Count - 1 do
    1222   with TAcronymCategory(Items[I]) do begin
     1217  with Items[I] do begin
    12231218    NewNode2 := Node.OwnerDocument.CreateElement('Category');
    12241219    Node.AppendChild(NewNode2);
     
    12511246    NewNode := Node.OwnerDocument.CreateElement('Ref');
    12521247    Node.AppendChild(NewNode);
    1253     NewNode.TextContent := WideString(IntToStr(TAcronymCategory(Items[I]).Id));
     1248    NewNode.TextContent := WideString(IntToStr(Items[I].Id));
    12541249  end;
    12551250end;
     
    12891284begin
    12901285  I := 0;
    1291   while (I < Count) and (TAcronymCategory(Items[I]).Name <> Name) do Inc(I);
    1292   if I < Count then Result := TAcronymCategory(Items[I])
     1286  while (I < Count) and (Items[I].Name <> Name) do Inc(I);
     1287  if I < Count then Result := Items[I]
    12931288    else Result := nil;
    12941289end;
     
    12991294begin
    13001295  I := 0;
    1301   while (I < Count) and (TAcronymCategory(Items[I]).Id <> Id) do Inc(I);
    1302   if I < Count then Result := TAcronymCategory(Items[I])
     1296  while (I < Count) and (Items[I].Id <> Id) do Inc(I);
     1297  if I < Count then Result := Items[I]
    13031298    else Result := nil;
    13041299end;
     
    13171312  Strings.Clear;
    13181313  for I := 0 to Count - 1 do
    1319     Strings.AddObject(TAcronymCategory(Items[I]).Name, Items[I]);
     1314    Strings.AddObject(Items[I].Name, Items[I]);
    13201315end;
    13211316
     
    13351330end;
    13361331
    1337 procedure TAcronymCategories.AssignToList(List: TFPGObjectList<TObject>);
     1332procedure TAcronymCategories.AssignToList(List: TObjects);
    13381333var
    13391334  I: Integer;
     
    13411336  List.Clear;
    13421337  for I := 0 to Count - 1 do
    1343     List.Add(TAcronymCategory(Items[I]))
     1338    List.Add(Items[I]);
     1339end;
     1340
     1341procedure TAcronymCategories.Assign(Source: TAcronymCategories);
     1342var
     1343  I: Integer;
     1344  NewCategory: TAcronymCategory;
     1345begin
     1346  Clear;
     1347  for I := 0 to Source.Count - 1 do begin
     1348    NewCategory := TAcronymCategory.Create;
     1349    NewCategory.Assign(Source[I]);
     1350    Add(NewCategory);
     1351  end;
    13441352end;
    13451353
     
    13501358  Result := '';
    13511359  for I := 0 to Count - 1 do
    1352     Result := Result + TAcronymCategory(Items[I]).Name + ',';
     1360    Result := Result + Items[I].Name + ',';
    13531361  System.Delete(Result, Length(Result), 1);
    13541362end;
     
    13591367begin
    13601368  for I := 0 to Count - 1 do
    1361     if TAcronymCategory(Items[I]).ImportSources.IndexOf(Item) = -1 then
    1362       TAcronymCategory(Items[I]).ImportSources.Add(Item);
     1369    if Items[I].ImportSources.IndexOf(Item) = -1 then
     1370      Items[I].ImportSources.Add(Item);
    13631371end;
    13641372
     
    13681376begin
    13691377  for I := 0 to Count - 1 do
    1370     if TAcronymCategory(Items[I]).AcronymMeanings.IndexOf(Item) = -1 then
    1371       TAcronymCategory(Items[I]).AcronymMeanings.Add(Item);
     1378    if Items[I].AcronymMeanings.IndexOf(Item) = -1 then
     1379      Items[I].AcronymMeanings.Add(Item);
    13721380end;
    13731381
     
    13781386  Result := False;
    13791387  for I := 0 to Count - 1 do
    1380   if TAcronymCategory(Items[I]).Enabled then begin
     1388  if Items[I].Enabled then begin
    13811389    Result := True;
    13821390    Break;
     
    14171425begin
    14181426  FreeAndNil(Meanings);
    1419   inherited Destroy;
     1427  inherited;
    14201428end;
    14211429
    14221430{ TAcronymCategory }
     1431
     1432procedure TAcronymCategory.Assign(Source: TAcronymCategory);
     1433begin
     1434  Id := Source.Id;
     1435  Name := Source.Name;
     1436  // AcronymMeanings.Assign(Source.AcronymMeanings);
     1437  // ImportSources.Assign(Source.ImportSources);
     1438  Enabled := Source.Enabled;
     1439end;
    14231440
    14241441procedure TAcronymCategory.SaveToNode(Node: TDOMNode);
     
    14501467begin
    14511468  for I := 0 to AcronymMeanings.Count - 1 do
    1452     TAcronymMeaning(AcronymMeanings[I]).Categories.Remove(Self);
     1469    AcronymMeanings[I].Categories.Remove(Self);
    14531470  FreeAndNil(AcronymMeanings);
    14541471  for I := 0 to ImportSources.Count - 1 do
    1455     TImportSource(ImportSources[I]).Categories.Remove(Self);
     1472    ImportSources[I].Categories.Remove(Self);
    14561473  FreeAndNil(ImportSources);
    1457   inherited Destroy;
     1474  inherited;
    14581475end;
    14591476
     
    14701487  ImportFormats := TImportFormats.Create;
    14711488  FUpdateCount := 0;
    1472   OnUpdate := TFPGList<TNotifyEvent>.Create;
     1489  OnUpdate := TList<TNotifyEvent>.Create;
    14731490end;
    14741491
     
    14801497  FreeAndNil(Acronyms);
    14811498  FreeAndNil(Categories);
    1482   inherited Destroy;
     1499  inherited;
    14831500end;
    14841501
     
    16361653    Line.Clear;
    16371654    for I := 0 to Acronyms.Count - 1 do
    1638     with TAcronym(Acronyms[I]) do begin
     1655    with Acronyms[I] do begin
    16391656      for K := 0 to Meanings.Count - 1 do
    1640       with TAcronymMeaning(Meanings[K]) do begin
     1657      with Meanings[K] do begin
    16411658        Line.Clear;
    16421659        Line.Add(Acronym.Name);
     
    16441661        Context.Clear;
    16451662        for J := 0 to Categories.Count - 1 do
    1646           Context.Add(TAcronymCategory(Categories[J]).Name);
     1663          Context.Add(Categories[J].Name);
    16471664        Line.Add(Context.DelimitedText);
    16481665        F.Add(Line.CommaText);
     
    16661683  Items.Clear;
    16671684  for I := 0 to Acronyms.Count - 1 do
    1668   with TAcronym(Acronyms[I]) do begin
     1685  with Acronyms[I] do begin
    16691686    for J := 0 to Meanings.Count - 1 do
    1670     with TAcronymMeaning(Meanings[J]) do begin
    1671       if (AName = '') or (Pos(AName, LowerCase(TAcronym(Acronyms[I]).Name)) > 0)
    1672         or (Pos(AName, LowerCase(Name)) > 0) then Items.Add(TAcronymMeaning(Meanings[J]))
     1687    with Meanings[J] do begin
     1688      if (AName = '') or (Pos(AName, LowerCase(Acronyms[I].Name)) > 0)
     1689        or (Pos(AName, LowerCase(Name)) > 0) then Items.Add(Meanings[J])
    16731690    end;
    16741691  end;
     
    16811698  Result := 0;
    16821699  for I := 0 to Acronyms.Count - 1 do
    1683     Result := Result + TAcronym(Acronyms[I]).Meanings.Count;
     1700    Result := Result + Acronyms[I].Meanings.Count;
    16841701end;
    16851702
     
    17461763end;
    17471764
    1748 procedure TAcronymDb.AssignToList(List: TFPGObjectList<TObject>; EnabledCategoryOnly: Boolean = False);
     1765procedure TAcronymDb.AssignToList(List: TObjects; EnabledCategoryOnly: Boolean = False);
    17491766var
    17501767  I: Integer;
     
    17531770  List.Clear;
    17541771  for I := 0 to Acronyms.Count - 1 do
    1755   with TAcronym(Acronyms[I]) do begin
     1772  with Acronyms[I] do begin
    17561773    for J := 0 to Meanings.Count - 1 do
    1757     with TAcronymMeaning(Meanings[J]) do
     1774    with Meanings[J] do
    17581775    if not EnabledCategoryOnly or (EnabledCategoryOnly and Categories.IsAnyEnabled) then begin
    1759       List.Add(TAcronymMeaning(Meanings[J]));
     1776      List.Add(Meanings[J]);
    17601777    end;
    17611778  end;
Note: See TracChangeset for help on using the changeset viewer.