Version: 1.6.1 (using KDE KDE 3.5.5) Installed from: Debian testing/unstable Packages OS: Linux At least the AND+OR formulas should also support ranges/arrays like AND(A1:A5;B1:B5). This isn't only more comfortable but also needed to provide better OpenFormula-compatibility.
Created attachment 18736 [details] Patch that implements ranges for AND+OR This patch against the KOffice 1.6 branch implements support for ranges/arrays for the AND and the OR formula functions. Testing doesn't show any regressions. Following cases are now valid; AND(A1) AND(A1,A2) AND(A1:A5) AND(A1:A5;B1:B10) OR(A1) OR(A1,A2) OR(A1:A5) OR(A1:A5;B1:B10) Not committed yet cause it may needed to also extend other logical functions to support ranges too. Would be nice if someone tests OOo and provides a list of formula functions that may need to support ranges as well.
before I forget it; the patch does not include the changed xml-file which also needs to be extended (e.g. the samples should also include such range-definitions and the argument-descriptions need to be changed as well).
This is a duplicate of bug 131809 (which i reported).
*** Bug 131809 has been marked as a duplicate of this bug. ***
TODO I'll look at next days; * check+maybe implement it also for e.g. IF, NOT, TRUE, FALSE, NAND, NOR, XOR * we really could need a complete function-review here to check if there are more functions where OOo allows to define ranges too. Propably it may also an idea to have those parts more generic for 2.0 ( maybe related to http://lists.kde.org/?l=koffice-devel&m=116484095414360&w=2 ).
30 Nov 2006 23:03:57 -0000, Sebastian Sauer <mail@dipe.org>: > * we really could need a complete function-review here to check if there are more functions where OOo allows to define ranges too. Propably it may also an idea to have those parts more generic for 2.0 ( maybe related to http://lists.kde.org/?l=koffice-devel&m=116484095414360&w=2 ). OOo or not, we shall go for compatibility with ODF functions - which OOo is going for as well.
> OOo or not, we shall go for compatibility with ODF functions - which OOo is going for as well. True. I looked at the latest OpenFormula-draft ( http://www.oasis-open.org/committees/download.php/21372/openformula-20061129.odt ) and it does not mention that e.g. the AND()-function supports arrays but it also does not mention that it does not. So, IMHO the spec should be extended to explicit allow arrays for logical functions like AND() cause it just makes sense. The alternate would be to fill a bugreport against OOo but I guess they would mark it as invalid/won't fix cause it may break existing documents that worked before. So, the only alternate I see here is to let KSpread behave like OOo and to extend the specs...
Comparing the logical functions, AND, OR, NAND, NOR and XOR are affected. The specs are only defining AND, OR and XOR ( NAND==NOT(AND()) && NOR=NOT(OR()) ) where OOo does not implement XOR ( filled now as http://www.openoffice.org/issues/show_bug.cgi?id=72182 ).
Created attachment 18744 [details] Patch that implements ranges for AND+OR+NAND+NOR+XOR This patch against the KOffice 1.6 branch implements support for ranges/arrays for the AND, OR, NAND, NOR and XOR formula functions. Also it does try to simplify the code at NAND+NOR by reusing the reverse of there AND+NR counterparts. As usual tested and so far no regressions did show up.
The patch got committed now to the 1.6-branch and trunk. Thanks for the feedback, Matthias.