Bug 119695 - AutoCorrect - Word completion adds multiple words to the autocompletion list for typing one word with spell-checker enabled
Summary: AutoCorrect - Word completion adds multiple words to the autocompletion list ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0.0.5 release
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.3.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: AutoCorrect-Complete
  Show dependency treegraph
 
Reported: 2018-09-04 14:35 UTC by Telesto
Modified: 2021-08-19 06:28 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Bibisect log (3.40 KB, text/plain)
2021-07-14 20:44 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2018-09-04 14:35:27 UTC
Description:
The fact that multiple words are added to autocomplete while typing 1 word. Example: painlessness adds: painless & painlessness. 'proper' suggestions, however it's flooding the suggestion list with words never used in the document

Steps to Reproduce:
1. Open a Writer document
2. Enable Word completion (tools autocorrection Auto correction options -> Word completion
3. Type painlessness 3 times


Actual Results:
The 3 time will be suggested: painless & painlessness

Expected Results:
Only painlessness (same as with spell-checker disabled)


Reproducible: Always


User Profile Reset: No



Additional Info:
Repro with
Version: 6.2.0.0.alpha0+
Build ID: 22f2d8c41aa0a0a4cfa215c07ec06ae38cde7da8
CPU threads: 4; OS: Windows 6.3; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-08-29_04:32:58
Locale: pl-PL (nl_NL); Calc: CL

and with
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 1 Dieter 2018-09-04 15:27:38 UTC
Can't confirm this with

Version: 6.2.0.0.alpha0+ (x64)
Build ID: 414ef6cb187dd3bbcc917dbedf3c0c1cc8668f60
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-08-21_00:13:04
Locale: en-US (de_DE); Calc: CL

Automatic spell checking is enabled
Comment 2 Telesto 2018-09-04 17:43:08 UTC
(In reply to Dieter Praas from comment #1)
> Can't confirm this with
> 
> Version: 6.2.0.0.alpha0+ (x64)
> Build ID: 414ef6cb187dd3bbcc917dbedf3c0c1cc8668f60
> CPU threads: 4; OS: Windows 10.0; UI render: GL; 
> TinderBox: Win-x86_64@42, Branch:master, Time: 2018-08-21_00:13:04
> Locale: en-US (de_DE); Calc: CL
> 
> Automatic spell checking is enabled

Document set to English dictionary, I assume?
Comment 3 Dieter 2018-09-04 18:26:37 UTC
Can confirm it with

Version: 6.0.6.2 (x64)
Build-ID: 0c292870b25a325b5ed35f6b45599d2ea4458e77
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: group
Comment 4 QA Administrators 2019-09-05 09:35:04 UTC Comment hidden (obsolete, spam)
Comment 5 Telesto 2021-07-14 08:10:44 UTC
Not sure if this being some weird exception..
Hondenuitlaatservice.. gets split in hondenuitlaat en hondenuitlaatservice but not in 4.4.7.2
Comment 6 Telesto 2021-07-14 20:44:43 UTC
Created attachment 173586 [details]
Bibisect log

Bisected to
author	Caolán McNamara <caolanm@redhat.com>	2015-01-07 13:13:12 +0000
committer	Caolán McNamara <caolanm@redhat.com>	2015-01-07 13:14:02 +0000
commit fd0577e6b65cfd948b2fbe16fa1bd06fe0c635b9 (patch)
tree 973565f55086d5a1a01bcd22b9b1893d4e827acf
parent 28b61d7a2839aebc7458312d312dc6cdb03a8b3f (diff)
Resolves: fdo#73165 don't restart timer if already running
If the timer is already running and you restart it then it starts counting down
again so the timeout occasion just keeps getting pushed out indefinitely.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=fd0577e6b65cfd948b2fbe16fa1bd06fe0c635b9
Comment 7 Telesto 2021-07-14 20:48:47 UTC
I typed appartementencomplex (Dutch). It splits in appartement| appartementen and appartementencomplex after the given commit rather easily

The catching of auto-complete is apparently time-sensitive. So if i type appartement - wait a sec - go on with 'encomplex'  it will split in two words (happens also in older versions)

however previously autocomplete would have a delay of second before the splitting would occur. Currently even at normal typing speed, splitting occurs.
Comment 8 Telesto 2021-07-14 20:49:48 UTC
Adding CC: to Caolán McNamara
Comment 9 Telesto 2021-07-14 20:53:29 UTC
The odd part, this commit is backported into 4.4 branch.. where did work perfectly fine.. 

So there might be  timer change somewhere.. which makes 4.4 behave differently compared to 5.0?
Comment 10 Caolán McNamara 2021-07-15 09:06:00 UTC
possibly:

commit 4c91e94e892943ef5e031d65f6f42864233cb4cd
Date:   Wed Sep 9 10:30:04 2015 +0200

    tdf#92036: sw: fix idle spelling loop

either way, the state pre fd0577e6b65cfd948b2fbe16fa1bd06fe0c635b9 isn't a desirable state to return to.

The words are inserted into the autocomplete list at sw/source/core/txtnode/txtedt.cxx:1360 at SwTextFrame::AutoSpell_

we could follow the same logic as the spellchecking rule for marking misspelling by only adding words to the autocomplete list when the cursor is not in the word so words still being edited at not candidates until the word is finished
Comment 11 Commit Notification 2021-07-15 10:00:34 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2d496c3b1c0912c747bf7a83a4a982fd2dc3a801

tdf#119695 only add word to autocomplete suggestions when the cursor leaves it

It will be available in 7.3.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 12 Dieter 2021-08-19 06:28:48 UTC
VERIFIED with

Version: 7.2.0.3 (x64) / LibreOffice Community
Build ID: 2a7ea282da28d665a7dc086360567b4aea27bf08
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: threaded

Caolán, thanks for fixing it!