incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis E. Hamilton" <dennis.hamil...@acm.org>
Subject RE: [Call-for-​​Review][C​alc]Last argument of formula should not be removed
Date Thu, 14 Jun 2012 05:22:12 GMT
Thanks for the patch, Zhang Lu,

I believe you are correct although there is an ambiguity.

I checked the OpenFormula specification, and it definitely allows empty parameter slots in
parameter lists, including at the beginning and the end.   (I think there is a bug in the
empty first-position case in OpenFormula.)

Empty parameter positions are not allowed only if there is a restriction on a particular function.
 AVERAGEA has no such restriction, although there must be at least one value provided.  It
is not clear whether an empty parameter position counts as an empty cell reference or as a
zero.  The results will be different. OpenFormula does not say how the denominator for AVERAGEA
is computed.

 - Dennis

-----Original Message-----
From: Zhang Lu [mailto:zhanglu.aoo@gmail.com] 
Sent: Wednesday, June 13, 2012 21:48
To: ooo-dev@incubator.apache.org
Subject: [Call-for-​​Review][C​alc]Last argument of formula should not be removed

Hi All,

   My name is Zhang Lu. I am a developer working in
Symphony team. My special areas are number format, formula, and sc.

I have a patch for review.
https://issues.apache.org/ooo/show_bug.cgi?id=119942<https://issues.apache.org/ooo/show_bug.cgi?id=119972>

Step:
1.open xls file contain formula AVERAGEA(1,2,3,)
Defect : AOO remove the last comma, and the compute result is different
from MS.
2.Save the file to ods, the last comma is removed.
3. AOO should not remove the last comma

Root Cause:
When reading Excel 2k3/2k7 doc, comma will be ignored if it is in the end
of a formula.

Resolution:
When reading Excel 2k3/2k7 doc, if meet comma in the end of  a formula, add
a number '0' (this solution only apply on those function that default value
is 0 when meet miss argument, and which can't be skipped. e.g.COUNT, SUM,
AVERAGE, MIN, MAX, NPV..., refer to the attachment of issue 3879).


Mime
View raw message