summaryrefslogtreecommitdiff
path: root/sw/source/core/crsr/DropDownFormFieldButton.cxx
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-03-10 09:45:56 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-03-10 11:15:12 +0100
commitaa3b3ee8c2aad6af69f0710c7531ef2cf9fb1fc1 (patch)
treef6f3d657c58544748fe0a1cd3af2551e8931eacc /sw/source/core/crsr/DropDownFormFieldButton.cxx
parente9393e392e95ec8fcab77662790482aa0adf0f78 (diff)
MSForms: Fix handling of drop-down form field after DOC import
In the properties dialog, code expected that the ODF_FORMDROPDOWN_RESULT is not set in case of an empty list. This caused a crash. The field popup window code expected that the list is not specified when it is empty, but DOC import code sets ODF_FORMDROPDOWN_LISTENTRY even if the list is empty. Change-Id: If4c86fc5a08cdc578150afaa42ad7e86bdba9150 Reviewed-on: https://gerrit.libreoffice.org/68963 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw/source/core/crsr/DropDownFormFieldButton.cxx')
-rw-r--r--sw/source/core/crsr/DropDownFormFieldButton.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/crsr/DropDownFormFieldButton.cxx b/sw/source/core/crsr/DropDownFormFieldButton.cxx
index a4614da8932e..bef4c873dace 100644
--- a/sw/source/core/crsr/DropDownFormFieldButton.cxx
+++ b/sw/source/core/crsr/DropDownFormFieldButton.cxx
@@ -53,14 +53,15 @@ SwFieldDialog::SwFieldDialog(SwEditWin* parent, sw::mark::IFieldmark* fieldBM, l
OUString sListKey = ODF_FORMDROPDOWN_LISTENTRY;
sw::mark::IFieldmark::parameter_map_t::const_iterator pListEntries
= pParameters->find(sListKey);
+ css::uno::Sequence<OUString> vListEntries;
if (pListEntries != pParameters->end())
{
- css::uno::Sequence<OUString> vListEntries;
pListEntries->second >>= vListEntries;
for (OUString const& i : vListEntries)
aListBox->InsertEntry(i);
}
- else
+
+ if (vListEntries.getLength() == 0)
{
aListBox->InsertEntry(SwResId(STR_DROP_DOWN_EMPTY_LIST));
}