From a261ff7999d8c7d1b753b54a3a2edc4988b699b3 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 4 Aug 2018 17:31:51 +0000 Subject: [PATCH] fpspreadsheet: Fix TsWorksheet not being able to change a time cell value (see https://forum.lazarus.freepascal.org/index.php/topic,42130.msg293480) git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6569 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/source/common/fpspreadsheet.pas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/fpspreadsheet/source/common/fpspreadsheet.pas b/components/fpspreadsheet/source/common/fpspreadsheet.pas index d57ce9e0a..894d82fde 100644 --- a/components/fpspreadsheet/source/common/fpspreadsheet.pas +++ b/components/fpspreadsheet/source/common/fpspreadsheet.pas @@ -5208,15 +5208,15 @@ begin // "1" as a valid date/time. if TryStrToDateTime(AValue, number, AFormatSettings) then begin - if number < 1.0 then // this is a time alone + if (number < 1.0) or IsTimeFormat(numFmtParams) then // this is a time alone begin - if not IsTimeFormat(numFmtParams) then - begin +// if not IsTimeFormat(numFmtParams) then +// begin ucValue := Uppercase(AValue); isAMPM := (pos('AM', ucValue) > 0) or (pos('PM', ucValue) > 0); isLongTime := IsLongTimeFormat(AValue, AFormatSettings.TimeSeparator); WriteDateTime(ACell, number, TIME_FMT[isAMPM, isLongTime]); - end; +// end; end else if frac(number) = 0.0 then // this is a date alone begin