summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/tbunosearchcontrollers.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-04-30 12:29:45 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-04-30 16:17:32 +0200
commitc90792cf4309557981d1f89febeff9157fd93b0c (patch)
tree48c778c6deb7e2b059804040a75d167eeffcf8fb /svx/source/tbxctrls/tbunosearchcontrollers.cxx
parent857caa5fc69b92e781457a1b67a89aa051c2d70f (diff)
Related: tdf#138281 move grab_focus to ActivateFind
and remove the explicit KeyInput callback handling of "KEY_RETURN" in favor of the ActivateHdl callback which Entry emits from its built-in KeyInput handler Change-Id: Ie6ddc8d73345400586418f2495958b14ab61c7d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114907 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/tbxctrls/tbunosearchcontrollers.cxx')
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index c75c3edb03ef..c247e313452a 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -298,11 +298,10 @@ IMPL_LINK(FindTextFieldControl, KeyInputHdl, const KeyEvent&, rKeyEvent, bool)
else if ( bMod1 && nCode == KEY_F )
m_xWidget->select_entry_region(0, -1);
- // Execute the search when Return, Ctrl-G or F3 pressed
- else if ( KEY_RETURN == nCode || (bMod1 && (KEY_G == nCode)) || (KEY_F3 == nCode) )
+ // Execute the search when Ctrl-G or F3 pressed (in addition to ActivateHdl conditions)
+ else if ( (bMod1 && (KEY_G == nCode)) || (KEY_F3 == nCode) )
{
ActivateFind(bShift);
- m_xWidget->grab_focus();
bRet = true;
}
else
@@ -324,8 +323,11 @@ void FindTextFieldControl::ActivateFind(bool bShift)
ToolBox* pToolBox = static_cast<ToolBox*>(pWindow);
impl_executeSearch(m_xContext, m_xFrame, pToolBox, bShift);
+
+ m_xWidget->grab_focus();
}
+// Execute the search when activated, typically due to "Return"
IMPL_LINK_NOARG(FindTextFieldControl, ActivateHdl, weld::ComboBox&, bool)
{
if (isDisposed())