From: <ah...@us...> - 2013-05-25 15:49:09
|
Revision: 13527 http://jvcl.svn.sourceforge.net/jvcl/?rev=13527&view=rev Author: ahuser Date: 2013-05-25 15:48:59 +0000 (Sat, 25 May 2013) Log Message: ----------- Mantis 5969: Reading a readonly property raises an exception Modified Paths: -------------- trunk/jvcl/run/JvPropertyStorage.pas Modified: trunk/jvcl/run/JvPropertyStorage.pas =================================================================== --- trunk/jvcl/run/JvPropertyStorage.pas 2013-05-25 14:32:24 UTC (rev 13526) +++ trunk/jvcl/run/JvPropertyStorage.pas 2013-05-25 15:48:59 UTC (rev 13527) @@ -266,8 +266,8 @@ procedure TJvPropertyStorage.LoadAnyProperty(PropInfo: PPropInfo); begin try - if PropInfo <> nil then - ReadProperty (AppStoragePath, GetItemName(PropInfo.Name), TPersistent(FObject), PropInfo.Name); + if (PropInfo <> nil) and (PropInfo.SetProc <> nil) then + ReadProperty(AppStoragePath, GetItemName(PropInfo.Name), TPersistent(FObject), PropInfo.Name); except { ignore any exception } end; @@ -275,8 +275,8 @@ procedure TJvPropertyStorage.StoreAnyProperty(PropInfo: PPropInfo); begin - if PropInfo <> nil then - WriteProperty (AppStoragePath, GetItemName(PropInfo.Name), TPersistent(FObject), PropInfo.Name); + if (PropInfo <> nil) and (PropInfo.SetProc <> nil) then // write only if we can load it again + WriteProperty(AppStoragePath, GetItemName(PropInfo.Name), TPersistent(FObject), PropInfo.Name); end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |