You've already forked lazarus-ccr
fpspreadsheet: Implement writing of text rotation for xlsx files
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3313 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -233,7 +233,7 @@ end;
|
|||||||
procedure TsSpreadOOXMLWriter.WriteStyleList(AStream: TStream; ANodeName: String);
|
procedure TsSpreadOOXMLWriter.WriteStyleList(AStream: TStream; ANodeName: String);
|
||||||
var
|
var
|
||||||
styleCell: TCell;
|
styleCell: TCell;
|
||||||
s: String;
|
s, schild: String;
|
||||||
fontID: Integer;
|
fontID: Integer;
|
||||||
numFmtId: Integer;
|
numFmtId: Integer;
|
||||||
fillId: Integer;
|
fillId: Integer;
|
||||||
@@ -244,6 +244,7 @@ begin
|
|||||||
|
|
||||||
for styleCell in FFormattingStyles do begin
|
for styleCell in FFormattingStyles do begin
|
||||||
s := '';
|
s := '';
|
||||||
|
schild := '';
|
||||||
|
|
||||||
{ Number format }
|
{ Number format }
|
||||||
numFmtId := 0;
|
numFmtId := 0;
|
||||||
@@ -260,6 +261,18 @@ begin
|
|||||||
|
|
||||||
if ANodeName = 'cellXfs' then s := s + 'xfId="0" ';
|
if ANodeName = 'cellXfs' then s := s + 'xfId="0" ';
|
||||||
|
|
||||||
|
{ Text rotation }
|
||||||
|
if (uffTextRotation in styleCell.UsedFormattingFields) or (styleCell.TextRotation <> trHorizontal)
|
||||||
|
then begin
|
||||||
|
s := s + 'applyAlignment="1" ';
|
||||||
|
schild := '<alignment textRotation="%d" />';
|
||||||
|
case styleCell.TextRotation of
|
||||||
|
rt90DegreeClockwiseRotation : sChild := Format(sChild, [180]);
|
||||||
|
rt90DegreeCounterClockwiseRotation: sChild := Format(sChild, [90]);
|
||||||
|
rtStacked : sChild := Format(sChild, [255]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ Fill }
|
{ Fill }
|
||||||
fillID := 0;
|
fillID := 0;
|
||||||
s := s + Format('fillId="%d" ', [fillID]);
|
s := s + Format('fillId="%d" ', [fillID]);
|
||||||
@@ -269,10 +282,16 @@ begin
|
|||||||
s := s + Format('borderId="%d" ', [borderID]);
|
s := s + Format('borderId="%d" ', [borderID]);
|
||||||
|
|
||||||
{ Write everything to stream }
|
{ Write everything to stream }
|
||||||
AppendToStream(AStream,
|
if schild = '' then
|
||||||
'<xf ' + s + '/>'
|
AppendToStream(AStream,
|
||||||
);
|
'<xf ' + s + '/>')
|
||||||
|
else
|
||||||
|
AppendToStream(AStream,
|
||||||
|
'<xf ' + s + '>',
|
||||||
|
sChild,
|
||||||
|
'</xf>');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AppendToStream(FSStyles, Format(
|
AppendToStream(FSStyles, Format(
|
||||||
'</%s>', [ANodeName]));
|
'</%s>', [ANodeName]));
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user