View Issue Details

IDProjectCategoryView StatusLast Update
0011067FPCFCLpublic2008-05-12 21:45
ReporterMartin Schreiber Assigned ToMichael Van Canneyt  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version2.3.1 
Summary0011067: Wrong ancestor value in defineproperties
DescriptionThe value of filer.ancestor is wrong in TComponent.DefineProperties.
fixes_2_2:
comp1
trunk:
ancestor
TagsNo tags attached.
Fixed in Revision10588
FPCOldBugId
FPCTarget
Attached Files

Activities

2008-03-29 22:21

 

ancestor.pas (1,360 bytes)   
program ancestor;
{$ifdef FPC}{$mode objfpc}{$h+}{$endif}
{$ifdef mswindows}{$apptype console}{$endif}
uses
 {$ifdef FPC}{$ifdef linux}cthreads,{$endif}{$endif}
 sysutils,classes;
type
 tcomp1 = class(tcomponent)
  protected
   procedure defineproperties(filer: tfiler); override;
 end;
 
 tancestor = class(tcomponent)
  private
   fcomp1: tcomp1;
  protected
   procedure getchildren(proc: tgetchildproc; root: tcomponent); override;
  published
   property comp1: tcomp1 read fcomp1 write fcomp1;
 end;
 
 tdescendent = class(tancestor)
 end;
 
{ tcomp1 }

procedure tcomp1.defineproperties(filer: tfiler);
begin
 writeln(tcomponent(filer.ancestor).name);
end;

{ tancestor }

procedure tancestor.getchildren(proc: tgetchildproc; root: tcomponent);
var
 int1: integer;
begin
 for int1:= 0 to componentcount - 1 do begin
  proc(components[int1]);
 end;
end;

var
 ancestor1: tancestor;
 descendent1: tdescendent;
 comp1: tcomp1;
 stream1: tmemorystream;
begin
 stream1:= tmemorystream.create;
 ancestor1:= tancestor.create(nil);
 ancestor1.name:= 'ancestor';
 descendent1:= tdescendent.create(nil);
 descendent1.name:= 'descendent';
 comp1:= tcomp1.create(ancestor1);
 comp1.name:= 'comp1';
 comp1:= tcomp1.create(descendent1);
 comp1.name:= 'comp1';
 stream1.writedescendent(descendent1,ancestor1);
 stream1.free; 
 ancestor1.free;
 descendent1.free;
end.

ancestor.pas (1,360 bytes)   

Michael Van Canneyt

2008-03-30 01:04

administrator   ~0018483

Fixed. I hope it doesn't break anything else.

Issue History

Date Modified Username Field Change
2008-03-29 22:21 Martin Schreiber New Issue
2008-03-29 22:21 Martin Schreiber File Added: ancestor.pas
2008-03-30 00:58 Michael Van Canneyt Status new => assigned
2008-03-30 00:58 Michael Van Canneyt Assigned To => Michael Van Canneyt
2008-03-30 01:04 Michael Van Canneyt Fixed in Revision => 10588
2008-03-30 01:04 Michael Van Canneyt Status assigned => resolved
2008-03-30 01:04 Michael Van Canneyt Resolution open => fixed
2008-03-30 01:04 Michael Van Canneyt Note Added: 0018483
2008-05-12 21:45 Martin Schreiber Status resolved => closed