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
@@ -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,10 +355,10 @@ 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
end;
end;
FWorkSheet.WriteDateTime(Arow,ACol,dt); FWorkSheet.WriteDateTime(Arow,ACol,dt);
end; end;
end;
end;
{ TsSpreadOpenDocWriter } { TsSpreadOpenDocWriter }