Bug 160127 - Grammar context menu is not displayed if no suggestions exist
Summary: Grammar context menu is not displayed if no suggestions exist
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Context-Menu
  Show dependency treegraph
 
Reported: 2024-03-10 09:31 UTC by Fred Kruse
Modified: 2024-04-03 19:13 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
word suggestions upon rightclick (59.33 KB, image/jpeg)
2024-03-11 05:00 UTC, Naresh
Details
ODT with grammar error: missig quote (9.59 KB, application/vnd.oasis.opendocument.text)
2024-03-17 12:17 UTC, Fred Kruse
Details
Correct: LO 7.6.5: Right click on grammar error (321.80 KB, image/png)
2024-03-17 12:24 UTC, Fred Kruse
Details
Bug: LO 24.2: Right click on grammar error (281.58 KB, image/png)
2024-03-17 12:25 UTC, Fred Kruse
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fred Kruse 2024-03-10 09:31:52 UTC
Right-clicking on a grammatical error does not show the context menu for grammatical errors if the grammar check does not provide any suggestions. Otherwise, the context menu is displayed correctly. This error does not occur until version 7.6.
Comment 1 Mike Kaganski 2024-03-10 10:05:38 UTC
Likely related to https://gerrit.libreoffice.org/c/core/+/158832
Comment 2 Naresh 2024-03-11 05:00:03 UTC Comment hidden (off-topic)
Comment 3 Naresh 2024-03-11 05:00:58 UTC Comment hidden (off-topic)
Comment 4 Mike Kaganski 2024-03-11 05:05:29 UTC
(In reply to Naresh from comment #2)
> I was able to get the suggestions for a mistyped word upon right click.

But this issue is not about the case when the spellcheck provides suggestions; it is not about spellcheck at all. It is about *grammar check*, and specifically about the case when the engine does *not* provide any suggestions.
Comment 5 Mike Kaganski 2024-03-16 09:07:58 UTC
Fred: could you please provide specific steps to repro the problem? This requires:

1. Provide an exact text, and its language; or a ready-made ODT document with a text;
2. Describe how your grammar checking (for the relevant language) is set up (e.g., if you set up LanguageTool - is that built-in server setup, or a Java-based plugin; or maybe it's LightProof; maybe you have tweaked some relevant settings of the checker);
3. On which place should we right-click, to see the problem; what is expected; and what you see instead.

Thank you.
Comment 6 Fred Kruse 2024-03-17 12:17:32 UTC
Created attachment 193159 [details]
ODT with grammar error: missig quote
Comment 7 Fred Kruse 2024-03-17 12:23:06 UTC
1. I tested it in English and German. An ODT with a short English text is added. Grammar error: A closing quote is missing.
2. To make it easier to test, I used the built-in LanguageTool with the default server URL for the attached screenshots. But the same error occurred with the Java-based LanguageTool extension.
3. The first screenshots "right click LO 7.6.5" shows the expected behavior. The second screenshot "right click LO 24.2" shows the bug. There is no grammar error context menu but the default context menu as there were nor grammar error.
Comment 8 Fred Kruse 2024-03-17 12:24:20 UTC
Created attachment 193160 [details]
Correct: LO 7.6.5: Right click on grammar error
Comment 9 Fred Kruse 2024-03-17 12:25:26 UTC
Created attachment 193161 [details]
Bug: LO 24.2: Right click on grammar error
Comment 10 QA Administrators 2024-03-18 03:12:38 UTC Comment hidden (obsolete)
Comment 11 wjsim 2024-03-22 15:43:10 UTC
Hello, thank you for reporting the bug.

On the versions:

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: ko-KR (en_US); UI: en-US
Calc: CL threaded

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6a064b1967e06e40be40817deff99d00c1a8554f
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: ko-KR (en_US); UI: en-US
Calc: CL threaded

On the attached file, I can't seem to replicate the red autocorrect line for This is a "test. line. However, I can confirm that any other texts with grammatical errors shows the context menu for the grammar check.
Comment 12 Mike Kaganski 2024-03-22 17:31:32 UTC
Repro. Regression after 4c6c60d44b0056cbe08b6e75baacbc0df0cd1742. Reverting it restores the menu.

Note this description in the discussion of the patch:

> This patch solves below problem:
> Sometimes suggestions are not shown.
> When there are 2 lists, the first list is shown and the second one will be shown
> after the first issue is solved. With this patch, we prioritize the second one
> if there is no suggestions for the first one.
> 
> In this 1.empty 2.non-empty case, if the second issue is solved then the first
> one will be shown. Since there is no suggestions list for the first one, the
> first one will only be shown as with underline.

It would be great to know under which circumstances there will arrive two suggestions. Maybe there is a way to have the menu anyway?