[Libreoffice-commits] core.git: svx/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 30 14:18:09 UTC 2021


 svx/source/tbxctrls/tbunosearchcontrollers.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit c90792cf4309557981d1f89febeff9157fd93b0c
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Apr 30 12:29:45 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Apr 30 16:17:32 2021 +0200

    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 at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

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())


More information about the Libreoffice-commits mailing list