You've already forked lazarus-ccr
fpspreadsheet: Put conditional font handling in place for XLSX writer. Commented out, however, because Excel refuses to load such files (although syntactially correct).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7564 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -6249,10 +6249,33 @@ procedure TsSpreadOOXMLWriter.WriteDifferentialFormat(AStream: TStream;
|
|||||||
|
|
||||||
var
|
var
|
||||||
pt, bc, fc, diag: string;
|
pt, bc, fc, diag: string;
|
||||||
|
font: TsFont;
|
||||||
begin
|
begin
|
||||||
AppendToStream(AStream,
|
AppendToStream(AStream,
|
||||||
'<dxf>');
|
'<dxf>');
|
||||||
|
|
||||||
|
{ font }
|
||||||
|
// TODO: Fix font handling: although correct in syntax something seems to be missing...
|
||||||
|
{
|
||||||
|
if (uffFont in AFormat^.UsedFormattingFields) then
|
||||||
|
begin
|
||||||
|
font := TsWorkbook(FWorkbook).GetFont(AFormat^.FontIndex);
|
||||||
|
if font <> nil then
|
||||||
|
begin
|
||||||
|
AppendToStream(AStream, '<font>');
|
||||||
|
if font.Color <> scNotDefined then
|
||||||
|
AppendToStream(AStream, Format('<color rgb="%s" />', [fc] ));
|
||||||
|
if fssBold in font.Style then
|
||||||
|
AppendToStream(AStream, '<b />');
|
||||||
|
if fssItalic in font.Style then
|
||||||
|
AppendToStream(AStream, '<i />');
|
||||||
|
if fssStrikeout in font.Style then
|
||||||
|
AppendToStream(AStream, '<strike />');
|
||||||
|
// Font name, font size, and style underline not supported
|
||||||
|
AppendToStream(AStream, '</font>');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
}
|
||||||
{ background fill }
|
{ background fill }
|
||||||
if (uffBackground in AFormat^.UsedFormattingFields) then
|
if (uffBackground in AFormat^.UsedFormattingFields) then
|
||||||
begin
|
begin
|
||||||
@ -6291,26 +6314,6 @@ begin
|
|||||||
WriteBorderStyle(AStream, AFormat, cbDiagUp, 'diagonal');
|
WriteBorderStyle(AStream, AFormat, cbDiagUp, 'diagonal');
|
||||||
AppendToStream(AStream,
|
AppendToStream(AStream,
|
||||||
'</border>');
|
'</border>');
|
||||||
|
|
||||||
// TODO: Fix font handling: although correct in syntax something seems to be missing...
|
|
||||||
{ font }
|
|
||||||
{
|
|
||||||
font := TsWorkbook(FWorkbook).GetFont(AFormat^.FontIndex);
|
|
||||||
if font <> nil then
|
|
||||||
begin
|
|
||||||
fc := ColorToHTMLColorStr(font.Color, true);
|
|
||||||
AppendToStream(AStream, '<font>');
|
|
||||||
AppendToStream(AStream, Format('<color rgb="%s" />', [fc] ));
|
|
||||||
if fssBold in font.Style then
|
|
||||||
AppendToStream(AStream, '<b />');
|
|
||||||
if fssItalic in font.Style then
|
|
||||||
AppendToStream(AStream, '<i />');
|
|
||||||
if fssStrikeout in font.Style then
|
|
||||||
AppendToStream(AStream, '<strike />');
|
|
||||||
// Font name, font size, and style underline not supported
|
|
||||||
AppendToStream(AStream, '</font>');
|
|
||||||
end;
|
|
||||||
}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AppendToStream(AStream,
|
AppendToStream(AStream,
|
||||||
|
Reference in New Issue
Block a user