mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 19:29:26 +02:00
* 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:
parent
ffff24593d
commit
050a342101
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user