Ignore:
Timestamp:
Jan 20, 2025, 11:38:55 AM (42 hours ago)
Author:
chronos
Message:
  • Modified: Do not reference global Core object if possible.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormImport.pas

    r219 r227  
    2323    procedure ImportMediaWiki;
    2424    procedure ImportCSV;
     25  public
     26    AcronymDb: TAcronymDb;
    2527  end;
    2628
     
    2931
    3032{$R *.lfm}
    31 
    32 uses
    33   Core;
    3433
    3534resourcestring
     
    7574      AcronymMeaning := Trim(Copy(Line, 2, Length(Line)));
    7675      if (AcronymName <> '') and (AcronymMeaning <> '') then begin
    77         Acronym := Core.Core.AcronymDb.Acronyms.SearchByName(AcronymName);
     76        Acronym := AcronymDb.Acronyms.SearchByName(AcronymName);
    7877        if not Assigned(Acronym) then begin
    7978          Acronym := TAcronym.Create;
    8079          Acronym.Name := AcronymName;
    81           Core.Core.AcronymDb.Acronyms.Add(Acronym);
     80          AcronymDb.Acronyms.Add(Acronym);
    8281        end;
    8382        Meaning := Acronym.Meanings.SearchByName(AcronymMeaning);
     
    9291    end;
    9392  end;
    94   if AddedCount > 0 then Core.Core.AcronymDb.Modified := True;
     93  if AddedCount > 0 then AcronymDb.Modified := True;
    9594  ShowMessage(Format(SImportedNewAcronyms, [AddedCount]));
    9695end;
     
    121120      else AcronymDescription := '';
    122121    if (AcronymName <> '') and (AcronymDescription <> '') then begin
    123       Acronym := Core.Core.AcronymDb.Acronyms.SearchByName(AcronymName);
     122      Acronym := AcronymDb.Acronyms.SearchByName(AcronymName);
    124123      if not Assigned(Acronym) then begin
    125124        Acronym := TAcronym.Create;
    126125        Acronym.Name := AcronymName;
    127         Core.Core.AcronymDb.Acronyms.Add(Acronym);
     126        AcronymDb.Acronyms.Add(Acronym);
    128127      end;
    129128      Meaning := Acronym.Meanings.SearchByName(AcronymDescription);
     
    139138  end;
    140139  Columns.Free;
    141   if AddedCount > 0 then Core.Core.AcronymDb.Modified := True;
     140  if AddedCount > 0 then AcronymDb.Modified := True;
    142141  ShowMessage(Format(SImportedNewAcronyms, [AddedCount]));
    143142end;
Note: See TracChangeset for help on using the changeset viewer.