fpspreadsheet: Implement virtual mode for all biff file formats. Add record limitations with writer-specific max row and col counts: a file is not written to a particular file format if it exceeds the limitations of the file format.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3307 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2014-07-11 13:20:14 +00:00
parent e2391c142b
commit 231b127041
10 changed files with 222 additions and 65 deletions

View File

@ -23,7 +23,8 @@ type
TOLEDocument = record
// Information about the document
Stream: TMemoryStream;
Stream: TStream;
// Stream: TMemoryStream;
end;
@ -57,7 +58,7 @@ var
begin
VLAbsolutePath:='/'+AStreamName; //Virtual layer always use absolute paths.
if not AOverwriteExisting and FileExists(AFileName) then begin
Raise EStreamError.Createfmt('File already exists "%s"',[AFileName]);
Raise EStreamError.Createfmt('File "%s" already exists.',[AFileName]);
end;
RealFile:=TFileStream.Create(AFileName,fmCreate);
fsOLE:=TVirtualLayer_OLE.Create(RealFile);
@ -101,7 +102,7 @@ begin
if not Assigned(AOLEDocument.Stream) then begin
AOLEDocument.Stream:=TMemoryStream.Create;
end else begin
AOLEDocument.Stream.Clear;
(AOLEDocument.Stream as TMemoryStream).Clear;
end;
AOLEDocument.Stream.CopyFrom(OLEStream,OLEStream.Size);
end;