https://bugs.documentfoundation.org/show_bug.cgi?id=61228

--- Comment #8 from Mike Kaganski <[email protected]> ---
(In reply to Thomas Arnhold from comment #7)
> The issue is, that writer should not silently ignore the wrong function
> name, but display an error, that the function was not found. Then it would
> be clear to everyone.

I need to add to this interpretation.
Currently Writer "ignores" unknown variable names (as if they are equal to 0).
That's OK, and enables writing "self-describing" formulas with comments like
this:

=(1+2+3-apples)+(4+5+6-oranges+peaches)

where all the names are undefined and used there just to clarify that I added
1+2+3=6 apples and a total of 4+5+6=15 oranges and peaches. Writer will end up
with 21 in that cell. "Fixing" this to emit error on that names would disable
that handy trick. Well, that also mean that if a user makes a mistake writing a
defined variable name, than that error could be unnoticed, silently accepting
that wrong name as if it is 0 (and giving wrong result). Well, that is arguably
bad, but is accepted in languages like Lisp and Basic, so the decision is up to
implementors (ODF standard?).

On the other side, treatment of undefined _function_names_ is somewhat
inconsistent. If the function is the last element in a formula, like in

=1+2+foo(3+4)

then the end result will be just what is inside the function, i.e. 3+4=7.
Everything before it will be simply ignored.
If the function is not the last element, then an error is emitted:

=foo(3+4)+1+2

** Expression is faulty **

For consistency, this should be treated uniformly, e.g. ignore in any place
(and without dropping previous data), or emit error in all cases.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to