From 2b995b4b069843aafe2bea353c0138b8a8aca237 Mon Sep 17 00:00:00 2001 From: László Németh Date: Fri, 28 Jun 2024 15:49:22 +0200 Subject: tdf#96787 AutoCorrect: find item with ".*" and between :colons: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit e5507c8a003328f629ae924fbba14155c13e7a12) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169733 Reviewed-by: Christian Lohmaier --- cui/source/tabpages/autocdlg.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cui') 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; -- cgit