From ed409c445a7a009f06f968416332b04fbd6584a8 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Wed, 23 Jul 2014 16:00:01 +0000 Subject: [PATCH] Fix using correct locale settings in Ubuntu. Workaround for crash of test suite in Ubuntu due to not deleting existing xls file. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3365 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/examples/fpsgrid/fpsgrid.lpi | 9 +++++++++ components/fpspreadsheet/fpspreadsheet.pas | 5 ++++- components/fpspreadsheet/tests/manualtests.pas | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/components/fpspreadsheet/examples/fpsgrid/fpsgrid.lpi b/components/fpspreadsheet/examples/fpsgrid/fpsgrid.lpi index 4d68f00d8..ffd561731 100644 --- a/components/fpspreadsheet/examples/fpsgrid/fpsgrid.lpi +++ b/components/fpspreadsheet/examples/fpsgrid/fpsgrid.lpi @@ -48,6 +48,9 @@ + + + @@ -79,6 +82,9 @@ + + + @@ -138,6 +144,9 @@ + + + diff --git a/components/fpspreadsheet/fpspreadsheet.pas b/components/fpspreadsheet/fpspreadsheet.pas index bd49d9099..e0fdca383 100755 --- a/components/fpspreadsheet/fpspreadsheet.pas +++ b/components/fpspreadsheet/fpspreadsheet.pas @@ -707,7 +707,7 @@ type @param boBufStream When this option is set a buffered stream is used for writing (a memory stream swapping to disk) or reading (a file stream pre-reading chunks of data - to memory) } + to memory) } TsWorkbookOption = (boVirtualMode, boBufStream); {@@ @@ -1094,6 +1094,9 @@ procedure InitCell(var ACell: TCell); implementation uses + {$IFDEF UNIX} + clocale, + {$ENDIF} Math, StrUtils, TypInfo, fpsStreams, fpsUtils, fpsNumFormatParser, fpsFunc; { Translatable strings } diff --git a/components/fpspreadsheet/tests/manualtests.pas b/components/fpspreadsheet/tests/manualtests.pas index 8374907c9..bbc513e49 100644 --- a/components/fpspreadsheet/tests/manualtests.pas +++ b/components/fpspreadsheet/tests/manualtests.pas @@ -151,6 +151,10 @@ end; procedure TSpreadManualSetup.OneTimeTearDown; begin if Workbook <> nil then begin + // In Ubuntu explicit deletion of the existing file is needed. + // Otherwise an error would occur and a defective file would be written } + if FileExists(TestFileManual) then DeleteFile(TestFileManual); + Workbook.WriteToFile(TestFileManual, OUTPUT_FORMAT, TRUE); Workbook.Free; Workbook := nil;