fpspreadsheet: Combine percentage format detection with other number formats (for ods)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3140 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2014-06-05 07:58:18 +00:00
parent 0aeefd619f
commit bac68e48c5

View File

@ -1020,6 +1020,9 @@ procedure TsSpreadOpenDocReader.ReadNumFormats(AStylesNode: TDOMNode);
if node <> nil then
ReadStyleMap(node, nf, fmt);
if ANumFormatNode.NodeName = 'number:percentage-style' then
nf := nfPercentage;
NumFormatList.AddFormat(ANumFormatName, fmt, nf, decs);
end;
@ -1215,14 +1218,12 @@ begin
numfmtName := GetAttrValue(NumFormatNode, 'style:name') else
numfmtName := '';
// Numbers (nfFixed, nfFixedTh, nfExp)
if numfmt_nodename = 'number:number-style' then
// Numbers (nfFixed, nfFixedTh, nfExp, nfPercentage)
if (numfmt_nodename = 'number:number-style') or
(numfmt_nodename = 'number:percentage-style')
then
ReadNumberStyle(NumFormatNode, numfmtName);
// Percentage
if numfmt_nodename = 'number:percentage-style' then
ReadPercentageStyle(NumFormatNode, numfmtName);
// Date/time values
if (numfmt_nodename = 'number:date-style') or (numfmt_nodename = 'number:time-style') then
ReadDateTimeStyle(NumFormatNode, numfmtName);