You've already forked lazarus-ccr
fpspreadsheet: Fix xlsx writing column widths
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4238 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -2419,9 +2419,12 @@ procedure TsSpreadOOXMLWriter.WriteCols(AStream: TStream; AWorksheet: TsWorkshee
|
||||
var
|
||||
col: PCol;
|
||||
c: Integer;
|
||||
w: Single;
|
||||
begin
|
||||
{
|
||||
if AWorksheet.Cols.Count = 0 then
|
||||
exit;
|
||||
}
|
||||
|
||||
AppendToStream(AStream,
|
||||
'<cols>');
|
||||
@ -2429,10 +2432,13 @@ begin
|
||||
for c:=0 to AWorksheet.GetLastColIndex do begin
|
||||
col := AWorksheet.FindCol(c);
|
||||
if col <> nil then
|
||||
AppendToStream(AStream, Format(
|
||||
'<col min="%d" max="%d" width="%g" customWidth="1" />',
|
||||
[c+1, c+1, col^.Width], FPointSeparatorSettings)
|
||||
);
|
||||
w := col^.Width
|
||||
else
|
||||
w := AWorksheet.DefaultColWidth;
|
||||
AppendToStream(AStream, Format(
|
||||
'<col min="%d" max="%d" width="%g" customWidth="1" />',
|
||||
[c+1, c+1, w], FPointSeparatorSettings)
|
||||
);
|
||||
end;
|
||||
|
||||
AppendToStream(AStream,
|
||||
|
Reference in New Issue
Block a user