sc/source/ui/formdlg/dwfunctr.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 3bf923428f75506e16a99805c00c1cc8eff28f40
Author:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
AuthorDate: Sat Jun 22 22:04:39 2024 +0300
Commit:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
CommitDate: Tue Jun 25 08:10:04 2024 +0200

    tdf#161743 Calc Sidebar Functions deck: move focus to document upon
    
    Esc while in empty search field
    
    Change-Id: I7bb6aaeb69712b293c74bfcf34ab65c4869c860c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169352
    Tested-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
    Tested-by: Jenkins
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
    (cherry picked from commit 1f26aa7f42795aed775646cbb616f5ee4e60326c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169442
    Reviewed-by: Jim Raykowski <rayk...@gmail.com>

diff --git a/sc/source/ui/formdlg/dwfunctr.cxx 
b/sc/source/ui/formdlg/dwfunctr.cxx
index 355a820f4f87..96df2105bfbe 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -443,6 +443,20 @@ IMPL_LINK(ScFunctionWin, KeyInputHdl, const KeyEvent&, 
rEvent, bool)
         break;
     case KEY_ESCAPE:
         {
+            // Escape in an empty search field should move focus to the 
document,
+            // adhering to Sidebar guidelines
+            if (m_xSearchString->get_text().isEmpty())
+            {
+                if (SfxViewShell* pCurSh = SfxViewShell::Current())
+                {
+                    vcl::Window* pShellWnd = pCurSh->GetWindow();
+
+                    if (pShellWnd)
+                        pShellWnd->GrabFocusToDocument();
+                }
+                bHandled = true;
+                break;
+            }
             m_xSearchString->set_text(u""_ustr);
             UpdateFunctionList(u""_ustr);
             bHandled = true;

Reply via email to