Browse Source

* TXmlRegistry: When a key name starts with \ or / it means the absolute path to the key is specified. So ignore the currently selected key when an absolute key is requested.

git-svn-id: trunk@48209 -
yury 4 years ago
parent
commit
5d69ba2cd8
1 changed files with 4 additions and 0 deletions
  1. 4 0
      packages/fcl-registry/src/xmlreg.pp

+ 4 - 0
packages/fcl-registry/src/xmlreg.pp

@@ -259,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
@@ -907,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