From e23fbc9f1d4db285329cbe09b743d85f536e7bbb Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Mon, 30 May 2011 07:03:56 +0000 Subject: [PATCH] FPSpreadsheet: Improves the comments git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1658 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/fpsopendocument.pas | 6 ++++++ components/fpspreadsheet/xlsbiff5.pas | 18 ++++++++++-------- components/fpspreadsheet/xlsbiff8.pas | 18 ++++++++++-------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/components/fpspreadsheet/fpsopendocument.pas b/components/fpspreadsheet/fpsopendocument.pas index db1c847ca..bd440621d 100755 --- a/components/fpspreadsheet/fpsopendocument.pas +++ b/components/fpspreadsheet/fpsopendocument.pas @@ -619,6 +619,12 @@ begin } end; +{ + Writes a cell with text content + + The UTF8 Text needs to be converted, because some chars are invalid in XML + See bug with patch 19422 +} procedure TsSpreadOpenDocWriter.WriteLabel(AStream: TStream; const ARow, ACol: Word; const AValue: string; ACell: PCell); var diff --git a/components/fpspreadsheet/xlsbiff5.pas b/components/fpspreadsheet/xlsbiff5.pas index 738e944c3..04aea0b75 100755 --- a/components/fpspreadsheet/xlsbiff5.pas +++ b/components/fpspreadsheet/xlsbiff5.pas @@ -552,14 +552,16 @@ begin AStream.WriteWord(WordToLE(lCodepage)); end; -{******************************************************************* -* TsSpreadBIFF5Writer.WriteIndex () -* -* DESCRIPTION: Writes an Excel 5 DIMENSIONS record -* -* nm = (rl - rf - 1) / 32 + 1 (using integer division) -* -*******************************************************************} +{ + Writes an Excel 5 DIMENSIONS record + + nm = (rl - rf - 1) / 32 + 1 (using integer division) + + Excel, OpenOffice and FPSpreadsheet ignore the dimensions written in this record, + but some other applications really use them, so they need to be correct. + + See bug 18886: excel5 files are truncated when imported +} procedure TsSpreadBIFF5Writer.WriteDimensions(AStream: TStream; AWorksheet: TsWorksheet); var lLastCol, lLastRow: Word; diff --git a/components/fpspreadsheet/xlsbiff8.pas b/components/fpspreadsheet/xlsbiff8.pas index cb707b8eb..7631b0172 100755 --- a/components/fpspreadsheet/xlsbiff8.pas +++ b/components/fpspreadsheet/xlsbiff8.pas @@ -610,14 +610,16 @@ begin AStream.WriteBuffer(WideStringToLE(WideSheetName)[1], Len * Sizeof(WideChar)); end; -{******************************************************************* -* TsSpreadBIFF8Writer.WriteIndex () -* -* DESCRIPTION: Writes an Excel 8 DIMENSIONS record -* -* nm = (rl - rf - 1) / 32 + 1 (using integer division) -* -*******************************************************************} +{ + Writes an Excel 8 DIMENSIONS record + + nm = (rl - rf - 1) / 32 + 1 (using integer division) + + Excel, OpenOffice and FPSpreadsheet ignore the dimensions written in this record, + but some other applications really use them, so they need to be correct. + + See bug 18886: excel5 files are truncated when imported +} procedure TsSpreadBIFF8Writer.WriteDimensions(AStream: TStream; AWorksheet: TsWorksheet); var lLastCol: Word;