diff --git a/components/fpspreadsheet/fpsopendocument.pas b/components/fpspreadsheet/fpsopendocument.pas index 6f5d9c48c..cb1dae72c 100755 --- a/components/fpspreadsheet/fpsopendocument.pas +++ b/components/fpspreadsheet/fpsopendocument.pas @@ -3849,7 +3849,7 @@ begin if VarType(value) = varDate then begin lCell.ContentType := cctDateTime; - lCell.DateTimeValue := StrToDate(VarToStr(value), Workbook.FormatSettings); + lCell.DateTimeValue := StrToDateTime(VarToStr(value), Workbook.FormatSettings); // was: StrToDate end else if VarIsStr(value) then begin diff --git a/components/fpspreadsheet/fpsutils.pas b/components/fpspreadsheet/fpsutils.pas index f62037e88..6e4cb1aa2 100644 --- a/components/fpspreadsheet/fpsutils.pas +++ b/components/fpspreadsheet/fpsutils.pas @@ -177,6 +177,12 @@ procedure Unused(const A1, A2, A3); { For debugging purposes } procedure DumpFontsToFile(AWorkbook: TsWorkbook; AFileName: String); +{ Needed only if FPC version is < 2.6.4 } +{$IF FPC_FULLVERSION < 020604} +function VarIsBool(const V: Variant): Boolean; +{$ENDIF} + + var {@@ Default value for the screen pixel density (pixels per inch). Is needed for conversion of distances to pixels} @@ -187,6 +193,7 @@ var implementation uses + //LCLVersion, Math, lazutf8, fpsStrings; type @@ -2754,6 +2761,13 @@ begin end; end; +{$IF FPC_FULLVERSION < 020604} +function VarIsBool(const V: Variant): Boolean; +begin + Result := (TVarData(V).vType and varTypeMask) = varboolean; +end; +{$ENDIF} + initialization InitUTF8FormatSettings; diff --git a/components/fpspreadsheet/xlsxooxml.pas b/components/fpspreadsheet/xlsxooxml.pas index 56e886fe7..949c2c1ee 100755 --- a/components/fpspreadsheet/xlsxooxml.pas +++ b/components/fpspreadsheet/xlsxooxml.pas @@ -1961,7 +1961,7 @@ begin if VarType(value) = varDate then begin lCell.ContentType := cctDateTime; - lCell.DateTimeValue := StrToDate(VarToStr(value), Workbook.FormatSettings); + lCell.DateTimeValue := StrToDateTime(VarToStr(value), Workbook.FormatSettings); // was: StrToDate end else if VarIsStr(value) then begin