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/FormExport.pas

    r221 r227  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   JobProgressView, FormEx;
     7  JobProgressView, FormEx, Acronym;
    88
    99type
     
    1515    ButtonSaveToFile: TButton;
    1616    ComboBoxDataFormat: TComboBox;
     17    JobProgressView1: TJobProgressView;
    1718    Label1: TLabel;
    1819    Memo1: TMemo;
     
    2627    procedure JobExportMediaWiki(Job: TJob);
    2728    procedure JobExportMediaWikiTable(Job: TJob);
     29  public
     30    AcronymDb: TAcronymDb;
    2831  end;
    2932
     
    3235
    3336{$R *.lfm}
    34 
    35 uses
    36   Core, Acronym;
    3737
    3838resourcestring
     
    5757  J: Integer;
    5858begin
    59   Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count;
     59  Job.Progress.Max := AcronymDb.Acronyms.Count;
    6060  ItemCount := 0;
    6161  Content := '';
    62   for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do
    63   with Core.Core.AcronymDb.Acronyms[I] do begin
     62  for I := 0 to AcronymDb.Acronyms.Count - 1 do
     63  with AcronymDb.Acronyms[I] do begin
    6464    for J := 0 to Meanings.Count - 1 do
    6565    with Meanings[J] do begin
     
    7777  J: Integer;
    7878begin
    79   Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count;
     79  Job.Progress.Max := AcronymDb.Acronyms.Count;
    8080  ItemCount := 0;
    8181  Content := '';
    82   for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do
    83   with Core.Core.AcronymDb.Acronyms[I] do begin
     82  for I := 0 to AcronymDb.Acronyms.Count - 1 do
     83  with AcronymDb.Acronyms[I] do begin
    8484    Content := Content + '; ' + Name + LineEnding;
    8585    for J := 0 to Meanings.Count - 1 do
     
    9898  J: Integer;
    9999begin
    100   Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count;
     100  Job.Progress.Max := AcronymDb.Acronyms.Count;
    101101  ItemCount := 0;
    102102  Content := '{| class="wikitable sortable"' + LineEnding +
    103103    '! Name !! Meaning !! Description !! Categories' + LineEnding;
    104   for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do
    105   with Core.Core.AcronymDb.Acronyms[I] do begin
     104  for I := 0 to AcronymDb.Acronyms.Count - 1 do
     105  with AcronymDb.Acronyms[I] do begin
    106106    for J := 0 to Meanings.Count - 1 do
    107107    with Meanings[J] do begin
     
    120120begin
    121121  if ComboBoxDataFormat.ItemIndex = 0 then
    122     Core.Core.JobProgressView1.AddJob(SExporting, JobExportCSV);
     122    JobProgressView1.AddJob(SExporting, JobExportCSV);
    123123  if ComboBoxDataFormat.ItemIndex = 1 then
    124     Core.Core.JobProgressView1.AddJob(SExporting, JobExportMediaWiki);
     124    JobProgressView1.AddJob(SExporting, JobExportMediaWiki);
    125125  if ComboBoxDataFormat.ItemIndex = 2 then
    126     Core.Core.JobProgressView1.AddJob(SExporting, JobExportMediaWikiTable);
    127   Core.Core.JobProgressView1.Start;
     126    JobProgressView1.AddJob(SExporting, JobExportMediaWikiTable);
     127  JobProgressView1.Start;
    128128  Memo1.Lines.Text := Content;
    129129  ShowMessage(Format(SExportedAcronyms, [ItemCount]));
Note: See TracChangeset for help on using the changeset viewer.