summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2024-06-28 15:49:22 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2024-07-08 15:43:12 +0200
commit2b995b4b069843aafe2bea353c0138b8a8aca237 (patch)
tree071f262b0d9df41692228a919c19b0fdfd101ae3 /cui
parentbacc00112dde35ba4bbdfad3850aed19619b191c (diff)
tdf#96787 AutoCorrect: find item with ".*" and between :colons:
It was very hard to disable autocorrection of (c)->© and other AutoCorrect items, because the searched Replace string "(c)" etc. didn't jump the list cursor to the corresponding ".*(c)" item. Now skip ".*" pattern matching marks, also colon (emoji replacement) characters, so the list cursor jumps to the line ".*(c)"->© typing only "(c" etc., allowing users to press Delete to disable its autocorrection without knowing about the special AutoCorrect patterns. Follow-up to commit 50be3fa1f0f3b8870af5bda88b65f835ef37d77e "tdf#141773 AutoCorrect: fix broken [All] dictionaries". Change-Id: I72be1ecb2fdc5ae67c72727ce7fbd70b28a4125b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169714 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit e5507c8a003328f629ae924fbba14155c13e7a12) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169733 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/autocdlg.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 87e803f677b4..393f9f79d872 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -1145,7 +1145,9 @@ IMPL_LINK(OfaAutocorrReplacePage, ModifyHdl, weld::Entry&, rEdt, void)
else
{
aTestStr = pCharClass->lowercase( aTestStr );
- if( aTestStr.startsWith(aWordStr) && !bTmpSelEntry )
+ if( !bTmpSelEntry && ( aTestStr.startsWith(aWordStr)
+ // find also with ".*" and between :colons:
+ || aTestStr.replaceAll(".*","").replaceAll(":", "").startsWith(aWordStr) ) )
{
m_xReplaceTLB->scroll_to_row(rIter);
bTmpSelEntry = true;