Description: The content of a cell that is being edited a cell in Calc, will appear in a new Sheet after clicking on the + button to create a new Sheet. Steps to Reproduce: 1. Created a new spreadsheet document with Calc 2. Click any cell in in Sheet1 (i.e. C6) 3. Type something (i.e. 1) 3.1 (Do not press enter) 4. With your mouse, click on the + button on the left of the Sheet1 tab (at the bottom of the Calc window) 5. Notice that the content of the cell now contains what you typed in Sheet1 (i.e. Cell C6 of Sheet2 has 1) Actual Results: The text that was being edited in a sheet is now present in the new sheet (same cell) Expected Results: The text that was being edited should stay in the proper sheet and the new sheet should be completely empty. Reproducible: Always User Profile Reset: No Additional Info: Version: 7.0.3.1 (also reproduced on 7.0.1.2) Environment: CPU threads: 8; OS: Linux 5.6 (also reproduced on CPU threads: 4) User Interface: UI render: default; VCL gtk3 Locale: en-CA (en_CA.UTF-8); UI: en-US Misc: Calc: threaded
Hello [user's name], Thank you for reporting the bug. I can confirm that the bug is present in master. Version: 7.1.0.0.alpha1+ (x64) Build ID: 00e5c63c35307faacf76a5e2ca7953c4208244ed CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win Locale: cs-CZ (cs_CZ); UI: en-US Calc: CL Also in Verze: 4.1.0.1 ID sestavení: 1b3956717a60d6ac35b133d7b0a0f5eb55e9155
This bug is present since version: LibreOffice 3.5.0rc3 Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
So I noticed that the contents are NOT included on sheet1. That is good. They are included on sheet2 as finalized - not as edit-in-progress. (The selected cell in the new sheet is A1 - so there is no indication of the change that was being made - which may very well be off-screen.)
I'd say it is very reasonable to cancel any "in progress" work when creating a new sheet. A calc person should be able to do that very easily.
Taking a cue from SID_INPUT_CANCEL, it looks like at some point we should call SC_MOD()->InputCancelHandler(). ScTabControl::AddTabClick() looks like a good place to do that.
Proposed fix at http://gerrit.libreoffice.org/c/core/+/126501
(In reply to Justin L from comment #4) > I'd say it is very reasonable to cancel any "in progress" work when creating > a new sheet. I don't think so. If I was in the middle of editing a formula and inserted a sheet to reference it I would be annoyed if all my editing was gone. Rather accept the current input instead.
(In reply to Eike Rathke from comment #7) > Rather accept the current input instead. It is fairly clear that a "topview" change needs to be explicitly cancelled or accepted. However, switching to a different application, print preview, spell check, etc. are considered as "accept". So accepting (rather than cancelling) would be consistent. > If I was in the middle of editing a formula and inserted a > sheet to reference it I would be annoyed if all my editing was gone. In this case you are likely left with an error - since the editing will be accepted before the desired reference sheet is created. Plus it will be "out of sight" so you won't easily detect the "error". So this suggests that the topview needs to stay in edit/reference mode and neither commit nor cancel. [That sounds like a non-trivial effort.]
(In reply to Justin L from comment #8) > In this case you are likely left with an error - since the editing will be > accepted before the desired reference sheet is created. Nope - not true. This IsFormulaMode and so the editing is not finished at this point. It is still in "formula building" cell selection mode.
Interesting - no automatic merge notification even though the link to this bug report is intact. Anyway, the patch was merged. tdf#137899 sc: accept any unfinished editing before adding sheet https://gerrit.libreoffice.org/c/core/+/126501
There appeared to be a BZ hickup/outage when the change was merged.
This problem is current in 7.3.4 and 7.2.7. Windows 10 Pro
Verified as fixed since LO 7.4.