diff options
Diffstat (limited to 'avx512-0037785/packages/fcl-registry/src/xmlreg.pp')
-rw-r--r-- | avx512-0037785/packages/fcl-registry/src/xmlreg.pp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/avx512-0037785/packages/fcl-registry/src/xmlreg.pp b/avx512-0037785/packages/fcl-registry/src/xmlreg.pp index 7b661e5922..961c599878 100644 --- a/avx512-0037785/packages/fcl-registry/src/xmlreg.pp +++ b/avx512-0037785/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; @@ -269,6 +259,8 @@ begin Result:=(Length(KeyPath)>0); If Not Result then Exit; + If (KeyPath[1] in ['/','\']) then + FCurrentElement:=Nil; KeyPath:=NormalizeKey(KeyPath); If (FCurrentElement<>nil) then begin @@ -917,6 +909,8 @@ begin Result:=Nil; If (Length(S)=0) then Exit; + if S[1] in ['/','\'] then + FCurrentElement:=nil; S:=NormalizeKey(S); If (FCurrentElement<>nil) then begin |