Apache OpenOffice (AOO) Bugzilla – Issue 86171
ODFF: MINA(range)=MIN(range): text should equal zero also for formulas returning text
Last modified: 2013-08-07 15:15:24 UTC
The solution to MINA(range) and MIN(range) is currently the same MINA() should treat text as a zero value as per the function description even if part of a range. if A1=3; A2=2; A3=1; A4="text" then MIN(A1:A4) =1 as it ignores text entries MINA(A1:A4)=1 where it should be zero NOTE however that ... MINA(A1:A3;A4)=0 as it recognizes the text in the single entry Also on Linux OOo Calc 2.3.0 (don't have 2.3.1) ... MINA(A1:A4)=0 as it should be.
The problem here are formulas returning text. MINA(Ref) works fine if in Ref a cell contains text, but formula cells in Ref are ignored.
Confirmed to be the same on Linux TEXT is OK Formulae returning TEXT is not OK
Created attachment 51646 [details] A patch.
Looks like the correct approach in general. However, since the previous condition if ( rErr || ((ScFormulaCell*)pCell)->IsValue() ) already obtained IsValue() during the boolean short-circuit (if the condition does not match, IsValue() returned false) that doesn't need to be evaluated again, the resulting code could be simplified to something like (untested and off-hand) if ( rErr || ((ScFormulaCell*)pCell)->IsValue() ) ... else if ( bTextAsZero ) ... Did you check the other interpreter cases where the ScValueIterator is used with bTextAsZero? Did they exhibit wrong behavior as well that now is fixed? Thanks Eike
Created attachment 51700 [details] Second patch, based on the first, simplifed the condition.
Setting to type PATCH.
And of course it ain't new anymore..
In cws odff03: sc/source/core/data/dociter.cxx 1.20.22.1
Reassigning to QA for verification.
verified in internal build cws_odff3
ok in m28