fpspreadsheet: Fix too dense background fill of biff2 files in spreadsheet grid, now like in Excel. Read number formats from BIFF2 files (don't use 21 predefined formats any more).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4160 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2015-05-29 17:57:05 +00:00
parent 7a1caea387
commit a05a385c8d
2 changed files with 20 additions and 2 deletions

View File

@ -1380,7 +1380,7 @@ begin
begin
if Workbook.FileFormat = sfExcel2 then
begin
CreateFillPattern(FillPatternBitmap, fsGray50, clBlack, Color);
CreateFillPattern(FillPatternBitmap, fsGray12, clBlack, Color);
Canvas.Brush.Style := bsImage;
Canvas.Brush.Bitmap := FillPatternBitmap;
end else

View File

@ -298,7 +298,7 @@ end;
procedure TsSpreadBIFF2Reader.AddBuiltInNumFormats;
begin
FFirstNumFormatIndexInFile := 0;
InternalAddBuiltInNumFormats(FNumFormatList, Workbook.FormatSettings);
//InternalAddBuiltInNumFormats(FNumFormatList, Workbook.FormatSettings);
end;
procedure TsSpreadBIFF2Reader.ReadBlank(AStream: TStream);
@ -430,13 +430,31 @@ end;
{@@ ----------------------------------------------------------------------------
Reads the FORMAT record required for formatting numerical data
-------------------------------------------------------------------------------}
(*
procedure TsSpreadBIFF2Reader.ReadFORMAT(AStream: TStream);
begin
Unused(AStream);
// We ignore the formats in the file, everything is known
// (Using the formats in the file would require de-localizing them).
end;*)
procedure TsSpreadBIFF2Reader.ReadFormat(AStream: TStream);
var
len: byte;
fmtIndex: Integer;
fmtString: AnsiString;
nfs: String;
begin
// number format string
len := AStream.ReadByte;
SetLength(fmtString, len);
AStream.ReadBuffer(fmtString[1], len);
// Add to the end of the list.
nfs := ConvertEncoding(fmtString, FCodePage, encodingUTF8);
NumFormatList.Add(nfs);
end;
procedure TsSpreadBIFF2Reader.ReadFromStream(AStream: TStream);
var
BIFF2EOF: Boolean;