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 0bf8a781ffec13b4fbcb96a2e9349b423a92cb1d Author: Justin Luth <jl...@mail.com> AuthorDate: Mon Oct 17 22:24:06 2022 -0400 Commit: Justin Luth <jl...@mail.com> CommitDate: Tue Oct 18 12:43:59 2022 +0200 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> diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx index 0d61d684914c..cebe18788537 100644 --- a/sw/source/core/crsr/bookmark.cxx +++ b/sw/source/core/crsr/bookmark.cxx @@ -661,6 +661,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 bc77ccd8ab91..431f643da9c5 100644 --- a/sw/source/core/inc/bookmark.hxx +++ b/sw/source/core/inc/bookmark.hxx @@ -274,6 +274,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 35628a0ce50a..3b9a556e6912 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -70,6 +70,7 @@ #include <sfx2/lokhelper.hxx> #include <editeng/acorrcfg.hxx> +#include <bookmark.hxx> #include <SwSmartTagMgr.hxx> #include <edtdd.hxx> #include <edtwin.hxx> @@ -1888,6 +1889,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; }