mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 14:29:13 +02:00
parent
4143ecf6c0
commit
3d2de82656
@ -166,6 +166,7 @@ Var
|
|||||||
begin
|
begin
|
||||||
F:=TFileStream.Create(AFileName,fmOpenread or fmShareDenyWrite);
|
F:=TFileStream.Create(AFileName,fmOpenread or fmShareDenyWrite);
|
||||||
try
|
try
|
||||||
|
FFileName := '';
|
||||||
ReadXMLFile(Doc, AFilename);
|
ReadXMLFile(Doc, AFilename);
|
||||||
FFileName:=AFileName;
|
FFileName:=AFileName;
|
||||||
finally
|
finally
|
||||||
@ -402,7 +403,10 @@ begin
|
|||||||
Flush;
|
Flush;
|
||||||
FreeAndNil(Doc);
|
FreeAndNil(Doc);
|
||||||
if csLoading in ComponentState then
|
if csLoading in ComponentState then
|
||||||
|
begin
|
||||||
|
FFilename := AFilename;
|
||||||
exit;
|
exit;
|
||||||
|
end;
|
||||||
if FileExists(AFilename) and not FStartEmpty then
|
if FileExists(AFilename) and not FStartEmpty then
|
||||||
LoadFromFile(AFilename)
|
LoadFromFile(AFilename)
|
||||||
else if not Assigned(Doc) then
|
else if not Assigned(Doc) then
|
||||||
@ -425,6 +429,8 @@ begin
|
|||||||
if AValue <> FRootName then
|
if AValue <> FRootName then
|
||||||
begin
|
begin
|
||||||
FRootName := AValue;
|
FRootName := AValue;
|
||||||
|
if not (ComponentState * [csLoading,csDesigning] = []) then
|
||||||
|
Exit;
|
||||||
Root := Doc.DocumentElement;
|
Root := Doc.DocumentElement;
|
||||||
Cfg := Doc.CreateElement(AValue);
|
Cfg := Doc.CreateElement(AValue);
|
||||||
while Assigned(Root.FirstChild) do
|
while Assigned(Root.FirstChild) do
|
||||||
|
Loading…
Reference in New Issue
Block a user