Bug 120896 - Context menu does not appear over cell contents after the spell check context menu was active
Summary: Context menu does not appear over cell contents after the spell check context...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: All All
: medium minor
Assignee: Justin L
URL:
Whiteboard: target:7.4.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Context-Menu
  Show dependency treegraph
 
Reported: 2018-10-25 09:46 UTC by Konstantin
Modified: 2022-02-01 05:51 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin 2018-10-25 09:46:12 UTC
Description:
When typing several words into a cell, and using the spell check context menu, the standard context menu is not shown until the cell edit process is finished (cell is deselected) and restarted again (Click on Cell and press F2.

Steps to Reproduce:
1.Type into cell: "aaa"
2.right click on the string, so the spell-check context menu appears
3.change aaa to a2
4.right click on a2, the normal context menu does not appear

Actual Results:
The normal context menu does not appear

Expected Results:
The normal context menu should appear


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.0.6.2
Build-ID: Gentoo official package
CPU-Threads: 4; BS: Linux 4.14; UI-Render: Standard; VCL: gtk3; 
Gebietsschema: de-DE (de_DE.utf8); Calc: group

Workaround: Select a different cell, reopen the cell (F2)
Comment 1 Xisco Faulí 2018-10-31 12:16:01 UTC
I can't reproduce it in

Versió: 6.1.3.1
ID de la construcció: 1:6.1.3~rc1-0ubuntu0.16.04.1
Fils de CPU: 4; SO: Linux 4.15; Renderitzador de la IU: per defecte; VCL: gtk3; 
Configuració local: en-US (ca_ES.UTF-8); Calc: group threaded

To be certain the reported issue is not
related to corruption in the user profile, could you please reset your
Libreoffice profile ( https://wiki.documentfoundation.org/UserProfile ) and
re-test?

I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the issue is still present
Comment 2 Konstantin 2018-12-17 10:08:36 UTC
The issue persist in Safe Mode using the least radical option for safe mode.

To be more specific: when changing the string in Step 3 I never leave the cell, and I can mark the string with right double clicks in step 4, but cannot invoke a context menu.

I could try recording a video of the procedure, if it helps. (I don't know how to visualize / record the mouse events).
Comment 3 Buovjaga 2019-07-14 06:25:14 UTC
I reproduce. The context menu does appear, if you click in an empty part of the cell. It fails to appear only, if you click on the text itself. Also tested with gen backend.

Will test with older versions later.

Arch Linux 64-bit
Version: 6.2.5.2
Build ID: 6.2.5-1
CPU threads: 8; OS: Linux 5.2; UI render: default; VCL: kde5; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Comment 4 Buovjaga 2019-07-14 11:39:25 UTC
Bibisected on Linux with 42max to https://gerrit.libreoffice.org/plugins/gitiles/core/+/91923443e0d04218ae7124f439fc06a76f904462%5E!/
Fix context menu launch on mis-spelled word in a cell.

This was broken when the spell check handler was re-implemented
after the cell storage rework.

Same blame for bug 74087, which then received a fix.
Comment 5 Justin L 2021-12-10 11:17:40 UTC
The problem here is that the cache hasn't been cleared, so it still thinks there are misspelled words. Both of these return true on the second right click:

    bSpellError = (mpSpellCheckCxt->isMisspelled(nColSpellError, nCellY));
    if (bSpellError)
    {
        // Check and see if a misspelled word is under the mouse pointer.
        bSpellError = IsSpellErrorAtPos(aPosPixel, nColSpellError, nCellY);
    }
Comment 6 Justin L 2021-12-10 16:46:27 UTC
I'm not convinced the identified commit is causal. I think it probably just worked somehow - since apparently things were already very broken at that time anyway.

There is a much higher level cache (the cell's contents cache) that is not being cleared when the change is made. [But I haven't identified that yet.]
Comment 7 Justin L 2021-12-11 16:08:49 UTC
Totally getting into the weeds here.
It is a svl::SharedString that hasn't been updated.
Comment 8 Justin L 2021-12-14 09:57:55 UTC
Up for discussion is the sledgehammer fix http://gerrit.libreoffice.org/c/core/+/126802
Comment 9 Eike Rathke 2022-01-07 21:13:43 UTC
I don't even get the spell-check menu while editing the cell. No matter with or without Automatic Spell Checking enabled. But I always get the normal cell editing context menu.
Comment 10 Buovjaga 2022-01-08 07:54:59 UTC
(In reply to Eike Rathke from comment #9)
> I don't even get the spell-check menu while editing the cell. No matter with
> or without Automatic Spell Checking enabled. But I always get the normal
> cell editing context menu.

Did you do the original steps from the description? I still reproduce with all Linux VCL backends. Note that in step 4 you need to click the text, not the empty part of the cell.

Arch Linux 64-bit
Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 71be70b16b37fb3c1b6331ab3581300556ecc7aa
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 7 January 2022
Comment 11 Eike Rathke 2022-01-27 13:28:52 UTC
Ah the missing step for me was
1.a: hit Enter to close the cell
then I can reproduce.
I tried context menu on the just entered string while still in-cell.
Comment 12 Commit Notification 2022-01-31 23:04:12 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d098e027cb9899e31ae3ff7ba245b78a009681fb

tdf#120896 sc: commit change after PopupSpelling

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.