mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 15:59:13 +02:00
xmlcfg: fixed reading values of root node
git-svn-id: trunk@25844 -
This commit is contained in:
parent
6fef62de1a
commit
8ab26fb242
@ -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);
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user