You've already forked lazarus-ccr
fpspreadsheet: Avoid confusion of fraction detection by dates
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6085 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1499,19 +1499,29 @@ var
|
|||||||
p: Integer;
|
p: Integer;
|
||||||
s, sInt, sNum, sDenom: String;
|
s, sInt, sNum, sDenom: String;
|
||||||
i,num,denom: Integer;
|
i,num,denom: Integer;
|
||||||
|
slashCount: Integer;
|
||||||
begin
|
begin
|
||||||
Result := false;
|
Result := false;
|
||||||
s := '';
|
s := '';
|
||||||
sInt := '';
|
sInt := '';
|
||||||
sNum := '';
|
sNum := '';
|
||||||
sDenom := '';
|
sDenom := '';
|
||||||
|
slashCount := 0;
|
||||||
|
|
||||||
p := 1;
|
p := 1;
|
||||||
while p <= Length(AText) do begin
|
while p <= Length(AText) do begin
|
||||||
case AText[p] of
|
case AText[p] of
|
||||||
'0'..'9': s := s + AText[p];
|
'0'..'9': s := s + AText[p];
|
||||||
' ': begin sInt := s; s := ''; end;
|
' ': begin
|
||||||
'/': begin sNum := s; s := ''; end;
|
sInt := s;
|
||||||
|
s := '';
|
||||||
|
end;
|
||||||
|
'/': begin
|
||||||
|
sNum := s;
|
||||||
|
s := '';
|
||||||
|
inc(slashCount); // avoid confusion with dates (2017/1/1)
|
||||||
|
if slashCount > 1 then exit;
|
||||||
|
end;
|
||||||
else exit;
|
else exit;
|
||||||
end;
|
end;
|
||||||
inc(p);
|
inc(p);
|
||||||
|
Reference in New Issue
Block a user