Apache OpenOffice (AOO) Bugzilla – Issue 86643
ODFF: Make COUNT ignore error results
Last modified: 2013-08-07 15:15:24 UTC
To comply with the ODFF specification and for interoperability with other spreadsheet applications, the COUNT function must ignore formula cells with error results. The only types COUNT should count are numeric value, cell with numeric content and formula cell with numeric result. Errors are not to be propagated.
Hi Yue! This issue looks like a good next candidate for you to work on, I guess. Thanks Eike
Created attachment 51891 [details] A patch
Hi Yue, Almost.. for the case svSingleRef the patch unconditionally casts pCell to ScFornulaCell* to call pFCell->GetErrCode(). That would be illegal if the cell wasn't of type ScFormulaCell. Obtain the cell type first using pCell->GetCellType() and check for CELLTYPE_FORMULA and only if so do the cast and obtain the error code. I also would not extract the ifCOUNT case from the switch to introduce another if(eFunc==ifCOUNT) but handle the formula cell case inside the switch(eFunc){case ifCOUNT}, decrementing nCount again in case it was a formula cell with error result. That would save one comparison for all other functions not being ifCOUNT. Might sound like nitpicking but ... The error case is an exceptional case, so generally nCount would only be incremented. For the case svDoubleRef, as now ifCOUNT is handled explicitly in switch(eFunc), the default case there can be removed, that only handled the then remaining ifCOUNT case. Thanks Eike
Created attachment 51960 [details] Another patch
Created attachment 51961 [details] patch3
Hi, Eike, The patch2 is not complete, I forgot the part of CASE_OCERRFUNC macro. So, please check patch3. :) Thanks Yue
Created attachment 52093 [details] patch4 of i86643
Created attachment 52225 [details] patch 5. Reset nGlobalError, and handle all errors.
In cws odff03: sc/source/core/tool/interpr1.cxx 1.56.20.2 sc/source/core/tool/interpr4.cxx 1.55.20.1
Reassigning to QA for verification.
verified in internal build cws_odff3
Verified under DEV300m28 under Linux - Closing - Sophie
Verified under Dev300_m28 under XP.
*** Issue 51068 has been marked as a duplicate of this issue. ***