mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:29:27 +02:00
* Check allowed options when setting options not in constructor
git-svn-id: trunk@33220 -
This commit is contained in:
parent
f780872069
commit
e160b09468
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user