Changeset 184


Ignore:
Timestamp:
Jul 4, 2018, 2:05:48 PM (6 years ago)
Author:
chronos
Message:
  • Added: New menu action Tools - Document check which shows a form for checking acronyms in text documents.
  • Added: Remember dimensions of Import, Export and Settings forms.
Location:
trunk
Files:
2 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/AcronymDecoder.lpi

    r172 r184  
    104104      </Item5>
    105105    </RequiredPackages>
    106     <Units Count="17">
     106    <Units Count="18">
    107107      <Unit0>
    108108        <Filename Value="AcronymDecoder.lpr"/>
     
    218218        <ResourceBaseClass Value="Form"/>
    219219      </Unit16>
     220      <Unit17>
     221        <Filename Value="Forms\UFormCheck.pas"/>
     222        <IsPartOfProject Value="True"/>
     223        <ComponentName Value="FormCheck"/>
     224        <HasResources Value="True"/>
     225        <ResourceBaseClass Value="Form"/>
     226      </Unit17>
    220227    </Units>
    221228  </ProjectOptions>
  • trunk/AcronymDecoder.lpr

    r169 r184  
    99  Interfaces, // this includes the LCL widgetset
    1010  Forms, UAcronym, Common, SysUtils, TemplateGenerics,
    11   CoolTranslator, UFormMain, UCore
     11  CoolTranslator, UFormMain, UCore, UFormCheck
    1212  { you can add units after this };
    1313
  • trunk/Forms/UFormAcronyms.pas

    r174 r184  
    5050    procedure ListViewSort1Filter(ListViewSort: TListViewSort);
    5151  private
     52    FAcronyms: TAcronyms;
    5253    MeaningCount: Integer;
    5354    procedure FilterList(List: TListObject);
     55    procedure SetAcronyms(AValue: TAcronyms);
    5456    procedure UpdateAcronymsList;
    5557  public
    5658    FocusAcronym: TAcronymMeaning;
     59    property Acronyms: TAcronyms read FAcronyms write SetAcronyms;
    5760    procedure UpdateInterface;
    5861  end;
     
    147150    if FormAcronym.ShowModal = mrOk then begin
    148151      FormAcronym.Save(TempEntry);
    149       Meaning := Core.AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning);
     152      Meaning := Acronyms.Db.AddAcronym(TempEntry.Name, TempEntry.Meaning);
    150153      Meaning.Description := TempEntry.Description;
    151154      Meaning.Categories.AssignFromStrings(TempEntry.Categories);
     
    156159          TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.Add(Meaning);
    157160
    158       Core.AcronymDb.Update;
     161      Acronyms.Db.Update;
    159162      UpdateAcronymsList;
    160163      UpdateInterface;
     
    193196        not FormMain.CompareStrings(TempEntry.Categories, TempCategories) then begin
    194197          // TODO: Update item inplace if possible
    195           Core.AcronymDb.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Selected.Data));
    196           Meaning := Core.AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning);
     198          Acronyms.Db.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Selected.Data));
     199          Meaning := Acronyms.Db.AddAcronym(TempEntry.Name, TempEntry.Meaning);
    197200          Meaning.Description := TempEntry.Description;
    198201          Meaning.Categories.AssignFromStrings(TempEntry.Categories);
     
    202205            if TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.IndexOf(Meaning) = -1 then
    203206              TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.Add(Meaning);
    204           Core.AcronymDb.Update;
     207          Acronyms.Db.Update;
    205208          UpdateAcronymsList;
    206209          UpdateInterface;
     
    222225    if MessageDlg(SRemoveAcronym, SRemoveAcronymQuery,
    223226    TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin
    224       Core.AcronymDb.BeginUpdate;
     227      Acronyms.Db.BeginUpdate;
    225228      for I := ListViewAcronyms.Items.Count - 1 downto 0 do
    226229        if ListViewAcronyms.Items[I].Selected then begin
    227230          ListViewAcronyms.Items[I].Selected := False;
    228           Core.AcronymDb.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Items[I].Data));
     231          Acronyms.Db.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Items[I].Data));
    229232        end;
    230233      UpdateAcronymsList;
    231234      UpdateInterface;
    232       Core.AcronymDb.EndUpdate;
     235      Acronyms.Db.EndUpdate;
    233236    end;
    234237  end;
     
    287290procedure TFormAcronyms.ListViewSort1Filter(ListViewSort: TListViewSort);
    288291begin
    289   Core.AcronymDb.Acronyms.Sort(AcronymComparer);
    290   Core.AcronymDb.AssignToList(ListViewSort1.List);
     292  Acronyms.Db.Acronyms.Sort(AcronymComparer);
     293  Acronyms.Db.AssignToList(ListViewSort1.List);
    291294  MeaningCount := ListViewSort1.List.Count;
    292295  FilterList(ListViewSort1.List);
     
    322325end;
    323326
     327procedure TFormAcronyms.SetAcronyms(AValue: TAcronyms);
     328begin
     329  if FAcronyms = AValue then Exit;
     330  FAcronyms := AValue;
     331end;
     332
    324333procedure TFormAcronyms.UpdateAcronymsList;
    325334begin
     
    332341procedure TFormAcronyms.UpdateInterface;
    333342begin
    334   ARemove.Enabled := Assigned(Core.AcronymDb) and Assigned(ListViewAcronyms.Selected);
    335   AModify.Enabled := Assigned(Core.AcronymDb) and Assigned(ListViewAcronyms.Selected);
    336   AAdd.Enabled := Assigned(Core.AcronymDb);
     343  ARemove.Enabled := Assigned(FAcronyms) and Assigned(ListViewAcronyms.Selected);
     344  AModify.Enabled := Assigned(FAcronyms) and Assigned(ListViewAcronyms.Selected);
     345  AAdd.Enabled := Assigned(FAcronyms);
    337346  ASelectAll.Enabled := True;
    338347end;
  • trunk/Forms/UFormExport.lfm

    r174 r184  
    88  ClientWidth = 850
    99  DesignTimePPI = 120
     10  OnClose = FormClose
    1011  OnCreate = FormCreate
     12  OnShow = FormShow
    1113  Position = poScreenCenter
    12   LCLVersion = '1.8.0.6'
     14  LCLVersion = '1.8.2.0'
    1315  object ButtonProcess: TButton
    1416    Left = 18
  • trunk/Forms/UFormExport.pas

    r174 r184  
    2121    procedure ButtonProcessClick(Sender: TObject);
    2222    procedure ButtonSaveToFileClick(Sender: TObject);
     23    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    2324    procedure FormCreate(Sender: TObject);
     25    procedure FormShow(Sender: TObject);
    2426  private
    2527    ItemCount: Integer;
     
    5860end;
    5961
     62procedure TFormExport.FormClose(Sender: TObject; var CloseAction: TCloseAction);
     63begin
     64  Core.PersistentForm1.Save(Self);
     65end;
     66
    6067procedure TFormExport.FormCreate(Sender: TObject);
    6168begin
    6269  Core.CoolTranslator1.TranslateComponentRecursive(Self);
    6370  Core.ThemeManager.UseTheme(Self);
     71end;
     72
     73procedure TFormExport.FormShow(Sender: TObject);
     74begin
     75  Core.PersistentForm1.Load(Self);
    6476end;
    6577
  • trunk/Forms/UFormImport.lfm

    r174 r184  
    88  ClientWidth = 652
    99  DesignTimePPI = 120
     10  OnClose = FormClose
    1011  OnCreate = FormCreate
     12  OnShow = FormShow
    1113  Position = poScreenCenter
    12   LCLVersion = '1.8.0.6'
     14  LCLVersion = '1.8.2.0'
    1315  object ButtonProcess: TButton
    1416    Left = 16
  • trunk/Forms/UFormImport.pas

    r174 r184  
    2222    procedure ButtonProcessClick(Sender: TObject);
    2323    procedure ButtonLoadFromFileClick(Sender: TObject);
     24    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    2425    procedure FormCreate(Sender: TObject);
     26    procedure FormShow(Sender: TObject);
    2527  private
    2628    procedure ImportMediaWiki;
     
    6062end;
    6163
     64procedure TFormImport.FormClose(Sender: TObject; var CloseAction: TCloseAction);
     65begin
     66  Core.PersistentForm1.Save(Self);
     67end;
     68
    6269procedure TFormImport.FormCreate(Sender: TObject);
    6370begin
    6471  Core.CoolTranslator1.TranslateComponentRecursive(Self);
    6572  Core.ThemeManager.UseTheme(Self);
     73end;
     74
     75procedure TFormImport.FormShow(Sender: TObject);
     76begin
     77  Core.PersistentForm1.Load(Self);
    6678end;
    6779
  • trunk/Forms/UFormMain.lfm

    r176 r184  
    1515  OnHide = FormHide
    1616  OnShow = FormShow
    17   LCLVersion = '1.8.0.6'
     17  LCLVersion = '1.8.2.0'
    1818  object PanelMain: TPanel
    1919    Left = 0
     
    416416      OnExecute = AManageAcronymExecute
    417417    end
     418    object ADocumentCheck: TAction
     419      Caption = 'Document check'
     420      OnExecute = ADocumentCheckExecute
     421    end
    418422  end
    419423  object MainMenu1: TMainMenu
     
    488492      object MenuItem23: TMenuItem
    489493        Action = AProcessImports
     494      end
     495      object MenuItem3: TMenuItem
     496        Action = ADocumentCheck
     497      end
     498      object MenuItem2: TMenuItem
     499        Caption = '-'
    490500      end
    491501      object MenuItem18: TMenuItem
  • trunk/Forms/UFormMain.pas

    r180 r184  
    1616
    1717  TFormMain = class(TForm)
     18    ADocumentCheck: TAction;
    1819    AFilterEnabledCategories: TAction;
    1920    AManageAcronym: TAction;
     
    4849    MainMenu1: TMainMenu;
    4950    MenuItem1: TMenuItem;
     51    MenuItem2: TMenuItem;
     52    MenuItem3: TMenuItem;
    5053    MenuItemShowItemsWithoutFilter: TMenuItem;
    5154    MenuItemStatusBar: TMenuItem;
     
    98101    ToolButton8: TToolButton;
    99102    ToolButton9: TToolButton;
     103    procedure ADocumentCheckExecute(Sender: TObject);
    100104    procedure AExitExecute(Sender: TObject);
    101105    procedure AExportExecute(Sender: TObject);
     
    175179uses
    176180  UFormImport, UFormSettings, UFormCategories, UFormAcronyms, UFormExport,
    177   UFormImportSources, UFormAbout, UFormImportFormats, UCore;
     181  UFormImportSources, UFormAbout, UFormImportFormats, UCore, UFormCheck;
    178182
    179183resourcestring
     
    240244begin
    241245  Close;
     246end;
     247
     248procedure TFormMain.ADocumentCheckExecute(Sender: TObject);
     249begin
     250  FormCheck := TFormCheck.Create(Self);
     251  try
     252    FormCheck.LoadConfig;
     253    FormCheck.ShowModal;
     254    FormCheck.SaveConfig;
     255  finally
     256    FreeAndNil(FormCheck);
     257  end;
    242258end;
    243259
     
    365381    if Assigned(ListViewAcronyms.Selected) then
    366382      FormAcronyms.FocusAcronym := ListViewAcronyms.Selected.Data;
     383    FormAcronyms.Acronyms := Core.AcronymDb.Acronyms;
    367384    FormAcronyms.ShowModal;
    368385    UpdateAcronymsList;
     
    429446  FormAcronyms := TFormAcronyms.Create(Self);
    430447  try
     448    FormAcronyms.Acronyms := Core.AcronymDb.Acronyms;
    431449    FormAcronyms.ShowModal;
    432450    UpdateAcronymsList;
  • trunk/Forms/UFormSettings.lfm

    r174 r184  
    1010  Constraints.MinWidth = 389
    1111  DesignTimePPI = 120
     12  OnClose = FormClose
    1213  OnCreate = FormCreate
    1314  OnShow = FormShow
    1415  Position = poScreenCenter
    15   LCLVersion = '1.8.0.6'
     16  LCLVersion = '1.8.2.0'
    1617  object ComboBoxLanguage: TComboBox
    1718    Left = 152
  • trunk/Forms/UFormSettings.pas

    r174 r184  
    3131    procedure CheckBoxAutomaticDPIChange(Sender: TObject);
    3232    procedure CheckBoxStartOnLogonChange(Sender: TObject);
     33    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3334    procedure FormCreate(Sender: TObject);
    3435    procedure FormShow(Sender: TObject);
     
    5556procedure TFormSettings.FormShow(Sender: TObject);
    5657begin
     58  Core.PersistentForm1.Load(Self);
    5759end;
    5860
     
    6971begin
    7072  UpdateInterface;
     73end;
     74
     75procedure TFormSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction
     76  );
     77begin
     78  Core.PersistentForm1.Save(Self);
    7179end;
    7280
  • trunk/Languages/AcronymDecoder.cs.po

    r178 r184  
    190190msgstr "Vybrat kategories"
    191191
     192#: tformcheck.buttonacronymscontent.caption
     193msgctxt "tformcheck.buttonacronymscontent.caption"
     194msgid "Acronyms"
     195msgstr "Zkratky"
     196
     197#: tformcheck.buttonacronymssummary.caption
     198msgctxt "tformcheck.buttonacronymssummary.caption"
     199msgid "Acronyms"
     200msgstr "Zkratky"
     201
     202#: tformcheck.buttoncheck.caption
     203msgid "Check"
     204msgstr "Kontrolovat"
     205
     206#: tformcheck.buttonloadfromfile.caption
     207msgctxt "tformcheck.buttonloadfromfile.caption"
     208msgid "Load from file"
     209msgstr "Načíst ze souboru"
     210
     211#: tformcheck.caption
     212msgid "Check document"
     213msgstr "Kontrolovat dokument"
     214
     215#: tformcheck.groupbox1.caption
     216msgid "Summary section"
     217msgstr "Sekce přehledu"
     218
     219#: tformcheck.groupbox2.caption
     220msgid "Content"
     221msgstr "Obsah"
     222
     223#: tformcheck.label1.caption
     224msgctxt "tformcheck.label1.caption"
     225msgid "Start string:"
     226msgstr "Počáteční řetězec:"
     227
     228#: tformcheck.label2.caption
     229msgctxt "tformcheck.label2.caption"
     230msgid "End string:"
     231msgstr "Koncový řetězec:"
     232
     233#: tformcheck.labelacronymcountcontent.caption
     234msgctxt "tformcheck.labelacronymcountcontent.caption"
     235msgid "Acronym count:"
     236msgstr "Počet zkratek:"
     237
     238#: tformcheck.labelacronymcountsummary.caption
     239msgctxt "tformcheck.labelacronymcountsummary.caption"
     240msgid "Acronym count:"
     241msgstr "Počet zkratek:"
     242
     243#: tformcheck.tabsheetreport.caption
     244msgid "Report"
     245msgstr "Hlášení"
     246
     247#: tformcheck.tabsheetsource.caption
     248msgid "Source"
     249msgstr "Zdroj"
     250
    192251#: tformexport.buttonprocess.caption
    193252msgctxt "tformexport.buttonprocess.caption"
     
    210269
    211270#: tformimport.buttonloadfromfile.caption
     271msgctxt "tformimport.buttonloadfromfile.caption"
    212272msgid "Load from file"
    213273msgstr "Načíst ze souboru"
     
    370430
    371431#: tformimportpattern.label8.caption
     432msgctxt "tformimportpattern.label8.caption"
    372433msgid "Start string:"
    373434msgstr "Počáteční řetězec"
    374435
    375436#: tformimportpattern.label9.caption
     437msgctxt "tformimportpattern.label9.caption"
    376438msgid "End string:"
    377439msgstr "Koncový řetězec"
     
    504566msgstr "ToolBar1"
    505567
     568#: tformmain.adocumentcheck.caption
     569msgid "Document check"
     570msgstr "Kontrola dokumentu"
     571
    506572#: tformmain.aexit.caption
    507573msgid "Exit"
     
    851917msgstr "Opravdu chcete odebrat vybrané kategorie?"
    852918
     919#: uformcheck.sacronymcountcontent
     920msgctxt "uformcheck.sacronymcountcontent"
     921msgid "Content acronym count:"
     922msgstr "Počet zkratek obsahu:"
     923
     924#: uformcheck.sacronymcountsummary
     925msgctxt "uformcheck.sacronymcountsummary"
     926msgid "Summary acronym count:"
     927msgstr "Počet zkratek přehledu:"
     928
     929#: uformcheck.sduplicateacronymcontent
     930msgid "Duplicate acronym %s with \"%s\" in document content."
     931msgstr "Zdvojená zkratka %s s významem \"%s\" v těle dokumentu."
     932
     933#: uformcheck.sduplicateacronymsummary
     934msgid "Duplicate acronym %s with \"%s\" in acronym summary."
     935msgstr "Zdvojená zkratka %s s významem \"%s\" v přehledu zkratek."
     936
     937#: uformcheck.smissingacronymcontent
     938msgid "Content acronym %s with meaning \"%s\" missing from summary acronyms."
     939msgstr "V zkratkách přehledu chybí zkratka obsahu %s s významem \"%s\"."
     940
     941#: uformcheck.smissingacronymsummary
     942msgid "Summary acronym %s with meaning \"%s\" missing from content acronyms."
     943msgstr "V zkratkách obsahu chybí zkratka přehledu %s s významem \"%s\"."
     944
    853945#: uformexport.sexportedacronyms
    854946msgctxt "uformexport.sexportedacronyms"
  • trunk/Languages/AcronymDecoder.po

    r178 r184  
    180180msgstr ""
    181181
     182#: tformcheck.buttonacronymscontent.caption
     183msgctxt "tformcheck.buttonacronymscontent.caption"
     184msgid "Acronyms"
     185msgstr ""
     186
     187#: tformcheck.buttonacronymssummary.caption
     188msgctxt "tformcheck.buttonacronymssummary.caption"
     189msgid "Acronyms"
     190msgstr ""
     191
     192#: tformcheck.buttoncheck.caption
     193msgid "Check"
     194msgstr ""
     195
     196#: tformcheck.buttonloadfromfile.caption
     197msgctxt "tformcheck.buttonloadfromfile.caption"
     198msgid "Load from file"
     199msgstr ""
     200
     201#: tformcheck.caption
     202msgid "Check document"
     203msgstr ""
     204
     205#: tformcheck.groupbox1.caption
     206msgid "Summary section"
     207msgstr ""
     208
     209#: tformcheck.groupbox2.caption
     210msgid "Content"
     211msgstr ""
     212
     213#: tformcheck.label1.caption
     214msgctxt "tformcheck.label1.caption"
     215msgid "Start string:"
     216msgstr ""
     217
     218#: tformcheck.label2.caption
     219msgctxt "tformcheck.label2.caption"
     220msgid "End string:"
     221msgstr ""
     222
     223#: tformcheck.labelacronymcountcontent.caption
     224msgctxt "tformcheck.labelacronymcountcontent.caption"
     225msgid "Acronym count:"
     226msgstr ""
     227
     228#: tformcheck.labelacronymcountsummary.caption
     229msgctxt "tformcheck.labelacronymcountsummary.caption"
     230msgid "Acronym count:"
     231msgstr ""
     232
     233#: tformcheck.tabsheetreport.caption
     234msgid "Report"
     235msgstr ""
     236
     237#: tformcheck.tabsheetsource.caption
     238msgid "Source"
     239msgstr ""
     240
    182241#: tformexport.buttonprocess.caption
    183242msgctxt "TFORMEXPORT.BUTTONPROCESS.CAPTION"
     
    200259
    201260#: tformimport.buttonloadfromfile.caption
     261msgctxt "tformimport.buttonloadfromfile.caption"
    202262msgid "Load from file"
    203263msgstr ""
     
    360420
    361421#: tformimportpattern.label8.caption
     422msgctxt "tformimportpattern.label8.caption"
    362423msgid "Start string:"
    363424msgstr ""
    364425
    365426#: tformimportpattern.label9.caption
     427msgctxt "tformimportpattern.label9.caption"
    366428msgid "End string:"
    367429msgstr ""
     
    494556msgstr ""
    495557
     558#: tformmain.adocumentcheck.caption
     559msgid "Document check"
     560msgstr ""
     561
    496562#: tformmain.aexit.caption
    497563msgid "Exit"
     
    841907msgstr ""
    842908
     909#: uformcheck.sacronymcountcontent
     910msgctxt "uformcheck.sacronymcountcontent"
     911msgid "Content acronym count:"
     912msgstr ""
     913
     914#: uformcheck.sacronymcountsummary
     915msgctxt "uformcheck.sacronymcountsummary"
     916msgid "Summary acronym count:"
     917msgstr ""
     918
     919#: uformcheck.sduplicateacronymcontent
     920msgid "Duplicate acronym %s with \"%s\" in document content."
     921msgstr ""
     922
     923#: uformcheck.sduplicateacronymsummary
     924msgid "Duplicate acronym %s with \"%s\" in acronym summary."
     925msgstr ""
     926
     927#: uformcheck.smissingacronymcontent
     928msgid "Content acronym %s with meaning \"%s\" missing from summary acronyms."
     929msgstr ""
     930
     931#: uformcheck.smissingacronymsummary
     932msgid "Summary acronym %s with meaning \"%s\" missing from content acronyms."
     933msgstr ""
     934
    843935#: uformexport.sexportedacronyms
    844936msgctxt "uformexport.sexportedacronyms"
  • trunk/Packages/Common/UTheme.pas

    r181 r184  
    158158        ApplyTheme(TPageControl(Component).Pages[I]);
    159159    end;
     160
     161    if Control is TCoolBar then begin
     162      (Control as TCoolBar).Themed := False;
     163    end;
    160164  end;
    161165end;
  • trunk/UAcronym.pas

    r159 r184  
    1717  TImportSources = class;
    1818  TImportFormats = class;
     19
     20  TSearchFlag = (sfCaseInsensitive);
     21  TSearchFlags = set of TSearchFlag;
    1922
    2023  { TAcronym }
     
    3639    procedure SaveToNode(Node: TDOMNode);
    3740    procedure LoadFromNode(Node: TDOMNode);
    38     function SearchByName(Name: string): TAcronym;
     41    function SearchByName(Name: string; Flags: TSearchFlags = []): TAcronym;
    3942    function AddAcronym(Name: string): TAcronym;
    4043  end;
     
    6568    procedure SaveToNode(Node: TDOMNode);
    6669    procedure LoadFromNode(Node: TDOMNode);
    67     function SearchByName(Name: string): TAcronymMeaning;
     70    function SearchByName(Name: string; Flags: TSearchFlags = []): TAcronymMeaning;
    6871    function AddMeaning(Name: string): TAcronymMeaning;
    6972  end;
     
    237240    function GetMeaningsCount: Integer;
    238241    function AddAcronym(AcronymName, MeaningName: string): TAcronymMeaning;
     242    function SearchAcronym(AcronymName, MeaningName: string; Flags: TSearchFlags = []): TAcronymMeaning;
    239243    procedure RemoveMeaning(Meaning: TAcronymMeaning);
    240244    procedure RemoveAcronym(AcronymName, MeaningName: string);
     
    10311035end;
    10321036
    1033 function TAcronymMeanings.SearchByName(Name: string): TAcronymMeaning;
     1037function TAcronymMeanings.SearchByName(Name: string; Flags: TSearchFlags
     1038  ): TAcronymMeaning;
    10341039var
    10351040  I: Integer;
    10361041begin
    10371042  I := 0;
    1038   while (I < Count) and (TAcronymMeaning(Items[I]).Name <> Name) do Inc(I);
     1043  if sfCaseInsensitive in Flags then begin
     1044    while (I < Count) and (LowerCase(TAcronymMeaning(Items[I]).Name) <> LowerCase(Name)) do Inc(I);
     1045  end else begin
     1046    while (I < Count) and (TAcronymMeaning(Items[I]).Name <> Name) do Inc(I);
     1047  end;
    10391048  if I < Count then Result := TAcronymMeaning(Items[I])
    10401049    else Result := nil;
     
    11521161end;
    11531162
    1154 function TAcronyms.SearchByName(Name: string): TAcronym;
     1163function TAcronyms.SearchByName(Name: string; Flags: TSearchFlags = []): TAcronym;
    11551164var
    11561165  I: Integer;
    11571166begin
    11581167  I := 0;
    1159   while (I < Count) and (TAcronym(Items[I]).Name <> Name) do Inc(I);
     1168  if sfCaseInsensitive in Flags then begin
     1169    while (I < Count) and (LowerCase(TAcronym(Items[I]).Name) <> LowerCase(Name)) do Inc(I);
     1170  end else begin
     1171    while (I < Count) and (TAcronym(Items[I]).Name <> Name) do Inc(I);
     1172  end;
    11601173  if I < Count then Result := TAcronym(Items[I])
    11611174    else Result := nil;
     
    16841697end;
    16851698
     1699function TAcronymDb.SearchAcronym(AcronymName, MeaningName: string;
     1700  Flags: TSearchFlags = []): TAcronymMeaning;
     1701var
     1702  Acronym: TAcronym;
     1703  Meaning: TAcronymMeaning;
     1704begin
     1705  Result := nil;
     1706  Acronym := Acronyms.SearchByName(AcronymName);
     1707  if Assigned(Acronym) then begin
     1708    Meaning := Acronym.Meanings.SearchByName(MeaningName, Flags);
     1709    if Assigned(Meaning) then begin
     1710      Result := Meaning;
     1711    end;
     1712  end;
     1713end;
     1714
    16861715procedure TAcronymDb.RemoveMeaning(Meaning: TAcronymMeaning);
    16871716var
Note: See TracChangeset for help on using the changeset viewer.