[Lazarus] TLazIntfImage.Assign ?

LacaK lacak at zoznam.sk
Wed Sep 28 07:39:08 CEST 2016


Hi,

Please look at implementation :

procedure TLazIntfImage.Assign(Source: TPersistent);
var
   Src: TLazIntfImage;
   Desc: TRawImageDescription;
begin
   if Source is TLazIntfImage then begin
       Src:=TLazIntfImage(Source);
       Desc:=Src.DataDescription;
       Desc.Width:=0; // avoid side effects
       Desc.Height:=0; // avoid side effects
       DataDescription:=Src.DataDescription;
   end;
   inherited Assign(Source);
end;

Why we set Desc.Width and Height to 0 and later we do not use "Desc" , 
but "Src.DataDescription" ?

-Laco.



More information about the Lazarus mailing list