Fixed a read bug (Stream was always created even when it has been created yet).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@793 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
Joshy
2009-05-10 17:54:26 +00:00
parent 181a1e0a98
commit 21528cb453

View File

@ -89,7 +89,11 @@ begin
fsOLE:=TVirtualLayer_OLE.Create(RealFile);
fsOLE.Initialize(); //Initialize the OLE container.
OLEStream:=fsOLE.CreateStream(VLAbsolutePath,fmOpenRead);
AOLEDocument.Stream:=TMemoryStream.Create;
if not Assigned(AOLEDocument.Stream) then begin
AOLEDocument.Stream:=TMemoryStream.Create;
end else begin
AOLEDocument.Stream.Clear;
end;
AOLEDocument.Stream.CopyFrom(OLEStream,OLEStream.Size);
OLEStream.Free;
fsOLE.Free;