fpspreadsheet: Add wordwrap to writing of xlsx. Fix some minor issues forgotten with xlsx border and background color.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3316 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2014-07-14 07:58:45 +00:00
parent f596a181b3
commit dc1d5d038a
2 changed files with 17 additions and 6 deletions

View File

@ -70,6 +70,10 @@ begin
MyWorksheet.WriteBorderStyle(4, 4, cbSouth, lsThick, scBlue);
Myworksheet.WriteHorAlignment(4, 4, haRight);
// Wordwrap
MyWorksheet.WriteUTF8Text(4, 6, 'This is a long, long, long, wrapped text.');
MyWorksheet.WriteWordwrap(4, 6, true);
// Creates a new worksheet
MyWorksheet := MyWorkbook.AddWorksheet('My Worksheet 2');

View File

@ -510,15 +510,22 @@ begin
vaBottom: sAlign := sAlign + 'vertical="bottom" ';
end;
if (uffWordWrap in styleCell.UsedFormattingFields) then
sAlign := sAlign + 'wrapText="1" ';
{ Fill }
fillID := FindFillInList(@styleCell);
if fillID = -1 then fillID := 0;
s := s + Format('fillId="%d" ', [fillID]);
if (uffBackgroundColor in styleCell.UsedFormattingFields) then begin
fillID := FindFillInList(@styleCell);
if fillID = -1 then fillID := 0;
s := s + Format('fillId="%d" applyFill="1" ', [fillID]);
end;
{ Border }
borderID := FindBorderInList(@styleCell);
if borderID = -1 then borderID := 0;
s := s + Format('borderId="%d" ', [borderID]);
if (uffBorder in styleCell.UsedFormattingFields) then begin
borderID := FindBorderInList(@styleCell);
if borderID = -1 then borderID := 0;
s := s + Format('borderId="%d" applyBorder="1" ', [borderID]);
end;
{ Write everything to stream }
if sAlign = '' then