sc/source/ui/formdlg/dwfunctr.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
New commits: commit 1f26aa7f42795aed775646cbb616f5ee4e60326c Author: Ilmari Lauhakangas <[email protected]> AuthorDate: Sat Jun 22 22:04:39 2024 +0300 Commit: Ilmari Lauhakangas <[email protected]> CommitDate: Mon Jun 24 17:57:06 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 <[email protected]> Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <[email protected]> diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index 690db4c8aac1..504703f3b478 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;
