Bug 163624 - Multiline text field for pasting / typing multiline formulas in conditional formatting rules editor
Summary: Multiline text field for pasting / typing multiline formulas in conditional f...
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Cell-Formula
  Show dependency treegraph
 
Reported: 2024-10-25 20:32 UTC by Jeff Fortin Tam
Modified: 2025-01-09 15:23 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Fortin Tam 2024-10-25 20:32:11 UTC
Calc (and Excel) allows formulas to be written and stored multi-line; i.e. in the main spreadsheet view's formulabar, if you unfold the formula bar and use shift+enter, you can use line breaks to nicely format your formula in a way that is understandable.

However, the conditional formatting dialog's rules editor sub-dialog, when editing a particular "Formula is" rule, does not allow pasting or writing such multiline formulas. When pasting, only the first line is shown.

It should allow writing complex formulas as multiline for clarity.
Comment 1 Nicole A. 2024-11-14 04:30:28 UTC
UX Team -- please take a look at this enhancement. Thanks!
Comment 2 Heiko Tietze 2024-11-14 09:25:32 UTC
Please share an example.

I test with =A1\n + A2\n + A3, copy the formula and paste into the edit field. That results in "A1+A2+A3", ie. the line breaks are removed (as I would expect).

Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 480(Build:1)
CPU threads: 32; OS: Linux 6.11; UI render: default; VCL: kf6 (cairo+xcb)
Locale: de-DE (en_US.UTF-8); UI: en-US
24.8.2-2
Calc: threaded
Comment 3 Heiko Tietze 2024-11-21 08:30:34 UTC
Cannot confirm the issue, no version information, example is missing.
Comment 4 Jeff Fortin Tam 2024-12-25 21:10:57 UTC
Sorry for not responding sooner, I was away on a business trip for a month.

> the line breaks are removed (as I would expect).

That is precisely what I would not expect. What I am requesting here is for the field to be able to behave as a multiline textfield (or an expandable one, like the formula bar in the main UI) that respects the linebreaks, for readability.

Your formula can serve as an example, but here's another simple one (with named cells instead of regular cell references, which may be longer especially if taken from another sheet):

  IF (TODAY() - date_limite >=-5)
  AND (ISBLANK(date_paiement))

(There can be much more complicated formulas out there, I remember writing some that were 4-6 lines long for instance, but I don't remember where to find them, and they are fairly straightforward to imagine from the example above)

-------

Version information:

Version: 24.8.4.2 (X86_64) / LibreOffice Community
Build ID: bb3cfa12c7b1bf994ecc5649a80400d06cd71002
CPU threads: 8; OS: Linux 6.12; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Flatpak
Calc: threaded
Comment 5 Heiko Tietze 2025-01-06 11:03:17 UTC
In some cases it might be helpful to show formulas with the structure, true.

Question is whether we can store the additional information. Keep in mind that we have to be cross-platform and -application compatible.
Comment 6 Heiko Tietze 2025-01-06 11:05:38 UTC
Reading c0 again you don't ask for cell formulas but the CF dialog specifically. That's probably a technical less challenging question but even more of an edge case. I don't see need for so complex CF formulas.
Comment 7 Heiko Tietze 2025-01-09 15:23:41 UTC
Discussed this during the ESC and in fact we preserve line breaks for formulas. But it requires a different control than a simple edit field to provide space for multiline formulas. Implementing this for CF breaks the dialog for a very niche use case. Better not do it.