fpspreadsheet: Major reconstructor of color management: no more palettes now, use direct rgb colors instead. May break existing code - sorry! Update all demos and unit tests (passed).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4156 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2015-05-28 20:08:24 +00:00
parent 46386a0f37
commit 545bd7ed0f
33 changed files with 1696 additions and 1025 deletions

View File

@@ -10,7 +10,7 @@ program excel5write;
{$mode delphi}{$H+}
uses
Classes, SysUtils, fpsTypes, fpspreadsheet, xlsbiff5;
Classes, SysUtils, fpsTypes, fpSpreadsheet, fpsPalette, fpsUtils, xlsbiff5;
const
Str_First = 'First';
@@ -28,6 +28,7 @@ var
i, r: Integer;
number: Double;
fmt: string;
palette: TsPalette;
begin
MyDir := ExtractFilePath(ParamStr(0));
@@ -359,10 +360,16 @@ begin
// Creates a new worksheet
MyWorksheet := MyWorkbook.AddWorksheet('Colors');
for i:=0 to MyWorkbook.GetPaletteSize-1 do begin
MyWorksheet.WriteBlank(i, 0);
Myworksheet.WriteBackgroundColor(i, 0, TsColor(i));
MyWorksheet.WriteUTF8Text(i, 1, MyWorkbook.GetColorName(i));
palette := TsPalette.Create;
try
palette.UseColors(PALETTE_BIFF5); // This stores the colors of BIFF5 files in the local palette
for i:=0 to palette.Count-1 do begin
MyWorksheet.WriteBlank(i, 0);
Myworksheet.WriteBackgroundColor(i, 0, palette[i]);
MyWorksheet.WriteUTF8Text(i, 1, GetColorName(palette[i]));
end;
finally
palette.Free;
end;
// Save the spreadsheet to a file