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>
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index c75c3ed..c247e31 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())