mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-25 12:29:25 +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 ReadPropValue(Instance: TPersistent; PropInfo: Pointer);
|
||||||
procedure PropertyError;
|
procedure PropertyError;
|
||||||
procedure ReadData(Instance: TComponent);
|
procedure ReadData(Instance: TComponent);
|
||||||
|
procedure SetName(aComponent: TComponent; aName : string); virtual;
|
||||||
property PropName: rawbytestring read FPropName;
|
property PropName: rawbytestring read FPropName;
|
||||||
property CanHandleExceptions: Boolean read FCanHandleExcepts;
|
property CanHandleExceptions: Boolean read FCanHandleExcepts;
|
||||||
function CreateDriver(Stream: TStream; BufSize: Integer): TAbstractObjectReader; virtual;
|
function CreateDriver(Stream: TStream; BufSize: Integer): TAbstractObjectReader; virtual;
|
||||||
|
@ -923,6 +923,14 @@ begin
|
|||||||
ReadListEnd;
|
ReadListEnd;
|
||||||
end;
|
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;
|
function TReader.ReadComponent(Component: TComponent): TComponent;
|
||||||
var
|
var
|
||||||
Flags: TFilerFlags;
|
Flags: TFilerFlags;
|
||||||
@ -1022,9 +1030,7 @@ begin
|
|||||||
if not (ffInherited in Flags) then
|
if not (ffInherited in Flags) then
|
||||||
try
|
try
|
||||||
Result.SetParentComponent(Parent);
|
Result.SetParentComponent(Parent);
|
||||||
if Assigned(FOnSetName) then
|
SetName(Result,Name);
|
||||||
FOnSetName(Self, Result, Name);
|
|
||||||
Result.Name := Name;
|
|
||||||
if FindGlobalComponent(Name) = Result then
|
if FindGlobalComponent(Name) = Result then
|
||||||
Include(Result.FComponentState, csInline);
|
Include(Result.FComponentState, csInline);
|
||||||
except
|
except
|
||||||
|
Loading…
Reference in New Issue
Block a user