sw/source/core/crsr/bookmark.cxx | 9 +++++++++ sw/source/core/inc/bookmark.hxx | 1 + sw/source/uibase/docvw/edtwin.cxx | 8 ++++++++ 3 files changed, 18 insertions(+)
New commits: commit 10b360a7b773b4b03243002bfb205e5997263741 Author: Justin Luth <jl...@mail.com> AuthorDate: Mon Oct 17 22:24:06 2022 -0400 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Mar 6 08:27:30 2023 +0000 related tdf#151548 sw: KEY_DOWN access to FieldmarkWithDropDownButton There was no way to use only a keyboard to access dropdown formfields. (This should also work for LO's unique DateFieldMark - however you get one of those.) Change-Id: I2b0b2bd38a43817bbbf1801910815ebe87614f94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141488 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147680 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx index 50557f044fdc..1cd5752e2bf1 100644 --- a/sw/source/core/crsr/bookmark.cxx +++ b/sw/source/core/crsr/bookmark.cxx @@ -762,6 +762,15 @@ namespace sw::mark m_pButton.disposeAndClear(); } + void FieldmarkWithDropDownButton::LaunchPopup() + { + if (!m_pButton) + return + + m_pButton->Invalidate(); + m_pButton->LaunchPopup(); + } + DropDownFieldmark::DropDownFieldmark(const SwPaM& rPaM, const OUString& rName) : FieldmarkWithDropDownButton(rPaM) { diff --git a/sw/source/core/inc/bookmark.hxx b/sw/source/core/inc/bookmark.hxx index 7c5ce9361ca9..334d13c2d663 100644 --- a/sw/source/core/inc/bookmark.hxx +++ b/sw/source/core/inc/bookmark.hxx @@ -286,6 +286,7 @@ namespace sw::mark { virtual void ShowButton(SwEditWin* pEditWin) = 0; virtual void RemoveButton(); + virtual void LaunchPopup(); protected: VclPtr<FormFieldButton> m_pButton; diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 615278a769b3..6d2ea5c6a1fd 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -65,6 +65,7 @@ #include <sfx2/lokhelper.hxx> #include <editeng/acorrcfg.hxx> +#include <bookmark.hxx> #include <SwSmartTagMgr.hxx> #include <edtdd.hxx> #include <edtwin.hxx> @@ -1868,6 +1869,13 @@ KEYINPUT_CHECKTABLE: bool bMod1 = 0 != (rKeyCode.GetModifier() & KEY_MOD1); if(!bMod1) { + ::sw::mark::IFieldmark* pMark = rSh.GetCurrentFieldmark(); + if (auto pDropDown = dynamic_cast<FieldmarkWithDropDownButton*>(pMark)) + { + pDropDown->LaunchPopup(); + eKeyState = SwKeyState::End; + break; + } eFlyState = SwKeyState::Fly_Change; nDir = MOVE_DOWN_BIG; }