summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2022-10-17 22:24:06 -0400
committerMiklos Vajna <vmiklos@collabora.com>2023-03-06 08:27:30 +0000
commit10b360a7b773b4b03243002bfb205e5997263741 (patch)
tree4e8e02f2177920d5805479bd2f7a70f24c5b69e3 /sw
parentb2cb681474f892e43e3f8647e2b133ad989995c6 (diff)
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 <jluth@mail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147680 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/bookmark.cxx9
-rw-r--r--sw/source/core/inc/bookmark.hxx1
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx8
3 files changed, 18 insertions, 0 deletions
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;
}