From cc13dd5c5f8c9bfe455888d443c2b00da0ecaf78 Mon Sep 17 00:00:00 2001 From: bigchimp Date: Mon, 24 Mar 2014 07:34:00 +0000 Subject: [PATCH] OpenDocument .ods: * ignore invalid times git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2915 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/fpsopendocument.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/fpspreadsheet/fpsopendocument.pas b/components/fpspreadsheet/fpsopendocument.pas index 768fdb47a..34a67b508 100755 --- a/components/fpspreadsheet/fpsopendocument.pas +++ b/components/fpspreadsheet/fpsopendocument.pas @@ -223,7 +223,6 @@ begin // select this cell value's type ParamValueType:=GetAttrValue(CellNode,'office:value-type'); ParamFormula:=GetAttrValue(CellNode,'table:formula'); - // Speed optimization: only read cells that may have contents; // leave rest empty. Update if we support more cell types if (ParamValueType='string') or @@ -294,7 +293,7 @@ end; procedure TsSpreadOpenDocReader.ReadDate(ARow: Word; ACol : Word; ACellNode : TDOMNode); var - dt:TDateTime; + dt: TDateTime; Value: String; Fmt : TFormatSettings; FoundPos : integer; @@ -319,6 +318,7 @@ begin Value:=Copy(Value,1,FoundPos-1); end; dt:=StrToDateTime(Value,Fmt); + FWorkSheet.WriteDateTime(Arow,ACol,dt); end else begin @@ -355,9 +355,9 @@ begin Minutes*(SecsPerMin)+ Seconds ); //todo: detect actually used date mode based on file settings; see xls code + FWorkSheet.WriteDateTime(Arow,ACol,dt); end; end; - FWorkSheet.WriteDateTime(Arow,ACol,dt); end; { TsSpreadOpenDocWriter }