Selaa lähdekoodia

* 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 -
yury 4 vuotta sitten
vanhempi
commit
050a342101
1 muutettua tiedostoa jossa 1 lisäystä ja 11 poistoa
  1. 1 11
      packages/fcl-registry/src/xmlreg.pp

+ 1 - 11
packages/fcl-registry/src/xmlreg.pp

@@ -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;