From 21528cb453f6409a00d2bcb827d66bd0b885cbae Mon Sep 17 00:00:00 2001 From: Joshy Date: Sun, 10 May 2009 17:54:26 +0000 Subject: [PATCH] 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 --- components/fpspreadsheet/fpolebasic.pas | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/fpspreadsheet/fpolebasic.pas b/components/fpspreadsheet/fpolebasic.pas index a8c821eed..37dfb2f0e 100644 --- a/components/fpspreadsheet/fpolebasic.pas +++ b/components/fpspreadsheet/fpolebasic.pas @@ -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;