https://bugs.freedesktop.org/show_bug.cgi?id=42897

--- Comment #12 from Renato Ferreira <[email protected]> ---
(In reply to Markus Mohrhard from comment #11)
> (In reply to Renato Ferreira from comment #9)
> > Thanks Joel. I am aware of that, but since there seemed to be some
> > uncertainty about the desired behaviour here, I believed it would be better
> > to first discuss it here. And the patch can be used to see how it currently
> > works. 
> > 
> > If this is the design decision to be made, of course I can go ahead and just
> > push to gerrit.
> 
> I'd like us to use ScSimpleFormulaCalculator instead of trying to implement
> a heuristic for formula token detection. That provides access to the
> ScTokenArray which allows to check how the formula was parsed.

Hm, maybe that instead of the isQuoted thing? I did instantiate a compiler
elsewhere when a condition is entered to check for double or string. So I think
I see, we could also invoke the interpreter to check whether the stored
expression evaluates to a string before unquoting it? It does seem more
reliable, although double-checking that the quotes are there indeed before
removing them also seems to be a good idea, if I understood this correctly.

Also, ScSimpleFormulaCalculator does seem very clean to use.

> 
> Otherwise just changing the background is not enough. We would also need a
> label with a warning message. We are also no longer use the lcl prefix for
> local functions in calc, instead please put them into an anonymous namespace.

Please note that I did include a label with a warning message in the attached
idea. Which also brings another issue to my mind: even if we go ahead and add
the "equal to value" implementation, what happens to "begins with", "contains",
etc.? They still require quotes in order to work properly (do they *only* work
with strings?), and this fact would be even more obscured by the added
functionality. A few ideas:

- Use the warning in all the cases
- Add the "equal to value" condition for convenience, use warning for the
others
- Auto-correct the "begin with", "contains" etc. to strings if they are not
quoted

Not sure what would be better...

> 
> And as Michael already mentioned we should not change ScConditionMode for a
> hack that is local to the UI code.

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