summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-03-11 10:21:29 +0100
committerAndras Timar <andras.timar@collabora.com>2019-03-18 10:03:12 +0100
commit4479eac3ce1a154c538b04165746ba993e981ed9 (patch)
tree95e0ef1364f80a3ecfe3a31d877f06014350565c /sw
parent0b2d434106c50785b1c0317d49368c0dc6d084b0 (diff)
MSForms: Fix removal of all items on the drop-down form field dialog
Reviewed-on: https://gerrit.libreoffice.org/69038 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 31f1789c810970fda7b300b2943f20e10761a5e0) Change-Id: I37ffbbe48a8b08cc10c83d4bb68946908475776d Reviewed-on: https://gerrit.libreoffice.org/69201 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/fldui/DropDownFormFieldDialog.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
index 0a80eae05300..5ad97b85978c 100644
--- a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
+++ b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
@@ -68,7 +68,8 @@ IMPL_LINK(DropDownFormFieldDialog, ButtonPushedHdl, Button*, pButton, void)
if (pButton == m_xListRemoveButton)
{
m_xListItemsTreeView->RemoveEntry(nSelPos);
- m_xListItemsTreeView->SelectEntryPos(nSelPos > 0 ? nSelPos - 1 : 0);
+ if (m_xListItemsTreeView->GetEntryCount() > 0)
+ m_xListItemsTreeView->SelectEntryPos(nSelPos > 0 ? nSelPos - 1 : 0);
}
else if (pButton == m_xListUpButton)
{