2
This file is part of the Free Component Library (FCL)
3
Copyright (c) 1999-2000 by the Free Pascal development team
5
See the file COPYING.FPC, included in this distribution,
6
for details about the copyright.
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
**********************************************************************}
14
{****************************************************************************}
16
{****************************************************************************}
18
procedure TPersistent.AssignError(Source: TPersistent);
20
Var SourceName : String;
24
SourceName:=Source.ClassName
27
raise EConvertError.CreateFmt (SAssignError,[SourceName,ClassName]);
32
procedure TPersistent.AssignTo(Dest: TPersistent);
36
Dest.AssignError(Self);
40
procedure TPersistent.DefineProperties(Filer: TFiler);
46
function TPersistent.GetOwner: TPersistent;
52
destructor TPersistent.Destroy;
59
procedure TPersistent.Assign(Source: TPersistent);
68
function TPersistent.GetNamePath: string;
70
Var OwnerName :String;
76
OwnerName:=GetOwner.GetNamePath;
77
If OwnerName<>'' then Result:=OwnerName+'.'+Result;
82
{****************************************************************************}
83
{* TInterfacedPersistent *}
84
{****************************************************************************}
86
procedure TInterfacedPersistent.AfterConstruction;
89
// if GetOwner<>nil then
90
// GetOwner.GetInterface(IUnknown,FOwnerInterface);
94
function TInterfacedPersistent._AddRef: Integer;stdcall;
96
if FOwnerInterface<>nil then
97
Result:=FOwnerInterface._AddRef
103
function TInterfacedPersistent._Release: Integer;stdcall;
105
if FOwnerInterface <> nil then
106
Result:=FOwnerInterface._Release
112
function TInterfacedPersistent.QueryInterface(const IID: TGUID; out Obj): HResult;stdcall;
114
if GetInterface(IID, Obj) then
117
Result:=HResult($80004002);
121
{****************************************************************************}
123
{****************************************************************************}
125
constructor TRecall.Create(AStorage,AReference: TPersistent);
129
FReference:=AReference;
134
destructor TRecall.Destroy;
136
if Assigned(FReference) then
137
FReference.Assign(FStorage);
143
procedure TRecall.Forget;
146
FreeAndNil(FStorage);
150
procedure TRecall.Store;
152
if Assigned(FReference) then
153
FStorage.Assign(FReference);