[Libreoffice-commits] core.git: sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 15 09:59:56 UTC 2021
sw/source/core/txtnode/txtedt.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 2d496c3b1c0912c747bf7a83a4a982fd2dc3a801
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 15 10:08:00 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jul 15 11:59:21 2021 +0200
tdf#119695 only add word to autocomplete suggestions when the cursor leaves it
so that incomplete words are not added as autocomplete candidates even
if they form a legal word. This is similar to what we do for marking
words is misspelt
Change-Id: Ib6b209b68bbcf51fa24ea5c4d995579acf682e52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118974
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 8913fbd94810..c98946a40113 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1357,7 +1357,11 @@ SwRect SwTextFrame::AutoSpell_(SwTextNode & rNode, sal_Int32 nActPos)
}
else if( bAddAutoCmpl && rACW.GetMinWordLen() <= rWord.getLength() )
{
- rACW.InsertWord( rWord, rDoc );
+ // tdf#119695 only add the word if the cursor position is outside the word
+ // so that the incomplete words are not added as autocomplete candidates
+ bool bCursorOutsideWord = nActPos > nBegin + nLen || nActPos < nBegin;
+ if (bCursorOutsideWord)
+ rACW.InsertWord(rWord, rDoc);
}
}
}
More information about the Libreoffice-commits
mailing list