Bug Hunting Session
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:
Keywords: easyHack, skillCpp
Depends on:
Blocks:
 
Reported: 2016-12-23 17:15 UTC by himajin100000
Modified: 2018-06-04 03:36 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.