TAChart: Fix compilation with FPC 2.5.1. Issue #18695

git-svn-id: trunk@29385 -
This commit is contained in:
ask 2011-02-05 09:47:01 +00:00
parent 4f8d7a9757
commit 4f3c1f45bb

View File

@ -402,14 +402,15 @@ end;
function TChart.Clone: TChart;
var
ms: TMemoryStream;
cloned: TComponent = nil;
begin
Result := nil;
ms := TMemoryStream.Create;
try
WriteComponentToStream(ms, Self);
ms.Seek(0, soBeginning);
ReadComponentFromBinaryStream(
ms, Result, @FindComponentClass, Owner, Parent, Owner);
ms, cloned, @FindComponentClass, Owner, Parent, Owner);
Result := cloned as TChart;
finally
ms.Free;
end;