fpspreadsheet: Fix rounding error in saving column widths by TsWorksheetGrid.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3629 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2014-10-03 19:34:08 +00:00
parent 912f9979e5
commit e8694bcc58

View File

@ -2638,12 +2638,12 @@ begin
if FWorksheet = nil then if FWorksheet = nil then
exit; exit;
Convert_sFont_to_Font(FWorkbook.GetFont(0), Canvas.Font); Convert_sFont_to_Font(FWorkbook.GetDefaultFont, Canvas.Font);
if IsColumn then begin if IsColumn then begin
// The grid's column width is in "pixels", the worksheet's column width is // The grid's column width is in "pixels", the worksheet's column width is
// in "characters". // in "characters".
w0 := Canvas.TextWidth('0'); w0 := Canvas.TextWidth('0');
FWorksheet.WriteColWidth(GetWorksheetCol(AIndex), ColWidths[AIndex] div w0); FWorksheet.WriteColWidth(GetWorksheetCol(AIndex), ColWidths[AIndex] / w0);
end else begin end else begin
// The grid's row heights are in "pixels", the worksheet's row heights are // The grid's row heights are in "pixels", the worksheet's row heights are
// in "lines" // in "lines"