sw/qa/uitest/writer_tests5/DropDownFormFieldPropertiesDialog.py | 9 +++++++++ sw/source/ui/fldui/DropDownFormFieldDialog.cxx | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-)
New commits: commit 7e70b40d68469a53895197ef3ef804616793d0d6 Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Sat Mar 9 08:40:50 2019 +0100 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Sun Mar 10 21:17:03 2019 +0100 MSForms: Fix removal of all items on the drop-down form field dialog Change-Id: Idbb9cb80fd842bc01ee857709a825821c2bcffd2 Reviewed-on: https://gerrit.libreoffice.org/69009 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 5628e83992e1..9b28759e4771 100644 --- a/sw/qa/uitest/writer_tests5/DropDownFormFieldPropertiesDialog.py +++ b/sw/qa/uitest/writer_tests5/DropDownFormFieldPropertiesDialog.py @@ -139,6 +139,15 @@ class dropDownFormFieldDialog(UITestCase): self.assertEqual(get_state_as_dict(itemsList.getChild("1"))["Text"], "3000") self.assertEqual(get_state_as_dict(itemsList.getChild("2"))["Text"], "4000") + # remove all items + itemsList.getChild("1").executeAction("SELECT", tuple()); + removeButton.executeAction("CLICK", tuple()) + removeButton.executeAction("CLICK", tuple()) + removeButton.executeAction("CLICK", tuple()) + + self.assertEqual(get_state_as_dict(removeButton)["Enabled"], "false") + self.assertEqual(get_state_as_dict(itemsList)["Children"], "1") + 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 4b6c848feefb..8bbb73b066f9 100644 --- a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx +++ b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx @@ -71,7 +71,7 @@ IMPL_LINK(DropDownFormFieldDialog, ButtonPushedHdl, weld::Button&, rButton, void if (&rButton == m_xListRemoveButton.get()) { m_xListItemsTreeView->remove(nSelPos); - m_xListItemsTreeView->select(nSelPos > 0 ? nSelPos - 1 : 0); + m_xListItemsTreeView->select(nSelPos - 1); } else if (&rButton == m_xListUpButton.get()) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits