summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-02-14 13:15:41 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-02-16 18:31:48 +0100
commit575438b0b68baeee3d37d887d8645757a4505971 (patch)
treebd265d422172a3162f845d10291c4bbcd34a4e29
parent117da8dab05986380db586f1fae6a2f0af9ce389 (diff)
MSForms: Don't show popup dialog of drop-down field when there is no item list
Change-Id: Ife361e0ee18437da6f188e77713ea51403b70dbc Reviewed-on: https://gerrit.libreoffice.org/67910 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r--sw/source/uibase/uiview/viewling.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index 935f974ce75a..c29c1637ab87 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -912,6 +912,17 @@ IMPL_LINK_NOARG(SwView, FieldPopupModeEndHdl, FloatingWindow*, void)
void SwView::ExecFieldPopup( const Point& rPt, IFieldmark *fieldBM )
{
+ // Don't show popup if there is no list item
+ auto pListEntries = fieldBM->GetParameters()->find( ODF_FORMDROPDOWN_LISTENTRY );
+ Sequence< OUString > vListEntries;
+ if(pListEntries != fieldBM->GetParameters()->end())
+ {
+ pListEntries->second >>= vListEntries;
+ }
+
+ if(vListEntries.getLength() == 0)
+ return;
+
const Point aPixPos = GetEditWin().LogicToPixel( rPt );
m_pFieldPopup = VclPtr<SwFieldDialog>::Create( m_pEditWin, fieldBM );