From cb68f38703ee3fc90b8af1c77f66962636ab6ea7 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 4 Oct 2015 20:11:10 +0000 Subject: [PATCH] fpspreadsheet: Fix failed unit tests, all passed now again. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4370 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/fpsutils.pas | 12 ++++++------ components/fpspreadsheet/tests/errortests.pas | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/components/fpspreadsheet/fpsutils.pas b/components/fpspreadsheet/fpsutils.pas index 153cd3508..106ccbe68 100644 --- a/components/fpspreadsheet/fpsutils.pas +++ b/components/fpspreadsheet/fpsutils.pas @@ -1624,8 +1624,12 @@ begin '"': Result := Result + '"'; '''':Result := Result + '''; '%': Result := Result + '%'; - #10: if ProcessLineEndings then Result := Result + ' '; - #13: if ProcessLineEndings then Result := Result + ' '; + #10: if ProcessLineEndings then + Result := Result + ' ' else + Result := Result + #10; + #13: if ProcessLineEndings then + Result := Result + ' ' else + Result := Result + #13; { this breaks multi-line labels in xlsx #10: begin Result := Result + '
'; @@ -1636,10 +1640,6 @@ begin if (idx < Length(AText)) and (AText[idx+1] = #10) then inc(idx); end; } - { - #10: WrkStr := WrkStr + ' '; - #13: WrkStr := WrkStr + ' '; - } else Result := Result + AText[Idx]; end; diff --git a/components/fpspreadsheet/tests/errortests.pas b/components/fpspreadsheet/tests/errortests.pas index 8bcebc503..f68e3ee4c 100644 --- a/components/fpspreadsheet/tests/errortests.pas +++ b/components/fpspreadsheet/tests/errortests.pas @@ -50,11 +50,11 @@ end; procedure TSpreadErrorTests.TestWriteErrorMessages(AFormat: TsSpreadsheetFormat); type - TTestFormat = (sfExcel2, sfExcel5, sfExcel8, sfOOXML, sfOpenDocument); -const - MAX_ROW_COUNT: array[TTestFormat] of Cardinal = (65536, 65536, 65536, 1048576, 1048576); - MAX_COL_COUNT: array[TTestFormat] of Cardinal = (256, 256, 256, 16384, 1024); - MAX_CELL_LEN: array[TTestFormat] of Cardinal = (255, 255, 32767, cardinal(-1), Cardinal(-1)); + TTestFormat = (sfExcel2, sfExcel5, sfExcel8, sfExcelXML, sfOOXML, sfOpenDocument); +const // XLS2 XLS5 XLS8 XLSXML OOXML ODS + MAX_ROW_COUNT: array[TTestFormat] of Cardinal = (65536, 65536, 65536, 65536, 1048576, 1048576); + MAX_COL_COUNT: array[TTestFormat] of Cardinal = ( 256, 256, 256, 256, 16384, 1024); + MAX_CELL_LEN : array[TTestFormat] of Cardinal = ( 255, 255, 32767, 32767,$FFFFFFFF,$FFFFFFFF); var MyWorkbook: TsWorkbook; MyWorksheet: TsWorksheet;