mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 03:59:28 +02:00
* Add TReader.SetName for Delphi compatibility
This commit is contained in:
parent
3a1f180a56
commit
7506277dc1
@ -1845,6 +1845,7 @@ type
|
||||
procedure ReadPropValue(Instance: TPersistent; PropInfo: Pointer);
|
||||
procedure PropertyError;
|
||||
procedure ReadData(Instance: TComponent);
|
||||
procedure SetName(aComponent: TComponent; aName : string); virtual;
|
||||
property PropName: rawbytestring read FPropName;
|
||||
property CanHandleExceptions: Boolean read FCanHandleExcepts;
|
||||
function CreateDriver(Stream: TStream; BufSize: Integer): TAbstractObjectReader; virtual;
|
||||
|
@ -923,6 +923,14 @@ begin
|
||||
ReadListEnd;
|
||||
end;
|
||||
|
||||
procedure TReader.SetName(aComponent: TComponent; aName : string);
|
||||
|
||||
begin
|
||||
if Assigned(FOnSetName) then
|
||||
FOnSetName(Self,aComponent,aName);
|
||||
aComponent.Name:=aName;
|
||||
end;
|
||||
|
||||
function TReader.ReadComponent(Component: TComponent): TComponent;
|
||||
var
|
||||
Flags: TFilerFlags;
|
||||
@ -1022,9 +1030,7 @@ begin
|
||||
if not (ffInherited in Flags) then
|
||||
try
|
||||
Result.SetParentComponent(Parent);
|
||||
if Assigned(FOnSetName) then
|
||||
FOnSetName(Self, Result, Name);
|
||||
Result.Name := Name;
|
||||
SetName(Result,Name);
|
||||
if FindGlobalComponent(Name) = Result then
|
||||
Include(Result.FComponentState, csInline);
|
||||
except
|
||||
|
Loading…
Reference in New Issue
Block a user