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

View File

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