OpenDocument .ods:

* ignore invalid times



git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2915 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
bigchimp
2014-03-24 07:34:00 +00:00
parent 7ae183a111
commit cc13dd5c5f

View File

@ -223,7 +223,6 @@ begin
// select this cell value's type // select this cell value's type
ParamValueType:=GetAttrValue(CellNode,'office:value-type'); ParamValueType:=GetAttrValue(CellNode,'office:value-type');
ParamFormula:=GetAttrValue(CellNode,'table:formula'); ParamFormula:=GetAttrValue(CellNode,'table:formula');
// Speed optimization: only read cells that may have contents; // Speed optimization: only read cells that may have contents;
// leave rest empty. Update if we support more cell types // leave rest empty. Update if we support more cell types
if (ParamValueType='string') or if (ParamValueType='string') or
@ -294,7 +293,7 @@ end;
procedure TsSpreadOpenDocReader.ReadDate(ARow: Word; ACol : Word; ACellNode : TDOMNode); procedure TsSpreadOpenDocReader.ReadDate(ARow: Word; ACol : Word; ACellNode : TDOMNode);
var var
dt:TDateTime; dt: TDateTime;
Value: String; Value: String;
Fmt : TFormatSettings; Fmt : TFormatSettings;
FoundPos : integer; FoundPos : integer;
@ -319,6 +318,7 @@ begin
Value:=Copy(Value,1,FoundPos-1); Value:=Copy(Value,1,FoundPos-1);
end; end;
dt:=StrToDateTime(Value,Fmt); dt:=StrToDateTime(Value,Fmt);
FWorkSheet.WriteDateTime(Arow,ACol,dt);
end end
else else
begin begin
@ -355,9 +355,9 @@ begin
Minutes*(SecsPerMin)+ Minutes*(SecsPerMin)+
Seconds Seconds
); //todo: detect actually used date mode based on file settings; see xls code ); //todo: detect actually used date mode based on file settings; see xls code
FWorkSheet.WriteDateTime(Arow,ACol,dt);
end; end;
end; end;
FWorkSheet.WriteDateTime(Arow,ACol,dt);
end; end;
{ TsSpreadOpenDocWriter } { TsSpreadOpenDocWriter }