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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Mar 11 12:21:57 UTC 2019


 sw/qa/uitest/writer_tests5/DropDownFormFieldPropertiesDialog.py |    2 +-
 sw/source/ui/fldui/DropDownFormFieldDialog.cxx                  |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 31f1789c810970fda7b300b2943f20e10761a5e0
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Mar 11 10:21:29 2019 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 11 13:21:35 2019 +0100

    MSForms: Fix removal of all items on the drop-down form field dialog 2
    
    Change-Id: I37ffbbe48a8b08cc10c83d4bb68946908475776d
    Reviewed-on: https://gerrit.libreoffice.org/69038
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/sw/qa/uitest/writer_tests5/DropDownFormFieldPropertiesDialog.py b/sw/qa/uitest/writer_tests5/DropDownFormFieldPropertiesDialog.py
index 9b28759e4771..08797d9bb3ee 100644
--- a/sw/qa/uitest/writer_tests5/DropDownFormFieldPropertiesDialog.py
+++ b/sw/qa/uitest/writer_tests5/DropDownFormFieldPropertiesDialog.py
@@ -146,7 +146,7 @@ class dropDownFormFieldDialog(UITestCase):
         removeButton.executeAction("CLICK", tuple())
 
         self.assertEqual(get_state_as_dict(removeButton)["Enabled"], "false")
-        self.assertEqual(get_state_as_dict(itemsList)["Children"], "1")
+        self.assertEqual(get_state_as_dict(itemsList)["Children"], "0")
 
         xOKBtn = xDialog.getChild("ok")
         self.ui_test.close_dialog_through_button(xOKBtn)
diff --git a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
index 8bbb73b066f9..42312bca3693 100644
--- a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
+++ b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
@@ -71,7 +71,8 @@ IMPL_LINK(DropDownFormFieldDialog, ButtonPushedHdl, weld::Button&, rButton, void
         if (&rButton == m_xListRemoveButton.get())
         {
             m_xListItemsTreeView->remove(nSelPos);
-            m_xListItemsTreeView->select(nSelPos - 1);
+            if (m_xListItemsTreeView->n_children() > 0)
+                m_xListItemsTreeView->select(nSelPos ? nSelPos - 1 : 0);
         }
         else if (&rButton == m_xListUpButton.get())
         {


More information about the Libreoffice-commits mailing list