fpspreadsheet: More general handling of conditional colors in number format strings.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4091 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2015-04-21 09:35:58 +00:00
parent 249c483503
commit c3da3fa60c
3 changed files with 6 additions and 3 deletions

View File

@ -301,6 +301,8 @@ begin
if section^.Elements[el].IntValue < 0 then
section^.Kind := section^.Kind + [nfkTimeInterval];
end;
nftColor:
section^.Kind := section^.Kind + [nfkHasColor];
end;
if FStatus <> psOK then

View File

@ -1440,9 +1440,9 @@ begin
else
if (Length(numFmt.Sections) > 2) and (lCell^.NumberValue = 0) then
sidx := 2;
if numFmt.Sections[sidx].Elements[0].Token = nftColor then
if (nfkHasColor in numFmt.Sections[sidx].Kind) then
begin
clr := numFmt.Sections[sidx].Elements[0].IntValue;
clr := numFmt.Sections[sidx].Color;
Canvas.Font.Color := Workbook.GetPaletteColor(clr);
end;
end;

View File

@ -500,7 +500,8 @@ type
TsNumFormatElements = array of TsNumFormatElement;
TsNumFormatKind = (nfkPercent, nfkExp, nfkCurrency, nfkFraction, nfkDate, nfkTime, nfkTimeInterval);
TsNumFormatKind = (nfkPercent, nfkExp, nfkCurrency, nfkFraction,
nfkDate, nfkTime, nfkTimeInterval, nfkHasColor);
TsNumFormatKinds = set of TsNumFormatKind;
TsNumFormatSection = record