mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 15:48:03 +02:00
IDE: reading environment options: omit window layouts with invalid names
git-svn-id: trunk@44070 -
This commit is contained in:
parent
e29d39b2bc
commit
a672e20451
@ -1447,7 +1447,8 @@ begin
|
||||
while i > 0 do begin
|
||||
ID := Config.GetValue(Path+'Desktop/FormIdList/a'+IntToStr(i), '');
|
||||
//debugln(['TSimpleWindowLayoutList.LoadFromConfig ',i,' ',ID]);
|
||||
if (ID <> '') and (IDEWindowCreators.SimpleLayoutStorage.ItemByFormID(ID) = nil) then
|
||||
if (ID <> '') and IsValidIdent(ID)
|
||||
and (IDEWindowCreators.SimpleLayoutStorage.ItemByFormID(ID) = nil) then
|
||||
CreateWindowLayout(ID);
|
||||
dec(i);
|
||||
end;
|
||||
@ -1678,8 +1679,10 @@ function TSimpleWindowLayoutList.CreateWindowLayout(const TheFormID: string
|
||||
begin
|
||||
if TheFormID='' then
|
||||
raise Exception.Create('TEnvironmentOptions.CreateWindowLayout TheFormID empty');
|
||||
if not IsValidIdent(TheFormID) then
|
||||
raise Exception.Create('TEnvironmentOptions.CreateWindowLayout TheFormID "'+TheFormID+'" invalid identifier');
|
||||
if ItemByFormID(TheFormID)<>nil then
|
||||
raise Exception.Create('TEnvironmentOptions.CreateWindowLayout TheFormID exists');
|
||||
raise Exception.Create('TEnvironmentOptions.CreateWindowLayout TheFormID "'+TheFormID+'" already exists');
|
||||
Result:=TSimpleWindowLayout.Create(TheFormID);
|
||||
Add(Result);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user