Bug 160127 - Grammar context menu is not displayed if no suggestions exist
Summary: Grammar context menu is not displayed if no suggestions exist
Status: RESOLVED FIXED
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: target:25.2.0 target:24.8.3 target:24...
Keywords:
Depends on:
Blocks: Context-Menu
  Show dependency treegraph
 
Reported: 2024-03-10 09:31 UTC by Fred Kruse
Modified: 2024-10-28 20:07 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?
Comment 13 Marco A.G.Pinto 2024-05-11 22:23:12 UTC
Heya,

I am sorry if I am pressuring you guys, but there are around three months left for LibreOffice 24.8 to be released, and I can't even use 24.2 because LanguageTool doesn't work.

Could there be made a quick workaround for it to work, please?

Thanks!
Comment 14 Commit Notification 2024-10-16 15:48:18 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3233383b2631788e7cfb0dd0b92d879322561616

tdf#160127: Improve grammar check popups from Duden

It will be available in 25.2.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.
Comment 15 Commit Notification 2024-10-22 21:16:07 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/59923249e45993805f1f82399d0251f4b63e549b

tdf#160127: Improve grammar check popups from Duden

It will be available in 24.2.8.

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.
Comment 16 Commit Notification 2024-10-22 21:16:10 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/7cf1c6c2ccd2d2aefed94f269e836eaeef5a807e

tdf#160127: Improve grammar check popups from Duden

It will be available in 24.8.3.

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.
Comment 17 Commit Notification 2024-10-28 13:01:45 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-2-7":

https://git.libreoffice.org/core/commit/25ea6b3a8c5180c17f0a74e395e807d46143b00f

tdf#160127: Improve grammar check popups from Duden

It will be available in 24.2.7.

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.