You've already forked lazarus-ccr
fpspreadsheet: Fix conversion of string to date/time raising an exception in case of invalid date/time strings.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3577 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -3502,7 +3502,7 @@ begin
|
||||
isPercent := Pos('%', AValue) = Length(AValue);
|
||||
if isPercent then Delete(AValue, Length(AValue), 1);
|
||||
|
||||
if TryStrToFloat(AValue, number) then begin
|
||||
if TryStrToFloat(AValue, number, FWorkbook.FormatSettings) then begin
|
||||
if isPercent then
|
||||
WriteNumber(ACell, number/100, nfPercentage)
|
||||
else begin
|
||||
@ -3515,7 +3515,7 @@ begin
|
||||
exit;
|
||||
end;
|
||||
|
||||
if TryStrToDateTime(AValue, number) then begin
|
||||
if TryStrToDateTime(AValue, number, FWorkbook.FormatSettings) then begin
|
||||
if number < 1.0 then begin // this is a time alone
|
||||
if not IsTimeFormat(ACell^.NumberFormat) then begin
|
||||
ACell^.NumberFormat := nfLongTime;
|
||||
|
Reference in New Issue
Block a user