[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Mar 9 11:42:01 UTC 2019


 sw/source/ui/fldui/DropDownFormFieldDialog.cxx |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 021332144074a9d20a3eab9ada117acfa7cdbfe0
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Feb 18 13:44:29 2019 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Sat Mar 9 12:41:41 2019 +0100

    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 at collabora.com>

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)


More information about the Libreoffice-commits mailing list