Bug 118654 - strange behaviour when typing formula containing named cell '_C'
Summary: strange behaviour when typing formula containing named cell '_C'
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, regression
Depends on:
Blocks: Cell-Formula
  Show dependency treegraph
 
Reported: 2018-07-10 01:13 UTC by john
Modified: 2020-07-31 16:57 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 john 2018-07-10 01:13:50 UTC
Description:
LO misbehaves when user attempts to use a cell name 'C' (which is automatically converted to '_C' to avoid clash with C1R1 naming).

When the user attempts to type the name _C at the end of a formula, input text is mysteriously disappeared, as if autocorrect is acting on the text, even though it is unclear why.




Steps to Reproduce:
1. Create new sheet
2. In A1, enter 'C'
3. In B1, enter '800'
4. In A2, enter 'alpha'
5. In B2, enter '0.8'
6. Select cells A1:B2, then click menu Sheets->Names->Create and press enter (just 'left column' selected in dialog)
7. Move to cell B1 and notice that the cell has become named '_C' as expected
8. In A3, enter, '=1 - alpha/C' and press ENTER



Actual Results:

After typing ENTER at step 8, the contents of the cell have become

= 1 - _C

and the editing is still active, ie the input has not been completed.

If I press ENTER one more time, I get the WRONG cell value -799.

Expected Results:
I would have expected the input to have been completed, and the cell should show a value of 0.999.



Reproducible: Always


User Profile Reset: No



Additional Info:
Note: I checked my AutoCorrect options; there is no entry there for '_C'. This is not an autocorrect action.

Note: I can obtain the correct input by pressing SPACE at step 8, BEFORE pressing ENTER.

Version: 5.4.6.2
Build ID: 1:5.4.6-0ubuntu0.17.10.1
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: en-AU (en_AU.UTF-8); Calc: group
Comment 1 john 2018-07-10 01:14:42 UTC
Correction: step 8 shoud read

8. In A3, enter, '=1 - alpha/_C' and press ENTER
Comment 2 Xavier Van Wijmeersch 2018-07-10 12:16:37 UTC
confirm with

Version: 6.2.0.0.alpha0+
Build ID: 9d7166b448198875bdff43d7054d0f5914e675de
CPU threads: 2; OS: Linux 4.14; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2018-07-08_23:35:50
Locale: nl-BE (en_US.UTF-8); Calc: group threaded
Comment 3 Xisco Faulí 2018-07-11 09:19:13 UTC
So the problem is only reproducible when the formula is inserted manually. if it's copy pasted, the result it correct
Comment 4 Xisco Faulí 2018-07-11 09:21:37 UTC
This is a regression introduced in range https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=5b0b7553241bb5150b12bbf7625b4b0b36970272..a4f32eec653596483088c6e5aa37de031278d74c.
I can't bisected it in that range due to bug 78718

@Eike, I thought you could be interested in this issue...
Comment 5 Xisco Faulí 2018-07-11 09:36:35 UTC
(In reply to Xisco Faulí from comment #4)
> This is a regression introduced in range
> https://cgit.freedesktop.org/libreoffice/core/log/
> ?qt=range&q=5b0b7553241bb5150b12bbf7625b4b0b36970272..
> a4f32eec653596483088c6e5aa37de031278d74c.
> I can't bisected it in that range due to bug 78718

At this point, the formula became "=1 - alpha/__C" ( with double underscore" after pressing ENTER.
Later, it changed to '_C' at https://cgit.freedesktop.org/libreoffice/core/commit/?id=9fc83ae4e479f7e6784dfdce87de35c283fbadd2

Adding Winfried Donkers to the loop as well...
Comment 6 Winfried Donkers 2018-07-11 11:55:13 UTC
> At this point, the formula became "=1 - alpha/__C" ( with double underscore"
> after pressing ENTER.
> Later, it changed to '_C' at
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=9fc83ae4e479f7e6784dfdce87de35c283fbadd2
> 
> Adding Winfried Donkers to the loop as well...

This commit may well make the problem apparent, as <Enter> is interpreted as 'use the first match in the list of the entered text as function'.

The problem with _C also occurs when you define a named range with the same name as a function, the underscore is not the reason.

I _think_ (I have not digged into this deep enough to be certain) that cause of the problem has more to do with named ranges being included in the matching functions list used for automatic function name completion.

I cannot look into this matter any deeper soon, as I'm currently busy tackling another bug.
Comment 7 Winfried Donkers 2018-07-23 10:55:38 UTC
I am looking into the code.
It seems the problem is not caused (entirely) by https://cgit.freedesktop.org/libreoffice/core/commit/?id=9fc83ae4e479f7e6784dfdce87de35c283fbadd2 .

As I haven't found the actual cause(s) yet, I won't assign myself (yet).
Comment 8 QA Administrators 2019-08-01 03:37:14 UTC Comment hidden (obsolete)
Comment 9 john 2019-09-19 14:30:00 UTC
This bug is still present, exactly the same as before (minus a small change in the naming of the menus).

Version: 6.2.6.2
Build ID: 1:6.2.6-0ubuntu0.18.04.1~lo1
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-AU (en_AU.UTF-8); UI-Language: en-US
Calc: threaded
Comment 10 Xavier Van Wijmeersch 2019-09-20 11:31:21 UTC
confirm problem with

Version: 6.3.1.2
Build ID: b79626edf0065ac373bd1df5c28bd630b4424273
CPU threads: 8; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: nl-BE (en_US.UTF-8); UI-Language: en-US
Calc: threaded


but is working with

Version: 6.4.0.0.alpha0+
Build ID: 4cf9bb10945aaad487c756c8f282d03b9eea89ae
CPU threads: 8; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: nl-BE (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 11 Timur 2020-07-31 16:57:47 UTC
As Xavier noticed (please also mark when it's clear as tested old and new), WFM.