[Libreoffice-commits] core.git: Branch 'feature/msforms' - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Feb 18 12:45:11 UTC 2019


Rebased ref, commits from common ancestor:
commit e59111829d7baf739162a0e3e354e36197a8e32b
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: Mon Feb 18 13:44:29 2019 +0100

    MSForms: Fix drop-down form field properties dialog to work with vcl backend
    
    Change-Id: I28a8d96d3ff31a53512af6d61c58594da7b9f73e

diff --git a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
index cb00cc2a255b..09564999d321 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