Changeset 172 for trunk/Forms


Ignore:
Timestamp:
Jun 14, 2024, 9:41:40 PM (7 months ago)
Author:
chronos
Message:
  • Fixed: Avoid error in case of invalid import data.
  • Modified: Updated Common package.
Location:
trunk/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormImport.lfm

    r168 r172  
    1212  OnDestroy = FormDestroy
    1313  OnShow = FormShow
    14   LCLVersion = '2.2.6.0'
     14  LCLVersion = '3.0.0.3'
    1515  object ButtonCancel: TButton
    1616    Left = 578
     
    3232    Caption = 'Import'
    3333    ModalResult = 1
    34     OnClick = ButtonImportClick
    3534    ParentFont = False
    3635    TabOrder = 1
     36    OnClick = ButtonImportClick
    3737  end
    3838  object ScrollBox1: TScrollBox
     
    6161      Width = 225
    6262      ItemHeight = 0
    63       OnChange = ComboBoxInputFormatChange
    6463      ReadOnly = True
    6564      Style = csDropDownList
    6665      TabOrder = 0
     66      OnChange = ComboBoxInputFormatChange
    6767    end
    6868    object Label2: TLabel
     
    8080      Width = 464
    8181      Anchors = [akTop, akLeft, akRight]
     82      TabOrder = 1
    8283      OnChange = EditInputFileChange
    83       TabOrder = 1
    8484    end
    8585    object ButtonBrowse: TButton
     
    9090      Anchors = [akTop, akRight]
    9191      Caption = 'Browse'
     92      TabOrder = 2
    9293      OnClick = ButtonBrowseClick
    93       TabOrder = 2
    9494    end
    9595    object ListView1: TListView
  • trunk/Forms/FormImport.pas

    r170 r172  
    136136  if not FileExists(EditInputFile.Text) then Exit;
    137137
    138   Table.SetInput(TableFormat, LoadFileToStr(EditInputFile.Text));
    139   Table.Title := ExtractFileNameWithoutExt(EditInputFile.Text);
     138  try
     139    Table.SetInput(TableFormat, LoadFileToStr(EditInputFile.Text));
     140    Table.Title := ExtractFileNameWithoutExt(EditInputFile.Text);
     141  except
     142    // It may fail due to invalid format
     143  end;
    140144end;
    141145
Note: See TracChangeset for help on using the changeset viewer.