Bug 126814 - Spell-check "correct all" disabled when parser encounters a different mis-spelling
Summary: Spell-check "correct all" disabled when parser encounters a different mis-spe...
Status: RESOLVED DUPLICATE of bug 91151
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.7.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-10 16:52 UTC by CP
Modified: 2025-07-15 08:33 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CP 2019-08-10 16:52:50 UTC
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.
Comment 1 Jean-Baptiste Faure 2019-08-11 18:16:47 UTC
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
Comment 2 Stéphane Guillou (stragu) 2024-06-11 03:24:51 UTC

*** This bug has been marked as a duplicate of bug 91151 ***
Comment 3 Justin L 2025-07-03 18:16:13 UTC
(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.
Comment 4 Justin L 2025-07-09 18:23:37 UTC
(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.
Comment 5 Justin L 2025-07-11 16:05:09 UTC
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