diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-02-18 13:44:29 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-03-09 12:41:41 +0100 |
commit | 021332144074a9d20a3eab9ada117acfa7cdbfe0 (patch) | |
tree | 48652776c21d735dda0b0a85a626b05c63a05964 /sw | |
parent | a283db9b6553b232a29560dcc427329e5246f0ca (diff) |
MSForms: Fix drop-down form field properties dialog to work with vcl backend
Change-Id: I28a8d96d3ff31a53512af6d61c58594da7b9f73e
Reviewed-on: https://gerrit.libreoffice.org/68008
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/fldui/DropDownFormFieldDialog.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx index cb00cc2a255b..e52907fd6c74 100644 --- a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx +++ b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx @@ -27,8 +27,8 @@ DropDownFormFieldDialog::DropDownFormFieldDialog(weld::Window* pParent, , m_xListUpButton(m_xBuilder->weld_button("up_button")) , m_xListDownButton(m_xBuilder->weld_button("down_button")) { - getDialog()->connect_key_press(LINK(this, DropDownFormFieldDialog, KeyPressedHdl)); - getDialog()->connect_key_release(LINK(this, DropDownFormFieldDialog, KeyReleasedHdl)); + m_xListItemEntry->connect_key_press(LINK(this, DropDownFormFieldDialog, KeyPressedHdl)); + m_xListItemEntry->connect_key_release(LINK(this, DropDownFormFieldDialog, KeyReleasedHdl)); m_xListItemsTreeView->set_size_request(m_xListItemEntry->get_preferred_size().Width(), m_xListItemEntry->get_preferred_size().Height() * 5); @@ -49,20 +49,18 @@ IMPL_LINK_NOARG(DropDownFormFieldDialog, ListChangedHdl, weld::TreeView&, void) IMPL_LINK(DropDownFormFieldDialog, KeyPressedHdl, const KeyEvent&, rEvent, bool) { - if (m_xListItemEntry->has_focus() && rEvent.GetKeyCode().GetCode() == KEY_RETURN) + if (rEvent.GetKeyCode().GetCode() == KEY_RETURN && !m_xListItemEntry->get_text().isEmpty()) { AppendItemToList(); + return true; } - return false; // Call the dialog's input handler too + return false; } IMPL_LINK_NOARG(DropDownFormFieldDialog, KeyReleasedHdl, const KeyEvent&, bool) { - if (m_xListItemEntry->has_focus()) - { - UpdateButtons(); - } - return false; // Call the dialog's input handler too + UpdateButtons(); + return false; } IMPL_LINK(DropDownFormFieldDialog, ButtonPushedHdl, weld::Button&, rButton, void) |