* Reverted r41816 to allow TXmlRegistry.DeleteKey() delete the key and all its children. It is Delphi compatible. Windows implementation of TRegistry.DeleteKey() was fixed accordingly.

git-svn-id: trunk@48208 -
This commit is contained in:
yury 2021-01-19 17:25:56 +00:00
parent ffff24593d
commit 050a342101

View File

@ -235,23 +235,13 @@ end;
Function TXmlRegistry.DeleteKey(KeyPath : UnicodeString) : Boolean;
Var
N, Curr : TDomElement;
Node: TDOMNode;
N : TDomElement;
begin
N:=FindKey(KeyPath);
Result:=(N<>Nil);
If Result then
begin
//if a key has subkeys, result shall be false and nothing shall be deleted
Curr:=N;
Node:=Curr.FirstChild;
While Assigned(Node) do
begin
If (Node.NodeType=ELEMENT_NODE) and (Node.NodeName=SKey) then
Exit(False);
Node:=Node.NextSibling;
end;
(N.ParentNode as TDomElement).RemoveChild(N);
FDirty:=True;
MaybeFlush;