xmlcfg: fixed reading values of root node

git-svn-id: trunk@25844 -
This commit is contained in:
mattias 2010-06-02 17:26:00 +00:00
parent 6fef62de1a
commit 8ab26fb242
2 changed files with 5 additions and 2 deletions

View File

@ -509,9 +509,10 @@ begin
PathIndex:=0; PathIndex:=0;
Result:=GetPathNodeCache(PathIndex); Result:=GetPathNodeCache(PathIndex);
if Result=nil then begin if Result=nil then begin
Result := doc.DocumentElement; Result := TDOMElement(doc.FindNode('CONFIG'));
SetPathNodeCache(PathIndex,Result); SetPathNodeCache(PathIndex,Result);
end; end;
if PathLen=0 then exit;
StartPos:=1; StartPos:=1;
while (Result<>nil) do begin while (Result<>nil) do begin
EndPos:=StartPos; EndPos:=StartPos;
@ -580,6 +581,7 @@ begin
end; end;
doc:=nil; doc:=nil;
//debugln(['TXMLConfig.SetFilename ',not fDoNotLoadFromFile,' ',FileExistsCached(Filename)]);
if (not fDoNotLoadFromFile) and FileExistsCached(Filename) then if (not fDoNotLoadFromFile) and FileExistsCached(Filename) then
ReadXMLFile(doc,Filename) ReadXMLFile(doc,Filename)
else if fAutoLoadFromSource<>'' then begin else if fAutoLoadFromSource<>'' then begin
@ -601,6 +603,7 @@ begin
doc := TXMLDocument.Create; doc := TXMLDocument.Create;
cfg :=TDOMElement(doc.FindNode('CONFIG')); cfg :=TDOMElement(doc.FindNode('CONFIG'));
//debugln(['TXMLConfig.SetFilename ',DbgSName(cfg)]);
if not Assigned(cfg) then begin if not Assigned(cfg) then begin
cfg := doc.CreateElement('CONFIG'); cfg := doc.CreateElement('CONFIG');
doc.AppendChild(cfg); doc.AppendChild(cfg);

View File

@ -118,7 +118,7 @@ end;
procedure LoadIDEWindowHelp; procedure LoadIDEWindowHelp;
var var
Filename: String; Filename: String;
Config: TConfigStorage; Config: TXMLOptionsStorage;
begin begin
if IDEWindowHelpNodes=nil then if IDEWindowHelpNodes=nil then
IDEWindowHelpNodes:=TIWHelpTree.Create; IDEWindowHelpNodes:=TIWHelpTree.Create;