Issue 122015 - No context menu suggestions for grammar checkers
Summary: No context menu suggestions for grammar checkers
Status: RESOLVED FIXED
Alias: None
Product: Writer
Classification: Application
Component: ui (show other issues)
Version: 4.0.0-dev
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: Ariel Constenla-Haile
QA Contact:
URL:
Keywords: regression
Depends on: 119421
Blocks:
  Show dependency tree
 
Reported: 2013-04-07 14:24 UTC by rgb
Modified: 2013-04-07 23:29 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description rgb 2013-04-07 14:24:59 UTC
LanguageTool(1) and LightProof(2) extensions have problems with the latest builds from the build bot but they work without issues on 3.4.1.

To test the problem, after installing the extension and restarting AOO type some text with grammar errors like a repeated word. The grammar error will be underlined with a blue wavy line on all versions, but if you right click on it you'll get suggestions only on 3.4.1, not on the 4.0 dev builds. Running the full spell and grammar check (F7) will work, only the context menu have problems and only for grammar errors: a right click over a spell error will show suggestions. 

As suggested on previous discussion on dev mailing list(3), this problem seems a regression.

(1) http://languagetool.org/
(2) http://extensions.openoffice.org/project/lightproof
(3) http://markmail.org/message/icqslzkswdvb6cat
Comment 1 Ariel Constenla-Haile 2013-04-07 17:35:47 UTC
The regression is introduced by the fix for bug 119421 with revision 1455480

if( (rError.nErrorStart <= rErrorPosInText) &&
    (rErrorPosInText + nLen < rError.nErrorStart + rError.nErrorLength))

when you right-click on a word with grammar errors, rErrorPosInText is equal to rError.nErrorStart, and nLen is equal to rError.nErrorLength, this makes the second part of the condition evaluate to false:

 (rErrorPosInText + nLen < rError.nErrorStart + rError.nErrorLength)

because rErrorPosInText + nLen is equal to rError.nErrorStart + rError.nErrorLength
Comment 2 Ariel Constenla-Haile 2013-04-07 23:15:47 UTC
Test case:

Precondition: user interface is in locale "English (USA)"

- Download http://extensions.openoffice.org/project/lightproof
  it is a zip file
- Unzip the downloaded file, inside the folder you'll find several extensions. Install the one named lightproof-en_US-0.1.oxt ("Tools" - "Extension Manager" - button "Add", browse to that file)

- Create a new Writer document
- Insert dummy text AutoText (type dt and press F3)

The grammar checker will underline in blue the following errors:

didn't
who'd
night's
he'd

- Right click on each every grammar error
- Expected behavior: a context menu should pop up, the first menu item should be a message explaining the type of error ("Typographic apostrophe." for the four errors). The second menu item should be the suggestion (the respective error but with the apostrophe replaced). The text messages and the suggestions should match the ones if pressing F7 (or menu "Tools" - "Spelling and Grammar...").
Comment 3 Ariel Constenla-Haile 2013-04-07 23:29:26 UTC
Fixed on trunk with revision 1465509