Browse Source

* fix: Return Default value by TRegIniFile.ReadXXX methods if requested registry value does not exist.

git-svn-id: trunk@7242 -
yury 18 năm trước cách đây
mục cha
commit
7f6dec9db4
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 6 3
      packages/fcl-registry/src/regini.inc

+ 6 - 3
packages/fcl-registry/src/regini.inc

@@ -104,7 +104,8 @@ begin
 	Result := Default;
 	if not OpenKey(fPath+Section,false) then Exit;
 	try
-  	Result := inherited ReadBool(Ident);
+    if ValueExists(Ident) then
+	    Result := inherited ReadBool(Ident);
 	finally
 	  CloseKey;
 	end;
@@ -115,7 +116,8 @@ begin
   Result := Default;
   if not OpenKey(fPath+Section,false) then Exit;
   try
-    Result := inherited ReadInteger(Ident);
+    if ValueExists(Ident) then
+      Result := inherited ReadInteger(Ident);
   finally
     CloseKey;
   end;
@@ -126,7 +128,8 @@ begin
   Result := Default;
   if not OpenKey(fPath+Section,false) then Exit;
   try
-    Result := inherited ReadString(Ident);
+    if ValueExists(Ident) then
+      Result := inherited ReadString(Ident);
   finally
     CloseKey;
   end;