mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 05:56:16 +02:00
Converter: ChgEncodingDlg, compile regular expression right after setting it to catch exceptions. Issue #26497
git-svn-id: trunk@46030 -
This commit is contained in:
parent
9dd4d9b9c7
commit
6f59df453d
@ -98,6 +98,21 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
TabOrder = 3
|
||||
Text = 'FileFilterCombobox'
|
||||
end
|
||||
object RegExprErrorLabel: TLabel
|
||||
AnchorSideLeft.Control = RegExprCheckBox
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = RegExprCheckBox
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 167
|
||||
Height = 15
|
||||
Top = 116
|
||||
Width = 114
|
||||
BorderSpacing.Left = 27
|
||||
Caption = 'RegExprErrorLabel'
|
||||
Font.Color = clFuchsia
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
end
|
||||
object BtnPanel: TPanel
|
||||
Left = 0
|
||||
|
@ -48,6 +48,7 @@ type
|
||||
HelpButton: TBitBtn;
|
||||
BtnPanel: TPanel;
|
||||
CloseButton: TBitBtn;
|
||||
RegExprErrorLabel: TLabel;
|
||||
NewEncodingComboBox: TComboBox;
|
||||
FileFilterCombobox: TComboBox;
|
||||
NewEncodingLabel: TLabel;
|
||||
@ -275,14 +276,15 @@ begin
|
||||
ok:=false;
|
||||
try
|
||||
IncludeFilterRegExpr.Expression:=Expr;
|
||||
IncludeFilterRegExpr.Compile;
|
||||
ok:=true;
|
||||
except
|
||||
on E: Exception do begin
|
||||
DebugLn('Invalid Include File Expression ',Expr,' ',E.Message);
|
||||
MessageDlg('Error in regular expression',
|
||||
E.Message,mtError,[mbCancel],0);
|
||||
RegExprErrorLabel.Caption:=E.Message;
|
||||
end;
|
||||
end;
|
||||
RegExprErrorLabel.Visible := not ok;
|
||||
if not ok then exit;
|
||||
|
||||
NewEncoding:=NormalizeEncoding(NewEncodingComboBox.Text);
|
||||
|
@ -26,7 +26,7 @@
|
||||
***************************************************************************
|
||||
|
||||
Author: Mattias Gaertner
|
||||
|
||||
|
||||
Abstract:
|
||||
The TDiffDlg is a dialog for showing differences between two files.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user