Bug 160874 - Calc fails to suggest correction for formula cell without equal sign
Summary: Calc fails to suggest correction for formula cell without equal sign
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.2.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
Depends on:
Blocks:
 
Reported: 2024-04-30 18:22 UTC by Dan Dascalescu
Modified: 2024-05-16 15:31 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Screencast (3.40 MB, video/mp4)
2024-04-30 18:22 UTC, Dan Dascalescu
Details
Spreadsheet to reproduce the bug (22.24 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-04-30 18:23 UTC, Dan Dascalescu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Dascalescu 2024-04-30 18:22:56 UTC
Created attachment 193911 [details]
Screencast

If you edit a cell and type an incomplete formula, e.g. `=-5 *` then click a cell, Calc will paste the cell's address at the cursor in the formula, e.g. `=-5 * A3`.

If you edit a cell that contains a negative number, e.g. `-5` and add `* 2`, Calc will correctly interpret that as a formula, `-5 * 2`.

But if you edit a cell consisting of a negative number, type an operator (e.g. `-5 * `), then click another cell, Calc won't paste that cell's address.

Please see the attached screencast, recorded with the attached spreadsheet.

Version: 24.2.0.3 (X86_64) / LibreOffice Community
Build ID: da48488a73ddd66ea24cf16bbc4f7b9c08e9bea1
CPU threads: 20; OS: Linux 6.7; UI render: default; VCL: kf5 (cairo+wayland)
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Dan Dascalescu 2024-04-30 18:23:43 UTC
Created attachment 193912 [details]
Spreadsheet to reproduce the bug
Comment 2 ady 2024-04-30 20:11:50 UTC
IMHO, there are enough issues with unary operators. If the cell contains a simple negative numeric value and users want to modify the cell to contain instead a formula, then the initial equal sign should also be (manually) added by the user. That's just my personal subjective opinion.

Having Calc guessing the user's intention is nice, until each user wants the guess to be different. That's how we (users) get the "initial sometimes-hidden apostrophe" (which some users are unaware of, or don't understand its meaning), or "why this column in my csv file is imported as text instead of as numbers", or the exact opposite reports/questions.

Now, if the request from comment 0 (to automatically add the equal sign when the user modifies a simple negative/positive numeric value, turning it into what could probably be interpreted as a formula), then all sorts of regression tests should be added too, in order to reduce follow-ups such as "my csv is imported differently now", or, if some other behavior is modified as a consequence, it should be clearly described too (instead of finding out just by chance, in the best case).

If this behavior is implemented, it would mean that instead of the current suggestion (i.e. adding the apostrophe and changing the value from numerical to text), the new behavior would silently skip any suggestion and would automatically add the initial equal sign, turning the cell into a formula.

When there is no additional operator edited, clicking on another cell should leave the original cell without change and the clicked-on cell would be the new active cell. This is the current behavior and should not change.

Please note that the reported behavior happens not only with negative values, but with any numerical value.

Please also note that the reported behavior happens only when editing existing numerical values. When the cell has no prior content (and it is not pre-formatted as text), then the initial equal sign is indeed automatically added when clicking on some other cell.
Comment 3 ady 2024-04-30 20:27:48 UTC
(In reply to ady from comment #2)

> If this behavior is implemented, it would mean that instead of the current
> suggestion (i.e. adding the apostrophe and changing the value from numerical
> to text), the new behavior would silently skip any suggestion and would
> automatically add the initial equal sign, turning the cell into a formula.

I would like to suggest, if the request from comment 0 is implemented, instead of being silently and automatically converted into a formula, that a suggestion should still be presented, as it is currently the case (just with a different suggestion, converting the cell into a formula rather than into a text cell). A silent and automatic action would allow mistakes that would not be easy to spot in real time, especially when the current behavior would stop such mistake.