From 341ac9b2d173c9d195ea108908eb844928052b3f Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 17 Aug 2004 19:41:10 +0000 Subject: [PATCH] StoredValues of property storage now works from Michael VC git-svn-id: trunk@5811 - --- lcl/inipropstorage.pas | 1 + lcl/propertystorage.pas | 7 +++++++ lcl/xmlpropstorage.pas | 1 + 3 files changed, 9 insertions(+) diff --git a/lcl/inipropstorage.pas b/lcl/inipropstorage.pas index a6791e61d6..0395d886b7 100644 --- a/lcl/inipropstorage.pas +++ b/lcl/inipropstorage.pas @@ -59,6 +59,7 @@ Type TIniPropStorage = class(TCustomIniPropStorage) Published + Property StoredValues; property IniFileName; property IniSection; property Active; diff --git a/lcl/propertystorage.pas b/lcl/propertystorage.pas index 6d4fd7e6a1..d6c0bd474f 100644 --- a/lcl/propertystorage.pas +++ b/lcl/propertystorage.pas @@ -358,6 +358,8 @@ end; constructor TStoredValues.Create(AOwner: TPersistent); begin inherited Create(AOwner, TStoredValue); + If AOwner is TCustomPropertyStorage then + FStorage:=TCustomPropertyStorage(AOwner); end; function TStoredValues.IndexOf(const AName: string): Integer; @@ -448,11 +450,14 @@ begin inherited Create(AOwner); FActive := True; FLinks := TList.Create; + FStoredValues:=TStoredValues.Create(Self); + FStoredValues.Storage:=Self; end; destructor TCustomPropertyStorage.Destroy; begin FreeStorage; + FStoredValues.Free; while FLinks.Count > 0 do RemoveLink(TPropertyStorageLink(FLinks.Last)); FreeAndNil(FLinks); @@ -521,6 +526,7 @@ begin StorageNeeded(False); Try SaveProperties; + FStoredValues.SaveVAlues; NotifyLinks(poSave); if Assigned(FOnSaveProperties) then FOnSaveProperties(Self); @@ -536,6 +542,7 @@ begin if Active then begin FSaved := False; StorageNeeded(True); + FStoredValues.RestoreValues; RestoreProperties; NotifyLinks(poRestore); FRestored:=True; diff --git a/lcl/xmlpropstorage.pas b/lcl/xmlpropstorage.pas index f41cd5ed84..932d24daa6 100644 --- a/lcl/xmlpropstorage.pas +++ b/lcl/xmlpropstorage.pas @@ -60,6 +60,7 @@ type TXMLPropStorage = class(TCustomXMLPropStorage) Published + property StoredValues; property FileName; property RootNodePath; property Active;