fpspreadsheet: Prev commit was not good, now ok. Also: Fix fraction formats with explicit denominator (such as "#/32").

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4159 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2015-05-29 17:30:43 +00:00
parent f014686438
commit 7a1caea387
2 changed files with 5 additions and 4 deletions

View File

@ -317,6 +317,8 @@ begin
section^.FracNumerator := section^.Elements[el].IntValue; section^.FracNumerator := section^.Elements[el].IntValue;
nftFracDenomSpaceDigit, nftFracDenomZeroDigit: nftFracDenomSpaceDigit, nftFracDenomZeroDigit:
section^.FracDenominator := section^.Elements[el].IntValue; section^.FracDenominator := section^.Elements[el].IntValue;
nftFracDenom:
section^.FracDenominator := -section^.Elements[el].IntValue;
nftPercent: nftPercent:
section^.Kind := section^.Kind + [nfkPercent]; section^.Kind := section^.Kind + [nfkPercent];
nftExpChar: nftExpChar:

View File

@ -2579,15 +2579,14 @@ begin
AIndex := j; AIndex := j;
if UseThSep then if UseThSep then
begin begin
AIndex := j + 1; // AIndex := j + 1;
j := Length(Result) - 2; j := Length(Result) - 2;
while (j > 1) and (Result[j-1] <> ' ') and (Result[j] <> ' ') do while (j > 1) and (Result[j-1] <> ' ') and (Result[j] <> ' ') do
begin begin
Insert(fs.ThousandSeparator, Result, j); Insert(fs.ThousandSeparator, Result, j);
dec(j, 3); dec(j, 3);
end; end;
end else end;
AIndex := j;
end; end;
end; end;
@ -2729,7 +2728,7 @@ begin
frnum := round(AValue*frdenom); frnum := round(AValue*frdenom);
end; end;
sfrint := ProcessIntegerFormat(IntToStr(frint), fs, AElements, i, sfrint := ProcessIntegerFormat(IntToStr(frint), fs, AElements, i,
INT_TOKENS, false, (AElements[i].Token = nftIntTh)); INT_TOKENS + [nftIntTh], false, (AElements[i].Token = nftIntTh));
while (i < numEl) and (AElements[i].Token in TERMINATING_TOKENS) do while (i < numEl) and (AElements[i].Token in TERMINATING_TOKENS) do
begin begin
sintnumspace := sintnumspace + AElements[i].TextValue; sintnumspace := sintnumspace + AElements[i].TextValue;