summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-06-15 14:55:28 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-06-15 18:06:35 +0200
commit1067bf8a78a03b67f769761753b5a7226f611f9f (patch)
treea92f46942ec1c6d02a3dd0f95d006bbd24114eaa /sw
parentd6533cb372bd75f839674fd36640fa466d496efd (diff)
consume tab key press in single-widget dropdown
Change-Id: Ie23fa35d29c20910514f3aaad095521f1588702b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96367 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/DropDownFormFieldButton.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/source/core/crsr/DropDownFormFieldButton.cxx b/sw/source/core/crsr/DropDownFormFieldButton.cxx
index 10664a027bba..9d7453dae5ff 100644
--- a/sw/source/core/crsr/DropDownFormFieldButton.cxx
+++ b/sw/source/core/crsr/DropDownFormFieldButton.cxx
@@ -10,6 +10,7 @@
#include <DropDownFormFieldButton.hxx>
#include <edtwin.hxx>
#include <bookmrk.hxx>
+#include <vcl/event.hxx>
#include <vcl/floatwin.hxx>
#include <vcl/InterimItemWindow.hxx>
#include <vcl/settings.hxx>
@@ -53,6 +54,7 @@ private:
sw::mark::IFieldmark* m_pFieldmark;
DECL_LINK(MyListBoxHandler, weld::TreeView&, bool);
+ DECL_STATIC_LINK(SwFieldDialog, KeyInputHdl, const KeyEvent&, bool);
public:
SwFieldDialog(SwEditWin* parent, sw::mark::IFieldmark* fieldBM, long nMinListWidth);
@@ -109,6 +111,7 @@ SwFieldDialog::SwFieldDialog(SwEditWin* parent, sw::mark::IFieldmark* fieldBM, l
lbSize.setWidth(std::max(lbSize.Width(), nMinListWidth));
m_xListBox->SetSizePixel(lbSize);
rTreeView.connect_row_activated(LINK(this, SwFieldDialog, MyListBoxHandler));
+ rTreeView.connect_key_press(LINK(this, SwFieldDialog, KeyInputHdl));
m_xListBox->Show();
rTreeView.grab_focus();
@@ -147,6 +150,16 @@ IMPL_LINK(SwFieldDialog, MyListBoxHandler, weld::TreeView&, rBox, bool)
return true;
}
+IMPL_STATIC_LINK(SwFieldDialog, KeyInputHdl, const KeyEvent&, rKeyEvent, bool)
+{
+ bool bDone = false;
+ vcl::KeyCode aCode = rKeyEvent.GetKeyCode();
+ // nowhere to tab to
+ if (aCode.GetCode() == KEY_TAB)
+ bDone = true;
+ return bDone;
+}
+
DropDownFormFieldButton::DropDownFormFieldButton(SwEditWin* pEditWin,
sw::mark::DropDownFieldmark& rFieldmark)
: FormFieldButton(pEditWin, rFieldmark)