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.zol...@collabora.com> AuthorDate: Mon Mar 11 10:21:29 2019 +0100 Commit: Tamás Zolnai <tamas.zol...@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.zol...@collabora.com> Tested-by: Tamás Zolnai <tamas.zol...@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()) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits