Bug 104888 - "Ctrl + Shift + Enter" hotkey after "F2" on the cell that I carelessly forgot to hold "Ctrl + Shift" when I entered matrix related formula should be treated as a modification to the formula on the cell.
Summary: "Ctrl + Shift + Enter" hotkey after "F2" on the cell that I carelessly forgot...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard: reviewed:2022
Keywords: easyHack, skillCpp
Depends on:
Blocks:
 
Reported: 2016-12-23 17:15 UTC by himajin100000
Modified: 2022-11-17 17:59 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 himajin100000 2016-12-23 17:15:07 UTC
STEPS TO REPRODUCE:

1. Set each cell of A1:B2 to the value specified below.

A1: 1
A2: 0
B1: 0
B2: 1

2. Select C1:D2 with cell cursor on C1

3. 
type
=MMULT($A$1:$B$2,$A$1:$B$2)
and press Enter but FORGET TO HOLD SHIFT KEY AND CTRL KEY.

4. What you see on the sheet will be the value 1 only in C1 and nothing in C2,D1 and D2.

* If you fail to forget about shift and ctrl key on step 3, you will also see value 0 in C2 and D1 cell and 1 in D2. So, C1:D2 will make multiplication of an identity matrix and itself.

5. Here you notice that you forgot to hold the keys. Select C1:D2 with cell cursor on C1 again,and you press F2.

6. And then press Enter but DON'T forget to hold ctrl and shift key this time.

EXPECTED RESULT:
C1:D2 will be like what is indicated on * above.

ACTUAL RESULT:
Nothing changes.

ADDITIONAL INFORMATION:.

Cell tries to recalculate when its formula is modified (technically when modified flag is set to true).

Alt, Ctrl, Shift, Arrow Keys, F2, Enter key on formula bar GENERALLY does not change its contents, but the case I gave in the STR is one of the exceptions.

When you append something, namely "a", for example, to the formula and delete it soon between step 5 and step 6, then modified flag is set to true, even though the initial formula and the final formula are the same. In this case C1:D2 will look as given in *.

FYI:
http://opengrok.libreoffice.org/xref/core/sc/source/ui/app/inputhdl.cxx?r=8974b0fafb18f9dd3f2c0e175a3255b80e4c249e#2279
http://opengrok.libreoffice.org/xref/core/sc/source/ui/app/inputhdl.cxx?r=8974b0fafb18f9dd3f2c0e175a3255b80e4c249e#3300
http://opengrok.libreoffice.org/xref/core/editeng/source/editeng/editeng.cxx?r=ee33745ced5ae12f9ae7735fac16a7298ccae474#2651
http://opengrok.libreoffice.org/xref/core/sc/source/ui/app/inputhdl.cxx?r=8974b0fafb18f9dd3f2c0e175a3255b80e4c249e#3428
http://opengrok.libreoffice.org/xref/core/sc/source/ui/app/inputhdl.cxx?r=8974b0fafb18f9dd3f2c0e175a3255b80e4c249e#3219
http://opengrok.libreoffice.org/xref/core/sc/source/ui/app/inputhdl.cxx?r=8974b0fafb18f9dd3f2c0e175a3255b80e4c249e#3245
http://opengrok.libreoffice.org/xref/core/sc/source/ui/app/inputhdl.cxx?r=8974b0fafb18f9dd3f2c0e175a3255b80e4c249e#2824
http://opengrok.libreoffice.org/xref/core/sc/source/ui/app/inputhdl.cxx?r=8974b0fafb18f9dd3f2c0e175a3255b80e4c249e#2835
http://opengrok.libreoffice.org/xref/core/sc/source/ui/app/inputhdl.cxx?r=8974b0fafb18f9dd3f2c0e175a3255b80e4c249e#2891
Comment 1 Buovjaga 2016-12-31 18:03:32 UTC
Reproduced.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: fc0d4e6bc43d5f982452df07930f5ecf5927ad22
CPU Threads: 8; OS Version: Linux 4.8; UI Render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on December 31st 2016
Comment 2 Eike Rathke 2017-06-28 11:10:45 UTC
I believe this was always the behaviour, the formula is entered as new only if modified. To summarize, what we'd need here is to

0) when editing an existing formula remember whether it was a matrix
   formula or not
1) even if not modified, when closing with Shift+Ctrl+Enter and it was
   not a matrix formula then accept as new input

Do not do this vice versa, ie. closing with only Enter should not convert an unmodified formula from matrix to non-matrix as it is too easy to foul things up this way accidentally.

Tagging as EasyHack, source code pointers are given above.
Comment 3 Hossein 2022-11-17 14:58:58 UTC
Reproducible in 6.4:
Version: 6.4.0.1
Build ID: 1b6477b31f0334bd8620a96f0aeeb449b587be9f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

But not in 7.4:
Version: 7.4.0.3 / LibreOffice Community
Build ID: f85e47c08ddd19c015c0114a68350214f7066f5a
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 4 Eike Rathke 2022-11-17 17:32:25 UTC
The tested scenario with MMULT() is slightly different from the original request though, because MMULT() delivers a matrix that now (since 7.4, see https://wiki.documentfoundation.org/ReleaseNotes/7.4#Calc "Automatic cell matrix expansion"...) is automatically recognized to be spread as array/matrix formula, so forgetting to use Shift+Ctrl+Enter does not have any effect with MMULT().

To reproduce the original request use

A1: -1
A2: -2
B1: =ABS(A1:A2)

and close B1 only with Enter, result will be 1 because of the intersection of B1 with A1:A2. On B1 press F2, hit Shift+Ctrl+Enter and it stays the same. It should change to an array/matrix formula delivering {1;2}.