openoffice-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis E. Hamilton" <>
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 [] 
Sent: Wednesday, June 13, 2012 21:48
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.<>

Step: 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.

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).

View raw message