Bug 133203 - Autocorrects dashes after numbers should be optional
Summary: Autocorrects dashes after numbers should be optional
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-20 18:29 UTC by Am Jam
Modified: 2020-07-13 13:07 UTC (History)
4 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 Am Jam 2020-05-20 18:29:49 UTC
Description:
LibreCalc will incorrectly autocorrect any cell that has the form "X-" to "-X" where X is any number. In Tools > AutoCorrect Options there is no way to remove this behavior. 

Steps to Reproduce:
1. Click on any cell
2. Write any number followed by a single hyphen, e.g., "55-"


Actual Results:
The cell autocorrects to "-55"

Expected Results:
The cell category does not change to Number and the cell shows "55-"


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
This is a low priority bug as one can get around this by appending the cell with an apostrophe, e.g., "'55-". The larger issue here is there is no way to change the default behavior.
Comment 1 Anastasiya T 2020-05-20 22:50:49 UTC
Hello Am Jam ,

Thank you for reporting the bug. 

I can confirm that the bug is present  
Version: 6.4.3.2
Build ID: 747b5d0ebf89f41c860ec2a39efd7cb15b54f2d8

CPU threads: 4; OS: Mac OS X 10.15.3; UI render: GL; VCL: osx; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 2 Heiko Tietze 2020-05-22 13:09:02 UTC
Eike, any idea about this "1-" to "-1" conversion?
Comment 3 Eike Rathke 2020-05-25 15:55:20 UTC
Yes, it was a required feature back in OOo times already.
I don't remember the reasoning for it.
If a <number><minus> string is needed the input as usual can be prefixed with an ' apostrophe, for example '55-
Comment 4 Heiko Tietze 2020-05-25 18:30:46 UTC
(In reply to Eike Rathke from comment #3)
> ...input can be prefixed with an ' apostrophe, for example '55-

Does this work for you, Am Jam?
Comment 5 Am Jam 2020-05-26 01:21:28 UTC
Hi Heiko,

Yes, as I noted in the "Additional Info" section, prefixing the cell contents with an apostrophe (e.g., '55-') does the trick. Because of the relatively easy work around, this likely is a low priority bug. However, I'm not sure how this would be considered a "feature".

Many Thanks,
Am.
Comment 6 QA Administrators 2020-05-26 03:36:03 UTC Comment hidden (obsolete)
Comment 7 Heiko Tietze 2020-05-26 08:23:35 UTC
(In reply to Am Jam from comment #5)
> ...I'm> not sure how this would be considered a "feature".

Me neither, and reading Eike's comment 3 he is also not aware of the reason. So let's make this autoformat feature optional via expert setting, switched off by default.
Comment 8 Eike Rathke 2020-06-02 14:40:37 UTC
Thinking back, this feature is probably related to locales that append the minus sign to a currency amount instead of prefixing it. I'd rather advise to not make this an optional feature which would introduce yet another "it might work or not work" state ... apart from that the implementation is deeply buried in the number formatter's parser and disabling it is not just a matter of "switch it off".
Comment 9 Heiko Tietze 2020-06-02 15:19:53 UTC
So let's keep it.
Comment 10 Heiko Tietze 2020-07-13 13:07:48 UTC
*** Bug 132026 has been marked as a duplicate of this bug. ***