* Check allowed options when setting options not in constructor

git-svn-id: trunk@33220 -
This commit is contained in:
michael 2016-03-12 09:48:20 +00:00
parent f780872069
commit e160b09468

View File

@ -543,8 +543,13 @@ begin
end;
procedure TCustomIniFile.SetOptions(AValue: TIniFileOptions);
Const
CreateOnlyOptions = [ifoStripComments,ifoStripInvalid];
begin
if FOptions=AValue then Exit;
if (Foptions*CreateOnlyOptions)<>(AValue*CreateOnlyOptions) then
Raise Exception.Create('Can only change StripComments or StripInvalid in constructor');
FOptions:=AValue;
end;