From 04181a810d384674d30847f8817b817049730575 Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Thu, 5 Jul 2012 13:34:55 +0000 Subject: [PATCH] fpspreadsheet: Adds a work around for a internal compiler error, see bug 22370 git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2475 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/fpolebasic.pas | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/fpspreadsheet/fpolebasic.pas b/components/fpspreadsheet/fpolebasic.pas index d431137af..77a204dac 100644 --- a/components/fpspreadsheet/fpolebasic.pas +++ b/components/fpspreadsheet/fpolebasic.pas @@ -53,6 +53,7 @@ var fsOLE: TVirtualLayer_OLE; OLEStream: TStream; VLAbsolutePath: UTF8String; + tmpStream: TStream; // workaround to a compiler bug, see bug 22370 begin VLAbsolutePath:='/'+AStreamName; //Virtual layer always use absolute paths. if not AOverwriteExisting and FileExists(AFileName) then begin @@ -62,7 +63,12 @@ begin fsOLE:=TVirtualLayer_OLE.Create(RealFile); fsOLE.Format(); //Initialize and format the OLE container. OLEStream:=fsOLE.CreateStream(VLAbsolutePath,fmCreate); - AOLEDocument.Stream.Position:=0; //Ensures it is in the begining. + + // work around code for the bug 22370 + tmpStream:=AOLEDocument.Stream; + tmpStream.Position:=0; //Ensures it is in the begining. + //previous code: AOLEDocument.Stream.Position:=0; //Ensures it is in the begining. + OLEStream.CopyFrom(AOLEDocument.Stream,AOLEDocument.Stream.Size); OLEStream.Free; fsOLE.Free;