fixes for fpc 2.1.1 xmlcfg

git-svn-id: trunk@7510 -
This commit is contained in:
vincents 2005-08-16 14:40:10 +00:00
parent e09bf2f62f
commit 81e58be5bc
2 changed files with 8 additions and 4 deletions

View File

@ -5639,8 +5639,9 @@ var
begin
if FileExists(FileName) then DeleteFile(FileName);
Cfg:=TXMLConfig.Create(FileName);
Cfg:=TXMLConfig.Create(nil);
Try
Cfg.FileName := FileName;
SaveContent(Cfg);
Finally
Cfg.Flush;
@ -5656,8 +5657,9 @@ begin
if not FileExists(FileName) then
raise Exception.Create(rsGridFileDoesNotExists);
Cfg:=TXMLConfig.Create(FileName);
Cfg:=TXMLConfig.Create(nil);
Try
Cfg.Filename := FileName;
Version:=cfg.GetValue('grid/version',-1);
if Version=-1 then raise Exception.Create(rsNotAValidGridFile);
BeginUpdate;

View File

@ -81,8 +81,10 @@ end;
procedure TCustomXMLPropStorage.StorageNeeded(ReadOnly: Boolean);
begin
If (FXML=Nil) then
FXML:=TPropStorageXMLConfig.Create(GetXMLFileName);
If (FXML=Nil) then begin
FXML:=TPropStorageXMLConfig.Create(nil);
FXML.FileName := GetXMLFileName;
end;
Inc(FCount);
//debugln('TCustomXMLPropStorage.StorageNeeded ',dbgsname(FXML),' ',dbgs(FXML),' FCount=',dbgs(FCount));
end;