Bug 131552

Summary: Ability to have line breaks in Calc spreadsheet formulas for readability
Product: LibreOffice Reporter: Jeff Fortin Tam <nekohayo>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: CLOSED DUPLICATE    
Severity: enhancement CC: heiko.tietze, thb
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:

Description Jeff Fortin Tam 2020-03-25 01:04:23 UTC
Description:
It would be helpful if LibreOffice Calc registered and displayed new lines / line breaks in formulas when the formula bar is expanded.

Steps to Reproduce:
Put (paste or type) this formula in a cell:

=
IF($L22="CAD", M22*I22/F22,
IF($L22="USD", M22*$R$3*I22/F22,
IF($L22="EUR", M22*$P$3*I22/F22,
"no")))

Then press Enter to validate the formula.

Actual Results:
When you select the formular bar again, even if the formula bar is expanded the formular bar is expanded, the formula will have become one single line again:

= IF($L22="CAD", M22*I22/F22, IF($L22="USD", M22*$R$3*I22/F22, IF($L22="EUR", M22*$P$3*I22/F22, "no")))

Expected Results:
It should respect the line breaks I have put there for readability.


Reproducible: Always


User Profile Reset: No



Additional Info:
Excel allows this (you create line breaks by hitting Alt+Enter, instead of Shift+Enter like in LOo Calc).
Comment 1 Eike Rathke 2020-06-19 20:49:59 UTC
Agreed. ODFF 1.3 also recommends specific whitespace should be preserved,
https://docs.oasis-open.org/office/OpenDocument/v1.3/cs01/part4-formula/OpenDocument-v1.3-cs01-part4-formula.html#__RefHeading__1017970_715980110
of which currently only U+0020 SPACE is preserved.
Comment 2 Heiko Tietze 2021-04-08 13:48:33 UTC Comment hidden (obsolete)
Comment 3 Heiko Tietze 2021-04-09 11:34:06 UTC
(In reply to Heiko Tietze from comment #2)
> Please don't forget...

No need for UX input since whitespace is defined in ODF 1.3. Thorsten, could this be a fall-out from other open tasks?
Comment 4 Eike Rathke 2021-08-10 09:50:08 UTC
Implemented.

*** This bug has been marked as a duplicate of bug 76310 ***