Ignore:
Timestamp:
Jul 2, 2023, 11:07:39 PM (11 months ago)
Author:
chronos
Message:
  • Fixed: Show only supported import formats.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Table.pas

    r169 r170  
    99  TTableFormat = (tfExcel, tfPlain, tfCsv, tfHtml, tfListView, tfMediaWiki,
    1010    tfXml, tfJson);
     11  TTableFormats = set of TTableFormat;
    1112
    1213  { TRow }
     
    4243    procedure GetOutputListView(ListView: TListView);
    4344    function GetOutput(OutputFormat: TTableFormat): string;
    44     procedure SetInputTabs(Text: string);
    45     procedure SetInputPlain(Text: string);
    4645    procedure SetInputCsv(Text: string);
    47     procedure SetInputXml(Text: string);
    48     procedure SetInputHtml(Text: string);
    4946    procedure SetInputMediaWiki(Text: string);
    5047    procedure SetInputJson(Text: string);
    5148    procedure SetInput(OutputFormat: TTableFormat; Text: string);
     49    function GetInputFormats: TTableFormats;
    5250    constructor Create;
    5351    destructor Destroy; override;
     
    303301    else raise Exception.Create(SUnsupportedFormat);
    304302  end;
    305 end;
    306 
    307 procedure TTable.SetInputTabs(Text: string);
    308 begin
    309 
    310 end;
    311 
    312 procedure TTable.SetInputPlain(Text: string);
    313 begin
    314 
    315303end;
    316304
     
    339327    FreeAndNil(Lines);
    340328  end;
    341 end;
    342 
    343 procedure TTable.SetInputXml(Text: string);
    344 begin
    345 
    346 end;
    347 
    348 procedure TTable.SetInputHtml(Text: string);
    349 begin
    350 
    351329end;
    352330
     
    482460begin
    483461  case OutputFormat of
    484     tfExcel: SetInputTabs(Text);
    485     tfPlain: SetInputPlain(Text);
    486462    tfCsv: SetInputCsv(Text);
    487     tfHtml: SetInputHtml(Text);
    488463    tfMediaWiki: SetInputMediaWiki(Text);
    489     tfXml: SetInputXml(Text);
    490464    tfJson: SetInputJson(Text);
    491465    else raise Exception.Create(SUnsupportedFormat);
    492466  end;
     467end;
     468
     469function TTable.GetInputFormats: TTableFormats;
     470begin
     471  Result := [tfCsv, tfJson, tfMediaWiki];
    493472end;
    494473
Note: See TracChangeset for help on using the changeset viewer.