summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-04-05 16:44:39 +0100
committerAndras Timar <andras.timar@collabora.com>2022-04-06 14:00:16 +0200
commit317eb582596e776947ab8a969976d42dd0fcfa37 (patch)
tree534e576587b54319b6bdcface5c9171c452e23d2 /sfx2
parent3f0b989a810441ad7145467a8f8c6d61da3b341e (diff)
Resolves: rhbz#2069486 classic help index entry autocompletes on del/backspace
when it shouldn't Change-Id: I90fa338479e0d5612d7b09f94c45e356ea71f89e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132596 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/newhelp.cxx17
-rw-r--r--sfx2/source/appl/newhelp.hxx1
2 files changed, 17 insertions, 1 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index ee4e2c32b955..9312a83ccd04 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -397,6 +397,7 @@ IndexTabPage_Impl::IndexTabPage_Impl(weld::Widget* pParent, SfxHelpIndexWindow_I
, bIsActivated(false)
, nRowHeight(m_xIndexList->get_height_rows(1))
, nAllHeight(0)
+ , nLastCharCode(0)
{
m_xIndexList->set_size_request(m_xIndexList->get_approximate_digit_width() * 30, -1);
@@ -466,7 +467,19 @@ IMPL_LINK_NOARG(IndexTabPage_Impl, TreeChangeHdl, weld::TreeView&, void)
IMPL_LINK_NOARG(IndexTabPage_Impl, EntryChangeHdl, weld::Entry&, void)
{
- aAutoCompleteIdle.Start();
+ switch (nLastCharCode)
+ {
+ case css::awt::Key::DELETE_WORD_BACKWARD:
+ case css::awt::Key::DELETE_WORD_FORWARD:
+ case css::awt::Key::DELETE_TO_BEGIN_OF_LINE:
+ case css::awt::Key::DELETE_TO_END_OF_LINE:
+ case KEY_BACKSPACE:
+ case KEY_DELETE:
+ break;
+ default:
+ aAutoCompleteIdle.Start();
+ break;
+ }
}
IMPL_LINK(IndexTabPage_Impl, KeyInputHdl, const KeyEvent&, rKEvt, bool)
@@ -531,6 +544,8 @@ IMPL_LINK(IndexTabPage_Impl, KeyInputHdl, const KeyEvent&, rKEvt, bool)
// m_bTreeChange = false;
return true;
}
+
+ nLastCharCode = nCode;
return false;
}
diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx
index 7d22336ecf83..f26bf93379a9 100644
--- a/sfx2/source/appl/newhelp.hxx
+++ b/sfx2/source/appl/newhelp.hxx
@@ -102,6 +102,7 @@ private:
bool bIsActivated;
int nRowHeight;
int nAllHeight;
+ sal_uInt16 nLastCharCode;
void InitializeIndex();
void ClearIndex();