mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 21:49:09 +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;
|
end;
|
||||||
|
|
||||||
procedure TCustomIniFile.SetOptions(AValue: TIniFileOptions);
|
procedure TCustomIniFile.SetOptions(AValue: TIniFileOptions);
|
||||||
|
|
||||||
|
Const
|
||||||
|
CreateOnlyOptions = [ifoStripComments,ifoStripInvalid];
|
||||||
begin
|
begin
|
||||||
if FOptions=AValue then Exit;
|
if FOptions=AValue then Exit;
|
||||||
|
if (Foptions*CreateOnlyOptions)<>(AValue*CreateOnlyOptions) then
|
||||||
|
Raise Exception.Create('Can only change StripComments or StripInvalid in constructor');
|
||||||
FOptions:=AValue;
|
FOptions:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user