From 9e6de7a287e28a683dcdba38d109d5031f90265f Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 1 Jun 2010 17:14:55 +0000 Subject: [PATCH] xmlcfg: fixed DeletePath git-svn-id: trunk@25817 - --- components/codetools/laz_xmlcfg.pas | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/codetools/laz_xmlcfg.pas b/components/codetools/laz_xmlcfg.pas index d86f3c3933..45696e9ef9 100644 --- a/components/codetools/laz_xmlcfg.pas +++ b/components/codetools/laz_xmlcfg.pas @@ -335,8 +335,15 @@ begin end; procedure TXMLConfig.DeletePath(const APath: string); +var + Node: TDOMNode; + ParentNode: TDOMNode; begin - InternalCleanNode(InternalFindNode(APath,length(APath))); + Node:=InternalFindNode(APath,length(APath)); + if (Node=nil) or (Node.ParentNode=nil) then exit; + ParentNode:=Node.ParentNode; + ParentNode.RemoveChild(Node); + InternalCleanNode(ParentNode); end; procedure TXMLConfig.DeleteValue(const APath: string);