summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-11-04 09:55:53 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-11-04 15:11:56 +0100
commit6427bf87360a97f41ae351feaa35975c868260ec (patch)
tree0c23cf4d5c0d9c1f1b7ee6b44161f70ebae6ef1b /sw/source/ui
parentc4fc90af1355d80ad0c3e5130fd43a9b97d80b9a (diff)
negative returns
Change-Id: I6f710f1aecc2e242b6006a3360e31bf2a9438fe7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105286 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/fldui/DropDownFormFieldDialog.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
index a70488e46f19..a6d19972c529 100644
--- a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
+++ b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
@@ -119,7 +119,7 @@ void DropDownFormFieldDialog::InitControls()
{
sal_Int32 nSelection = -1;
pResult->second >>= nSelection;
- if (vListEntries.getLength() > nSelection)
+ if (nSelection >= 0 && nSelection < vListEntries.getLength())
m_xListItemsTreeView->select_text(vListEntries[nSelection]);
}
}