mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-03 11:40:13 +02:00
Designer: Prevent an illegal name for a component when "Ask name on create" is enabled. Issue #39292.
This commit is contained in:
parent
5a1abf733a
commit
f6b7ba2662
@ -28,7 +28,9 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, TypInfo,
|
||||
// LCL
|
||||
LCLType, Forms, Controls, Graphics, Dialogs, StdCtrls, ButtonPanel, ExtCtrls,
|
||||
LCLType, Forms, Controls, Dialogs, StdCtrls, ButtonPanel, ExtCtrls,
|
||||
// LazUtils
|
||||
LazStringUtils,
|
||||
// IdeIntf
|
||||
PropEdits,
|
||||
// IDE
|
||||
@ -171,6 +173,7 @@ begin
|
||||
NewComponent:=ANewComponent;
|
||||
OldName := NewName;
|
||||
OldText := NewText;
|
||||
NameEditChange(NameEdit);
|
||||
if ShowModal=mrOk then
|
||||
begin
|
||||
if OldName<>NewName then
|
||||
@ -279,7 +282,7 @@ begin
|
||||
ErrorMsg:=lisEmpty;
|
||||
exit;
|
||||
end;
|
||||
if not IsValidIdent(AName) then begin
|
||||
if not LazIsValidIdent(AName) then begin
|
||||
ErrorMsg:=lisNotAValidPascalIdentifier;
|
||||
exit;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user