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;
|
||||
begin
|
||||
Result := '';
|
||||
if ASection > 2 then // ods supports only at most 3 sections
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
|
||||
if AFormatName = 'N1006' then
|
||||
ns := 1;
|
||||
|
||||
|
||||
ns := Length(FSections);
|
||||
if (ns = 0) then
|
||||
exit;
|
||||
if ns > 3 then // ods supports only at most 3 sections
|
||||
ns := 3;
|
||||
|
||||
styleMapStr := '';
|
||||
timeIntervalStr := '';
|
||||
@ -708,8 +719,10 @@ begin
|
||||
'<style:map '+
|
||||
'style:apply-style-name="' + AFormatName + 'P1" ' + // < 0
|
||||
'style:condition="value()<0" />';
|
||||
{
|
||||
else
|
||||
raise Exception.Create('At most 3 format sections allowed.');
|
||||
}
|
||||
end
|
||||
else
|
||||
AFormatName := AFormatName + 'P' + IntToStr(ASection);
|
||||
|
Reference in New Issue
Block a user