diff --git a/components/fpspreadsheet/examples/read_write/excelxmldemo/excelxmlwrite.lpr b/components/fpspreadsheet/examples/read_write/excelxmldemo/excelxmlwrite.lpr index 73984aa2e..651c68b41 100644 --- a/components/fpspreadsheet/examples/read_write/excelxmldemo/excelxmlwrite.lpr +++ b/components/fpspreadsheet/examples/read_write/excelxmldemo/excelxmlwrite.lpr @@ -1,10 +1,14 @@ -{ -excelxmlwrite.lpr +{ ------------------------------------------------------------------------------ + excelxmlwrite.lpr -Demonstrates how to write an Excel XP/2003 xml file using the fpspreadsheet library + Demonstrates how to write an Excel XP/2003 xml file using the fpspreadsheet + library -AUTHORS: Werner Pamler -} + AUTHORS: Werner Pamler + + LICENSE : For details about the license, see the file + COPYING.modifiedLGPL.txt included in the Lazarus distribution. +-------------------------------------------------------------------------------} program excelxmlwrite; {$mode delphi}{$H+} diff --git a/components/fpspreadsheet/xlsxml.pas b/components/fpspreadsheet/xlsxml.pas index d22b34d17..f0966e806 100644 --- a/components/fpspreadsheet/xlsxml.pas +++ b/components/fpspreadsheet/xlsxml.pas @@ -261,25 +261,63 @@ var c, c1, c2: Cardinal; r, r1, r2: Cardinal; cell: PCell; + rowheightStr: String; + colwidthStr: String; + defFnt: TsFont; + col: PCol; + row: PRow; + cw_fact, rh_fact: Double; begin + defFnt := FWorkbook.GetDefaultFont; + cw_fact := defFnt.Size * 0.5; // ColWidthFactor = Approx width of "0" character in pts + rh_fact := defFnt.Size; // RowHeightFactor = Height of a single line + r1 := 0; c1 := 0; r2 := AWorksheet.GetLastRowIndex; c2 := AWorksheet.GetLastColIndex; AppendToStream(AStream, TABLE_INDENT + Format( '