Преглед изворни кода

* fixed TRegistry.ChangeKey

git-svn-id: trunk@1818 -
florian пре 20 година
родитељ
комит
ee18b4f6ce
2 измењених фајлова са 4 додато и 2 уклоњено
  1. 1 1
      fcl/inc/registry.pp
  2. 3 1
      fcl/win32/winreg.inc

+ 1 - 1
fcl/inc/registry.pp

@@ -207,7 +207,7 @@ end;
 
 function TRegistry.GetBaseKey(Relative: Boolean): HKey;
 begin
-  If Relative Then
+  If Relative and (CurrentKey<>0) Then
     Result := CurrentKey
   else
     Result := RootKey;

+ 3 - 1
fcl/win32/winreg.inc

@@ -226,7 +226,9 @@ end;
 
 procedure TRegistry.ChangeKey(Value: HKey; const Path: String);
 begin
-
+  CloseKey;
+  FCurrentKey:=Value;
+  FCurrentPath:=Path;
 end;
 
 procedure TRegistry.GetKeyNames(Strings: TStrings);