Bug 92341 - add "AutoCorrect Options..." to right click spell checking menu
Summary: add "AutoCorrect Options..." to right click spell checking menu
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Yousuf Philips (jay) (retired)
URL:
Whiteboard: target:5.1.0
Keywords:
Depends on:
Blocks: Context-Menu AutoCorrect-Complete
  Show dependency treegraph
 
Reported: 2015-06-25 20:57 UTC by tommy27
Modified: 2016-10-19 23:10 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot (16.15 KB, image/png)
2015-06-25 20:57 UTC, tommy27
Details
my patch (2.20 KB, application/mbox)
2015-09-24 14:45 UTC, Yousuf Philips (jay) (retired)
Details
screenshot for wiki 5.1 release notes (7.84 KB, image/png)
2015-09-26 08:04 UTC, tommy27
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tommy27 2015-06-25 20:57:12 UTC
Created attachment 116836 [details]
screenshot

see my screenshot... it describes the situation when you type a misspelled word which is identified as an error by the spell checking engine and you right click on it to get autocorrect suggestions.

in the case the misspelled word is "auematnate" instead of "aumentate" but as you may see the autocorrect suggestions that LibO provides two non matching items like "emanate" and "anatema".

if you wanna set the desired "auematnate" --> "aumentate" autocorrect replacement you have to exit the right click menu then go to the toolbar and click "Tools/AutoCorrect Options..." to open the autocorrect replacement table

what I propose it to add an "AutoCorrect Option..." item in the right click spell checking menu show in the screenshot, under the "Always Correct to submenu" just below the autocorrect suggestions along with a line separator...

I mean something like this:

Always correct to > 
emanate
anatema
----------
AutoCorrect Options...


this way when there are no satisfying autocorrect suggestion you are already able to open the autocorrect replacement table without going back to the toolbar

IMHO it would be a time saver
Comment 1 Cor Nouws 2015-06-25 21:49:28 UTC
(In reply to tommy27 from comment #0)

> I mean something like this:
> 
> Always correct to > 
> not desired option #1
> not desired option n
> ----------
> AutoCorrect Options...

I appreciate the idea. Thanks!
Comment 2 Yousuf Philips (jay) (retired) 2015-06-25 23:25:17 UTC
Hey tommy,

If the 'Always Correct to' submenu is related to AutoCorrect, then adding an 'AutoCorrect Options...' as the last entry after a separator would be a suitable thing to do. But i seem to be confused here, as i would assume that correcting a mispelt word should be dictionary related and not autocorrect related.

On a separate noted, I think changing 'Always Correct to' to 'AutoCorrect to', 'Auto Correct to', or 'Automatically Correct to' would be good, so users looking through the menu would remember seeing that word combination elsewhere.
Comment 3 tommy27 2015-06-26 04:38:06 UTC
(In reply to Yousuf (Jay) Philips from comment #2)
> Hey tommy,
> 
> If the 'Always Correct to' submenu is related to AutoCorrect, then adding an
> 'AutoCorrect Options...' as the last entry after a separator would be a
> suitable thing to do. But i seem to be confused here, as i would assume that
> correcting a mispelt word should be dictionary related and not autocorrect
> related.

IMHO there's no confusion...
misspelled words are related to autocorrection...
correct words are instead related to dictionary... 

as you may see there's a "Add to dictionary" item just before "Always correct to" this is needed when you wanna add to dictionary a word that the spellchecker underlines with those squiggly red lines just because it doesn't see it in the dictionary.

so the workflow is:
- right click on word with red squiggly line
- hit "add to dictionary" if the word is correct
- hit the "always correct to" item if the word is mispelled and accept one of the autocorrect suggestions
- my request is to have "autocorrect options" just below the last suggestion in the case none of them is the desired one

> On a separate noted, I think changing 'Always Correct to' to 'AutoCorrect
> to', 'Auto Correct to', or 'Automatically Correct to' would be good, so
> users looking through the menu would remember seeing that word combination
> elsewhere.

the "Always Correct to" item has been called that way since OOo era and user already know and remember what is supposed to do.

so I don't think this is necessary to rename and have another string change to annoy the translators
Comment 4 Adolfo Jayme Barrientos 2015-06-27 07:20:35 UTC
@Tommy: +1.

@Jay: I think it’s fine that misspellings can be corrected by both dictionaries and the AutoCorrect feature, for several reasons.
Comment 5 tommy27 2015-06-27 07:49:49 UTC
so this could be an easy hack, right?
Comment 6 Yousuf Philips (jay) (retired) 2015-06-28 13:46:07 UTC
(In reply to tommy27 from comment #5)
> so this could be an easy hack, right?

Likely could be an easy hack but we have to wait for devs to confirm it and i've added 'needsDevEval' for them to look over it.

The spellcheck popup menu is defined in

http://opengrok.libreoffice.org/xref/core/sw/source/uibase/lingu/olmenu.src

and is likely populated at runtime in

http://opengrok.libreoffice.org/xref/core/sw/source/uibase/lingu/olmenu.cxx

A simple alternative is to have the AutoCorrect options in the first level of the context menu and separate 'Always Correct to' and it into its own section like so.

Ignore
Ignore All
Add to Dictionary
Spelling and Grammar...
- separator -
Always Correct to >
AutoCorrect Options...
- separator -

If this option is favorable, then i believe i can fix it.
Comment 7 tommy27 2015-06-28 16:33:51 UTC
@Jay
I'd like that solution too, so you can move on fixing it
Comment 8 tommy27 2015-09-23 19:04:17 UTC
any news about the feasibility of this hack?
Comment 9 Yousuf Philips (jay) (retired) 2015-09-24 14:43:00 UTC
(In reply to tommy27 from comment #8)
> any news about the feasibility of this hack?

Seems to be harder than i thought, as i was able to get the entry to appear in the context menu, but clicking it wont open the dialog.
Comment 10 Yousuf Philips (jay) (retired) 2015-09-24 14:45:42 UTC
Created attachment 118994 [details]
my patch
Comment 11 Yousuf Philips (jay) (retired) 2015-09-24 14:47:24 UTC
@Samuel, @Maxim: Can you amend my patch to get it to work. Thanks.
Comment 12 Commit Notification 2015-09-24 17:41:40 UTC
Yousuf Philips committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=837c50d3d8390da359c5f07da3fdd87fc60d9158

tdf#92341 Add AutoCorrect entry in spellcheck context menu

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Samuel Mehrbrodt (allotropia) 2015-09-24 17:43:35 UTC
Jay, could you take care to communicate the changes to the help etc?
Comment 14 tommy27 2015-09-25 05:07:10 UTC
works fine with LibO  5.1.0.0.alpha1+ (x64)
Build ID: 8c7ba16ba4bdedb4354f342b20d5a5de8a132b48
TinderBox: Win-x86_64@62-TDF, Branch:MASTER, Time: 2015-09-24_21:53:09
Locale: it-IT (it_IT)

thanks to Jay and Samuel, you did a good job!!!

probably this enhancement should be shown in:
https://wiki.documentfoundation.org/ReleaseNotes/5.1
Comment 15 Yousuf Philips (jay) (retired) 2015-09-25 09:07:28 UTC
(In reply to Samuel Mehrbrodt from comment #13)
> Jay, could you take care to communicate the changes to the help etc?

Thanks Samuel. Dont know enough about the help to know how context menus are handled. @Adolfo: Any idea about this?

(In reply to tommy27 from comment #14)
> probably this enhancement should be shown in:
> https://wiki.documentfoundation.org/ReleaseNotes/5.1

Please take a screenshot and add it. ;D
Comment 16 tommy27 2015-09-26 08:04:55 UTC
Created attachment 119031 [details]
screenshot for wiki 5.1 release notes

here's a screenshot showing an underlined word which has no good autocorrect suggestions from the right click menu

in this case the user could click the new "Autocorrect options..." item to load the autocorrect replacement list.

you can use this screenshot but I'd prefer an english mother tongue user to write the description for the 5.1 wiki release notes
Comment 17 Yousuf Philips (jay) (retired) 2015-09-26 08:20:05 UTC
@Samuel: The problem with RetrieveLabelFromCommand() is that it doesnt bring over the dots at the end of the entry or the accelerator.

Also noticed that non-Writer apps also have a similar context menu that should also be fixed, so i'll create a patch for that as well.
Comment 18 tommy27 2015-09-26 08:44:25 UTC
good point Jay. 
let's set this as REOPENED waiting for similar patches to be applied to Impress, Draw and Calc right click menus
Comment 19 Yousuf Philips (jay) (retired) 2015-09-26 14:27:02 UTC
Just like the last patch, i was able to get the entry into the context menu, but unable to get the entry to open the dialog. Hope you can fix the rest @Samuel as the code you added the last time didnt work with adding it into editeng/source/editeng/editview.cxx. :D

https://gerrit.libreoffice.org/#/c/18887/
Comment 20 Commit Notification 2015-10-01 09:32:42 UTC
Yousuf Philips committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=81f94235b08996f48485959adc1f3a45e65a3c7f

tdf#92341 Add AutoCorrect entry in context menu for non-swriter

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 21 Commit Notification 2015-10-01 12:55:37 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a8a812997f654b47cde547cbf3d97684cd06a9d3

tdf#92341 Make Autocorrect entry actually work

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 22 tommy27 2015-10-02 04:40:06 UTC
edited 5.1.0 release notes with screenshot and description here at:
https://wiki.documentfoundation.org/ReleaseNotes/5.1#AutoCorrect_context_menu

please feel free to edit the text in better english.
Comment 23 Samuel Mehrbrodt (allotropia) 2015-10-05 06:30:36 UTC
(In reply to Yousuf (Jay) Philips from comment #17)
> @Samuel: The problem with RetrieveLabelFromCommand() is that it doesnt bring
> over the dots at the end of the entry or the accelerator.
> 

Is there still something to be changed? If so, could you prepare a patch for this, Jay?
Comment 24 tommy27 2015-10-07 19:37:55 UTC
tested with LibO 5.1.0.0.alpha1+
Build ID: f830600ece806ec365a4839e79afabe183c5e36d
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-10-06_22:49:09
Locale: it-IT (it_IT)

I see the dots in Calc, Draw and Impress (AutoCorrect Options...)

while I don't see the dots in Writer (AutoCorrect Options)
Comment 25 Yousuf Philips (jay) (retired) 2015-10-08 10:56:07 UTC
(In reply to tommy27 from comment #24)
> I see the dots in Calc, Draw and Impress (AutoCorrect Options...)
> 
> while I don't see the dots in Writer (AutoCorrect Options)

Yes Samuel is looking into it, as i mentioned this in comment 17 that the command to get the string from elsewhere isnt pulling in the accelerator and dots, while in the non-writer one, i wrote the label in the context menu code.
Comment 26 Maxim Monastirsky 2015-10-08 11:13:52 UTC
(In reply to Yousuf (Jay) Philips from comment #25)
> isnt pulling in the accelerator
It shouldn't, as no context menu anywhere has any accelerators.
Comment 27 Maxim Monastirsky 2015-10-08 11:20:26 UTC
(In reply to Yousuf (Jay) Philips from comment #17)
> @Samuel: The problem with RetrieveLabelFromCommand() is that it doesnt bring
> over the dots at the end of the entry
The problem is that RetrieveLabelFromCommand takes the "Name" property instead of "Label".
Comment 28 Yousuf Philips (jay) (retired) 2015-10-08 12:50:31 UTC
(In reply to Maxim Monastirsky from comment #26)
> It shouldn't, as no context menu anywhere has any accelerators.

I must be going blind as i see accelerators in all context menus.
https://wiki.documentfoundation.org/File:Autocorrect_context_menu.png

(In reply to Maxim Monastirsky from comment #27)
> (In reply to Yousuf (Jay) Philips from comment #17)
> > @Samuel: The problem with RetrieveLabelFromCommand() is that it doesnt bring
> > over the dots at the end of the entry
> The problem is that RetrieveLabelFromCommand takes the "Name" property
> instead of "Label".

Would be useful to have a command to retrieve the label so that we dont have to duplicate the string in the context menu and translators dont have to translate it twice.
Comment 29 Maxim Monastirsky 2015-10-08 13:07:57 UTC
(In reply to Yousuf (Jay) Philips from comment #28)
> I must be going blind as i see accelerators in all context menus.
> https://wiki.documentfoundation.org/File:Autocorrect_context_menu.png
Ah sorry, I thought you mean like CTRL+something.

> (In reply to Maxim Monastirsky from comment #27)
> Would be useful to have a command to retrieve the label
RetrieveLabelFromCommand is already up to it. We just need to replace the "Name" string inside it to a "Label". Will look into it once my build will finish.
Comment 30 Commit Notification 2015-10-08 14:12:30 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=998090bf54a8afd5fe9cfc3efdd30864c8e689e9

tdf#92341 Hide in grammar menu and fix label

It will be available in 5.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 31 Yousuf Philips (jay) (retired) 2015-10-08 18:35:25 UTC
(In reply to Maxim Monastirsky from comment #29)
> > (In reply to Maxim Monastirsky from comment #27)
> > Would be useful to have a command to retrieve the label
> RetrieveLabelFromCommand is already up to it. We just need to replace the
> "Name" string inside it to a "Label". Will look into it once my build will
> finish.

As RetrieveLabelFromCommand was previously used elsewhere, it would be good to make sure that the change doesnt bring in issues for when other devs wanted the old behaviour. It would be useful to also have RetreiveNameFromCommand() for when that is needed.
Comment 32 Maxim Monastirsky 2015-10-08 18:38:27 UTC
(In reply to Yousuf (Jay) Philips from comment #31)
> As RetrieveLabelFromCommand was previously used elsewhere,
It isn't used elsewhere.
Comment 33 Yousuf Philips (jay) (retired) 2015-11-05 22:31:46 UTC
(In reply to Maxim Monastirsky from comment #32)
> (In reply to Yousuf (Jay) Philips from comment #31)
> > As RetrieveLabelFromCommand was previously used elsewhere,
> It isn't used elsewhere.

@Maxim: Was skimming through some code and noticed that we have xUICommands->getByName() and wondered if RetrieveLabelFromCommand was doing the same thing.

http://opengrok.libreoffice.org/xref/core/sfx2/source/dialog/templdlg.cxx#2502
Comment 34 Maxim Monastirsky 2015-11-05 22:47:14 UTC
(In reply to Yousuf (Jay) Philips from comment #33)
> @Maxim: Was skimming through some code and noticed that we have
> xUICommands->getByName() and wondered if RetrieveLabelFromCommand was doing
> the same thing.
Yes:

http://opengrok.libreoffice.org/xref/core/sw/source/uibase/lingu/olmenu.cxx#242