You've already forked lazarus-ccr
fpspreadsheet: Fix ods writer crashing if number format has more than three sections.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6034 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -684,10 +684,21 @@ var
|
|||||||
int,num,denom: Integer;
|
int,num,denom: Integer;
|
||||||
begin
|
begin
|
||||||
Result := '';
|
Result := '';
|
||||||
|
if ASection > 2 then // ods supports only at most 3 sections
|
||||||
|
exit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if AFormatName = 'N1006' then
|
||||||
|
ns := 1;
|
||||||
|
|
||||||
|
|
||||||
ns := Length(FSections);
|
ns := Length(FSections);
|
||||||
if (ns = 0) then
|
if (ns = 0) then
|
||||||
exit;
|
exit;
|
||||||
|
if ns > 3 then // ods supports only at most 3 sections
|
||||||
|
ns := 3;
|
||||||
|
|
||||||
styleMapStr := '';
|
styleMapStr := '';
|
||||||
timeIntervalStr := '';
|
timeIntervalStr := '';
|
||||||
@ -708,8 +719,10 @@ begin
|
|||||||
'<style:map '+
|
'<style:map '+
|
||||||
'style:apply-style-name="' + AFormatName + 'P1" ' + // < 0
|
'style:apply-style-name="' + AFormatName + 'P1" ' + // < 0
|
||||||
'style:condition="value()<0" />';
|
'style:condition="value()<0" />';
|
||||||
|
{
|
||||||
else
|
else
|
||||||
raise Exception.Create('At most 3 format sections allowed.');
|
raise Exception.Create('At most 3 format sections allowed.');
|
||||||
|
}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
AFormatName := AFormatName + 'P' + IntToStr(ASection);
|
AFormatName := AFormatName + 'P' + IntToStr(ASection);
|
||||||
|
Reference in New Issue
Block a user