fpspreadsheet: Fix compilation of fpspreadsheet packages back to Laz 1.2.0 / fpc 2.6.2 (Note: some "ignored" unit tests do produce a failure).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3876 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2015-01-08 12:14:59 +00:00
parent 3ea51f22b2
commit bf61320db8
3 changed files with 16 additions and 2 deletions

View File

@ -3849,7 +3849,7 @@ begin
if VarType(value) = varDate then if VarType(value) = varDate then
begin begin
lCell.ContentType := cctDateTime; lCell.ContentType := cctDateTime;
lCell.DateTimeValue := StrToDate(VarToStr(value), Workbook.FormatSettings); lCell.DateTimeValue := StrToDateTime(VarToStr(value), Workbook.FormatSettings); // was: StrToDate
end else end else
if VarIsStr(value) then if VarIsStr(value) then
begin begin

View File

@ -177,6 +177,12 @@ procedure Unused(const A1, A2, A3);
{ For debugging purposes } { For debugging purposes }
procedure DumpFontsToFile(AWorkbook: TsWorkbook; AFileName: String); 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 var
{@@ Default value for the screen pixel density (pixels per inch). Is needed {@@ Default value for the screen pixel density (pixels per inch). Is needed
for conversion of distances to pixels} for conversion of distances to pixels}
@ -187,6 +193,7 @@ var
implementation implementation
uses uses
//LCLVersion,
Math, lazutf8, fpsStrings; Math, lazutf8, fpsStrings;
type type
@ -2754,6 +2761,13 @@ begin
end; end;
end; end;
{$IF FPC_FULLVERSION < 020604}
function VarIsBool(const V: Variant): Boolean;
begin
Result := (TVarData(V).vType and varTypeMask) = varboolean;
end;
{$ENDIF}
initialization initialization
InitUTF8FormatSettings; InitUTF8FormatSettings;

View File

@ -1961,7 +1961,7 @@ begin
if VarType(value) = varDate then if VarType(value) = varDate then
begin begin
lCell.ContentType := cctDateTime; lCell.ContentType := cctDateTime;
lCell.DateTimeValue := StrToDate(VarToStr(value), Workbook.FormatSettings); lCell.DateTimeValue := StrToDateTime(VarToStr(value), Workbook.FormatSettings); // was: StrToDate
end else end else
if VarIsStr(value) then if VarIsStr(value) then
begin begin