Problem description:- When a document-wide spell-check is launched by positioning the cursor to the beginning of the document and using F7 to locate spelling errors, it is possible to instruct the process to auto-correct all instances of a mis-spelled word. However, if the spell-check encounters a different, mis-spelled word, the previous instruction seems to be voided/lost. Example: consider the following text:- -=-=-=- The first color was red. The second color was green. The thrid color was blue. The fourth color was gold. -=-=-=- If we wished to spell-check this text, using a British-English dictionary, we would expect all instances of "color" to be corrected to "colour", *if*, we instructed the spell-check to auto-correct when it encounters the first spelling error on the first line of text. However, on the 3rd line of text we have a different spelling error: "thrid" instead of "third". The spell-checker will encounter this error and offer suggested corrections as we would expect. However, after resolving this different error, the spell-checker will "forget" that it needs to auto-correct all following instances of "color" to "colour" and this instruction will need to be repeated. As an aside, the alternate approach, "Ignore all" does seem to work as expected - once this option is taken, all future examples of an unrecognised word will be ignored. Just for clarification... The text I am testing in this example is content that has been created by OCR-scanning some old documents using a CZUR book scanner and its integrated OCR software. I make this distinction because it is of course possible to configure Write to "auto-correct" (which I have done for "color"). In that case, auto-correct works perfectly if I type in the word incorrectly at the cursor, just not when parsing a document that contains instances of spelling errors.
Not reproducible for me with LO 6.3.1.0+ and LO 6.2.5.0+ under Ubuntu. When the spellchecker encounter the error on "third", if I click Correct, it corrects this error and then the remaining errors on colour. Please could you install an up-to-date version of LibreOffice and try again ? Setting status to RESOLVED WorksForMe. Please, set it back to UNCONFIRMED if you can reproduce the problem with a recent version (6.2.5 or 6.3.0). Best regards. JBF
*** This bug has been marked as a duplicate of bug 91151 ***
(In reply to Jean-Baptiste Faure from comment #1) > Not reproducible for me with LO 6.3.1.0+ and LO 6.2.5.0+ under Ubuntu. > When the spellchecker encounter the error on "third", if I click Correct, it > corrects this error and then the remaining errors on colour. Me too. It worked like this already in OOo 3.3. I only noticed needing to re-CorrectAll if I manually edited the document while the spell-checker was running. But as long as I stayed in the spell checker dialog things worked as expected. Hmm, but I did run into the reported issue following certain steps to reproduce: -pasted the four lines into a new document -placed the cursor on the fourth line, and THEN pressed F7 to spell check. -Correct-All color -> colour -accept to continue spell checking at the beginning of the document At this point, lines 1 and 2 have been auto-corrected and the dialog is asking about spell checking "thrid". HOWEVER, the dialog is in "resume" mode. So I have to accept "resume" before I can continue spell checking, and now the CorrectAll list has been cleared.
(In reply to Justin L from comment #3) > HOWEVER, the dialog is in "resume" mode. > So I have to accept "resume" before I can continue spell checking, and > now the CorrectAll list has been cleared. Resume intentionally clears the list. See cui/source/dialogs/SpellDialog.cxx IgnoreHdl calling Impl_Restore which calls the session's LinguMgr::GetChangeAllList()->clear(). Resume is needed when SwSpellDialogChildWindow::GetFocus calls InvalidateSpellDialog - which is when the cursor position has changed (possibly in a different document). Note that LinguMgr's list is a session list. In other words, it would affect other documents open at the same time if both were doing spell checking. (STARTING a spell check in another document also resets the ChangeAllList list.) We don't want to avoid resetting ChangeAllList when resuming because during the lose of focus we might have filled the list with another document's spell check, and definitely that should not affect our document.
I'm completely failing to get comment 3 solved. I would have thought that something like the following would have worked: + GetController()->getDialog()->grab_focus(); + GetController()->Activate(); Since it didn't, I tried to listen for ADD_ENTRY events in the dictionary. If there were none, then there would be no need to clear it. Although the idea seems fine, my implementation is wrong - crashing all the time... https://gerrit.libreoffice.org/c/core/+/187667
Here is the problem: When the dialog regains focus, it checks to see if the cursor position has changed, and if so, then it flushes the ChangeAll list. So, if you click somewhere inside the document, you almost certainly are going to move the cursor - and thus RESUME shows up and flushes all of the collected "Correct All" words. https://gerrit.libreoffice.org/c/core/+/191554 should take care of that.
First, I have https://gerrit.libreoffice.org/c/core/+/187667 It solves the scenario where two apps are spell checking simultaneously and introducing correct-all words that can affect the other apps' spell check results. Steps to reproduce: 1. open 91151_correctAll.odt (attachment 201641 [details] from bug 91151 comment 17) 2. select everything and copy to clipboard (Ctrl-a, Ctrl-c) 3. start a new spreadsheet in calc. Paste from the clipboard (Ctrl-v) 4. start a spell check in calc [which clears the ChangeAll list] (F7) 5. switch to Writer and start a spell check there too [which again clears ChangeAll] 6. In Writer - Correct All for dogg, catt, frogg 7. In Calc (notice no "resume" requested)- ignore once for "dogg". At this point, Calc notices stuff in the correct-all list and the remaining dogg, catt, and frogg's will be corrected (until a new mis-spelled word is seen). That's not good - so my patch flushes the (shared) correct-all list if another spell-check had added entries.
Sorry - I'm mixing up which patch solves which problem. My first patch https://gerrit.libreoffice.org/c/core/+/187667 lays the groundwork. That solves the case where a moved cursor doesn't need to flush the correct-all list. Steps to reproduce are sketched out in comment 6. 1. open 91151_correctAll.odt (attachment 201641 [details] from bug 91151 comment 17) 2. start a spell check (F7) 3. Correct All for "dogg" - Notice that the first two dogg's have been corrected, and the spell checker window is asking about catt, AND SHOWING A CORRECTED "dog" 4. change the cursor position by clicking in the document one of the "frogg"s 5. click back in the spell checker and "Resume" the spell check Notice that the spell checker window no longer has a corrected "dog". CorrectAll for catt, and now it prompts for dogg again (because the correct-all list was flushed).
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/506012898d0a41acbdefbe0a9b5a735df21c89ef tdf#126814 cui SpellDialog: don't clear ChangeAll dict unless ADD_ENTRY It will be available in 26.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.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/331e6fa45f12bb47e24354256329f4d04acba708 tdf#126814 SpellDialogChildWindow: force resume if CorrectAll modified It will be available in 26.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.