From 7f6dec9db4194792724980c2b8c1541113bb83bd Mon Sep 17 00:00:00 2001 From: yury Date: Wed, 2 May 2007 11:54:28 +0000 Subject: [PATCH] * fix: Return Default value by TRegIniFile.ReadXXX methods if requested registry value does not exist. git-svn-id: trunk@7242 - --- packages/fcl-registry/src/regini.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/fcl-registry/src/regini.inc b/packages/fcl-registry/src/regini.inc index ceb83a7c38..5a20530c72 100644 --- a/packages/fcl-registry/src/regini.inc +++ b/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;